Skip to Content.
Sympa Menu

freetds - [freetds] Trouble logging into SQL Server using tsql

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Chris Haag" <chaag123 AT gmail.com>
  • To: freetds AT lists.ibiblio.org
  • Subject: [freetds] Trouble logging into SQL Server using tsql
  • Date: Tue, 21 Feb 2006 11:00:58 -0800

Hi,

I am having trouble with what should be a simple authentication issue.
I have attempted to do my homework and hope I am not missing something
obvious. Thanks to anyone who takes a look!

At a high level I get "login failed"

-bash-3.00$ tsql -S BUSSYS -U 'CustomerSupport'
locale is "en_US.UTF-8"
locale charset is "UTF-8"
Password:
Msg 18456, Level 14, State 1, Server , Line 0
Login failed for user 'CustomerSupport'.
Msg 20014, Level 9, State 0, Server OpenClient, Line 0
Login incorrect.
There was a problem connecting to the server

Obviously, I'd think bad credentials. However, from an XP laptop,
using ODBC connections I can authenticate fine.

The SQL Server is set up to support "Mixed Mode" authentication, login
mode is set to "mixed" (i.e. hex value '2') for the named instance of
the DB

We're running SQL Server 2000 Enterprise Edition v8.00.194 (RTM) on
Windows Server 2003 Standard Edition (Service Pack 1)

-bash-3.00$ tsql -C
Compile-time settings (established with the "configure" script):
Versionion: freetds v0.63
MS db-lib source compatibility: yes
Sybase binary compatibility: unknown
Thread safety: yes
iconv library: yes
TDS version: 4.2
iODBC: no
unixodbc: yes
linux info
-bash-3.00$ uname -a
Linux durden1.run 2.6.9-22.ELsmp #1 SMP Fri Oct 7 09:23:20 CDT 2005
i686 i686 i386 GNU/Linux



I am using the vanilla freetds.conf, I have included my freetds.conf
at the bottom
I use tds version 8.0 for the DSN (though I have tried 7.0 and 4.2)

One thing that seems odd, using either the freetds.log OR tcpdump, I
do not "see" my password being sent?
++++++++START FREETDS.LOG++++++++++++++++


10:24:00.116273 Starting log file for FreeTDS 0.63
on 2006-02-21 10:24:00 with debug level 99.
10:24:00.116524 names for ISO-8859-1: ISO-8859-1
10:24:00.116561 names for UTF-8: UTF-8
10:24:00.116578 names for UCS-2LE: UCS-2LE
10:24:00.116593 names for UCS-2BE: UCS-2BE
10:24:00.116607 iconv to convert client-side data to the "UTF-8" character set
10:24:00.116643 tds_iconv_info_init: converting "UTF-8"->"UCS-2LE"
10:24:00.116682 tds_iconv_info_init: converting "ISO-8859-1"->"UCS-2LE"
10:24:00.116704 Connecting to x.x.x.x port 1433, TDS 8.0.
10:24:00.118565 tds_put_string converting 11 bytes of "durden1.run"
10:24:00.118602 tds_put_string wrote 22 bytes
10:24:00.118618 tds_put_string converting 15 bytes of "CustomerSupport"
10:24:00.118640 tds_put_string wrote 30 bytes
10:24:00.118657 tds_put_string converting 4 bytes of "TSQL"
10:24:00.118673 tds_put_string wrote 8 bytes
10:24:00.118688 tds_put_string converting 6 bytes of "BUSSYS"
10:24:00.118704 tds_put_string wrote 12 bytes
10:24:00.118719 tds_put_string converting 11 bytes of "TDS-Library"
10:24:00.118735 tds_put_string wrote 22 bytes
10:24:00.118750 tds_put_string converting 10 bytes of "us_english"
10:24:00.118766 tds_put_string wrote 20 bytes
10:24:00.118781 tds_put_string wrote 0 bytes
10:24:00.118819 tds_process_login_tokens()
10:24:00.126316 Received header
0000 04 01 00 70 00 00 01 00- |...p....|

10:24:00.126339 Received packet
0000 aa 5c 00 18 48 00 00 01-0e 28 00 4c 00 6f 00 67 |.\..H... .(.L.o.g|
0010 00 69 00 6e 00 20 00 66-00 61 00 69 00 6c 00 65 |.i.n. .f .a.i.l.e|
0020 00 64 00 20 00 66 00 6f-00 72 00 20 00 75 00 73 |.d. .f.o .r. .u.s|
0030 00 65 00 72 00 20 00 27-00 43 00 75 00 73 00 74 |.e.r. .' .C.u.s.t|
0040 00 6f 00 6d 00 65 00 72-00 53 00 75 00 70 00 70 |.o.m.e.r .S.u.p.p|
0050 00 6f 00 72 00 74 00 27-00 2e 00 00 00 00 00 fd |.o.r.t.' ........|
0060 02 00 00 00 00 00 00 00- |........|

10:24:00.126380 looking for login token, got aa(ERROR)
10:24:00.126402 tds_process_default_tokens() marker is aa(ERROR)
10:24:00.126434 tds_get_string: reading 80 from wire to give 40 to client.
10:24:00.126497 looking for login token, got fd(DONE)
10:24:00.126534 tds_process_default_tokens() marker is fd(DONE)
10:24:00.126566 tds_process_end: more_results = 0
was_cancelled = 0
error = 1
done_count_valid = 0
10:24:00.126599 tds_process_end() state set to TDS_IDLE
10:24:00.126629 leaving tds_process_login_tokens() returning 0
10:24:00.126703 tds_client_msg: #20014: "Login incorrect.".
Connection state is now 2.
10:24:00.126731 tds_free_all_results()


++++++END LOG+++++

relevant bit of tcpdump

10:13:19.012019 IP durden1.run.45124 > 10.251.1.29.ms-sql-s: P
1:233(232) ack 1 win 1460 <no p,nop,timestamp 2626095554 0>
0x0000: 4500 011c 3384 4000 4006 4d63 ac13 00ca E...3.@.@.Mc....
0x0010: 0afb 011d b044 0599 0273 3a42 566a 4e8d .....D...s:BVjN.
0x0020: 8018 05b4 0a22 0000 0101 080a 9c87 09c2 ....."..........
0x0030: 0000 0000 1001 00e8 0000 0100 e000 0000 ................
0x0040: 0100 0071 0000 0000 0683 f2f8 137c 0000 ...q.........|..
0x0050: 0000 0000 e003 0000 88ff ffff 3604 0000 ............6...
0x0060: 5600 0b00 6c00 0f00 8a00 0c00 a200 0400 V...l...........
0x0070: aa00 0600 0000 0000 b600 0b00 cc00 0a00 ................
0x0080: e000 0000 000e 0c62 9f83 e000 0000 e000 .......b........
0x0090: 0000 6400 7500 7200 6400 6500 6e00 3100 ..d.u.r.d.e.n.1.
0x00a0: 2e00 7200 7500 6e00 4300 7500 7300 7400 ..r.u.n.C.u.s.t.
0x00b0: 6f00 6d00 6500 7200 5300 7500 7000 7000 o.m.e.r.S.u.p.p.
0x00c0: 6f00 7200 7400 92a5 f2a5 a2a5 a2a5 53a5 o.r.t.........S.
0x00d0: 82a5 e2a5 73a5 f3a5 43a5 53a5 d2a5 5400 ....s...C.S...T.
0x00e0: 5300 5100 4c00 4200 5500 5300 5300 5900 S.Q.L.B.U.S.S.Y.
0x00f0: 5300 5400 4400 5300 2d00 4c00 6900 6200 S.T.D.S.-.L.i.b.
0x0100: 7200 6100 7200 7900 7500 7300 5f00 6500 r.a.r.y.u.s._.e.
0x0110: 6e00 6700 6c00 6900 7300 6800 n.g.l.i.s.h.
10:13:19.013164 IP x.x.x.x.ms-sql-s > durden1.run.45124: P 1:113(112)
ack 233 win 65303 <nop,nop,timestamp 3611900 2626095553>
0x0000: 4500 00a4 461c 4000 7e06 fd42 0afb 011d E...F.@.~..B....
0x0010: ac13 00ca 0599 b044 566a 4e8d 0273 3b2a .......DVjN..s;*
0x0020: 8018 ff17 4a8f 0000 0101 080a 0037 1cfc ....J........7..
0x0030: 9c87 09c1 0401 0070 0000 0100 aa5c 0018 .......p.....\..
0x0040: 4800 0001 0e28 004c 006f 0067 0069 006e H....(.L.o.g.i.n
0x0050: 0020 0066 0061 0069 006c 0065 0064 0020 ...f.a.i.l.e.d..
0x0060: 0066 006f 0072 0020 0075 0073 0065 0072 .f.o.r...u.s.e.r
0x0070: 0020 0027 0043 0075 0073 0074 006f 006d ...'.C.u.s.t.o.m
0x0080: 0065 0072 0053 0075 0070 0070 006f 0072 .e.r.S.u.p.p.o.r
0x0090: 0074 0027 002e 0000 0000 00fd 0200 0000 .t.'............
0x00a0: 0000 0000 ....


My understanding is that I'd "see" my password sent.

++++++++++
#
#
# $Id: freetds.conf,v 1.9 2003/12/04 22:26:55 freddy77 Exp $
# server specific section
[global]
# TDS protocol version
tds version = 8.0

; initial block size = 512

# uses some fixes required for some bugged MSSQL 7.0 server that
# return invalid data to big endian clients
# NOTE TDS version 7.0 or 8.0 should be used instead
; swap broken dates = no
; swap broken money = no

# Database server login method, if both server and domain
# logins are enabled, domain login is tried first if a domain
# is specified, and if that fails the server login will be used.
# OBSOLETE
; try server login = yes
; try domain login = no

# The default authentication domain, can be overridden by
# specifying a username with a domain prefix, e.g. DOMAIN\username
# OBSOLETE use DOMAIN\username as username
; nt domain = WORKGROUP

# If the server responds with different domain try that one?
# OBSOLETE never been used
; cross domain login = no

# Whether to write a TDSDUMP file for diagnostic purposes
# (setting this to /tmp is insecure on a multi-user system)
; dump file = /tmp/freetds.log
; debug level = 10

# Command and connection timeouts
; timeout = 10
; connect timeout = 10

# If you get out of memory errors, it may mean that your client
# is trying to allocate a huge buffer for a TEXT field.
# (Microsoft servers sometimes pretend TEXT columns are
# 4 GB wide!) If you have this problem, try setting
# 'text size' to a more reasonable limit
text size = 64512


[BUSSYS]
host = BUSSYS.COM
port = 1433
tds version = 8.0




Archive powered by MHonArc 2.6.24.

Top of Page