Rodrigo De la Pena
2005-Oct-25 22:50 UTC
[Samba] Authentication problem with Mysql backend
hi, /**************************************************** i'm trying to configure samba with the mysql backend but it doesn't work. my smb.conf file is this: /**************************************************** #BOF [global] security = user workgroup = CABRERA encrypt passwords = no ;passdb backend = mysql:/usr/local/samba/lib/pdb/mysql.so passdb backend = mysql:mysql mysql:mysql host = localhost mysql:mysql user = samba mysql:mysql password = abmas mysql:mysql database = samba mysql:mysql table = user mysql:username column = username: mysql:lanman pass column = lm_pw: mysql:nt pass column = nt_pw: ;mysql:plain pass column = plain_pw: mysql:unknown_3 column = NULL #EOF /**************************************************** when i run smbclient it fails /**************************************************** [root@ns ~]# smbclient //localhost/rodelapena -U rodelapena -d 10 INFO: Current debug levels: all: True/10 tdb: False/0 printdrivers: False/0 lanman: False/0 smb: False/0 rpc_parse: False/0 rpc_srv: False/0 rpc_cli: False/0 passdb: False/0 sam: False/0 auth: False/0 winbind: False/0 vfs: False/0 idmap: False/0 quota: False/0 acls: False/0 locking: False/0 msdfs: False/0 lp_load: refreshing parameters Initialising global parameters params.c:pm_process() - Processing configuration file "/usr/local/samba/lib/smb.conf" Processing section "[global]" doing parameter security = user doing parameter workgroup = CABRERA doing parameter encrypt passwords = no doing parameter passdb backend = mysql:mysql doing parameter mysql:mysql host = localhost doing parameter mysql:mysql user = samba doing parameter mysql:mysql password = abmas doing parameter mysql:mysql database = samba doing parameter mysql:mysql table = user doing parameter mysql:username column = username: doing parameter mysql:lanman pass column = lm_pw: doing parameter mysql:nt pass column = nt_pw: doing parameter mysql:unknown_3 column = NULL pm_process() returned Yes lp_servicenumber: couldn't find homes set_server_role: role = ROLE_STANDALONE Attempting to register new charset UCS-2LE Registered charset UCS-2LE Attempting to register new charset UTF-16LE Registered charset UTF-16LE Attempting to register new charset UCS-2BE Registered charset UCS-2BE Attempting to register new charset UTF-16BE Registered charset UTF-16BE Attempting to register new charset UTF8 Registered charset UTF8 Attempting to register new charset UTF-8 Registered charset UTF-8 Attempting to register new charset ASCII Registered charset ASCII Attempting to register new charset 646 Registered charset 646 Attempting to register new charset ISO-8859-1 Registered charset ISO-8859-1 Attempting to register new charset UCS2-HEX Registered charset UCS2-HEX Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE Substituting charset 'UTF-8' for LOCALE added interface ip=200.255.255.255 bcast=200.255.255.255 nmask=255.255.255.252 added interface ip=192.168.0.2 bcast=192.168.0.255 nmask=255.255.255.0 Netbios name list:- my_netbios_names[0]="NS" Client started (version 3.0.20b). internal_resolve_name: looking up localhost#20 Opening cache file at /usr/local/samba/var/locks/gencache.tdb Returning expired cache entry: key = NBT/LOCALHOST#20, value 127.0.0.1:0, timeout = Tue Oct 25 11:30:23 2005 no entry for localhost#20 found. Deleting cache entry (key = NBT/LOCALHOST#20) resolve_lmhosts: Attempting lmhosts lookup for name localhost<0x20> getlmhostsent: Ill formed hosts line [samba.myhost.com] resolve_wins: Attempting wins lookup for name localhost<0x20> resolve_wins: WINS server resolution selected and no WINS servers listed. resolve_hosts: Attempting host lookup for name localhost<0x20> remove_duplicate_addrs2: looking for duplicate address/port pairs namecache_store: storing 1 address for localhost#20: 127.0.0.1:0 Adding cache entry with key = NBT/LOCALHOST#20; value = 127.0.0.1:0 and timeout = Tue Oct 25 17:47:55 2005 (660 seconds ahead) internal_resolve_name: returning 1 addresses: 127.0.0.1:0 Connecting to 127.0.0.1 at port 445 socket option SO_KEEPALIVE = 0 socket option SO_REUSEADDR = 0 socket option SO_BROADCAST = 0 socket option TCP_NODELAY = 1 socket option TCP_KEEPCNT = 9 socket option TCP_KEEPIDLE = 7200 socket option TCP_KEEPINTVL = 75 socket option IPTOS_LOWDELAY = 0 socket option IPTOS_THROUGHPUT = 0 socket option SO_SNDBUF = 50436 socket option SO_RCVBUF = 87680 socket option SO_SNDLOWAT = 1 socket option SO_RCVLOWAT = 1 socket option SO_SNDTIMEO = 0 socket option SO_RCVTIMEO = 0 session request ok write_socket(4,183) write_socket(4,183) wrote 183 got smb length of 85 size=85 smb_com=0x72 smb_rcls=0 smb_reh=0 smb_err=0 smb_flg=136 smb_flg2=49153 smb_tid=0 smb_pid=13401 smb_uid=0 smb_mid=1 smt_wct=17 smb_vwv[ 0]= 7 (0x7) smb_vwv[ 1]=12801 (0x3201) smb_vwv[ 2]= 256 (0x100) smb_vwv[ 3]= 1024 (0x400) smb_vwv[ 4]= 65 (0x41) smb_vwv[ 5]= 0 (0x0) smb_vwv[ 6]= 256 (0x100) smb_vwv[ 7]=23040 (0x5A00) smb_vwv[ 8]= 52 (0x34) smb_vwv[ 9]=64768 (0xFD00) smb_vwv[10]=32995 (0x80E3) smb_vwv[11]=32768 (0x8000) smb_vwv[12]=61789 (0xF15D) smb_vwv[13]=46233 (0xB499) smb_vwv[14]=50649 (0xC5D9) smb_vwv[15]=11265 (0x2C01) smb_vwv[16]= 1 (0x1) smb_bcc=16 [000] 43 00 41 00 42 00 52 00 45 00 52 00 41 00 00 00 C.A.B.R. E.R.A... size=85 smb_com=0x72 smb_rcls=0 smb_reh=0 smb_err=0 smb_flg=136 smb_flg2=49153 smb_tid=0 smb_pid=13401 smb_uid=0 smb_mid=1 smt_wct=17 smb_vwv[ 0]= 7 (0x7) smb_vwv[ 1]=12801 (0x3201) smb_vwv[ 2]= 256 (0x100) smb_vwv[ 3]= 1024 (0x400) smb_vwv[ 4]= 65 (0x41) smb_vwv[ 5]= 0 (0x0) smb_vwv[ 6]= 256 (0x100) smb_vwv[ 7]=23040 (0x5A00) smb_vwv[ 8]= 52 (0x34) smb_vwv[ 9]=64768 (0xFD00) smb_vwv[10]=32995 (0x80E3) smb_vwv[11]=32768 (0x8000) smb_vwv[12]=61789 (0xF15D) smb_vwv[13]=46233 (0xB499) smb_vwv[14]=50649 (0xC5D9) smb_vwv[15]=11265 (0x2C01) smb_vwv[16]= 1 (0x1) smb_bcc=16 [000] 43 00 41 00 42 00 52 00 45 00 52 00 41 00 00 00 C.A.B.R. E.R.A... Serverzone is 18000 Password: write_socket(4,164) write_socket(4,164) wrote 164 got smb length of 35 size=35 smb_com=0x73 smb_rcls=109 smb_reh=0 smb_err=49152 smb_flg=136 smb_flg2=49153 smb_tid=0 smb_pid=13401 smb_uid=0 smb_mid=2 smt_wct=0 smb_bcc=0 size=35 smb_com=0x73 smb_rcls=109 smb_reh=0 smb_err=49152 smb_flg=136 smb_flg2=49153 smb_tid=0 smb_pid=13401 smb_uid=0 smb_mid=2 smt_wct=0 smb_bcc=0 lang_tdb_init: loading /usr/local/samba/var/locks/lang_en_US.UTF-8.tdb session setup failed: NT_STATUS_LOGON_FAILURE /**************************************************** i created the user rodelapena in mysql: /**************************************************** mysql> select * from user; +------------+-------------+--------------+-------------------- +----------------------+-----------------------+------------+--------- +-------------+--------------------+---------------------+----------- +--------------+--------------+-----------+--------------+------------- +-------------+-----+------+------------------------------------------ +---------------------------------------------- +----------------------------------+---------------------------------- +-----------+-----------+------------+-----------+----------- +-----------+--------------------+-------------+-------------+ | logon_time | logoff_time | kickoff_time | pass_last_set_time | pass_can_change_time | pass_must_change_time | username | domain | nt_username | nt_fullname | home_dir | dir_drive | logon_script | profile_path | acct_desc | workstations | unknown_str | munged_dial | uid | gid | user_sid | group_sid | lm_pw | nt_pw | acct_ctrl | unknown_3 | logon_divs | hours_len | unknown_5 | unknown_6 | bad_password_count | logon_count | logon_hours | +------------+-------------+--------------+-------------------- +----------------------+-----------------------+------------+--------- +-------------+--------------------+---------------------+----------- +--------------+--------------+-----------+--------------+------------- +-------------+-----+------+------------------------------------------ +---------------------------------------------- +----------------------------------+---------------------------------- +-----------+-----------+------------+-----------+----------- +-----------+--------------------+-------------+-------------+ | NULL | NULL | NULL | 1129134562 | 1129134562 | 2147483647 | rodelapena | CABRERA | admin | Rodrigo De la Pena | //home2/rodelapena/ | Z: | NULL | NULL | NULL | NULL | NULL | NULL | 502 | 0 | S-1-5-21-3648153577-3102470278-178895188 | S-1-5-21-3648153577-3102470278-178895188-513 | 1B85CB90BF277B6BCAE10E534CAEEE0E | 81ADF7E68947CFE8733384295EAD6334 | 16 | NULL | NULL | NULL | NULL | 1260 | NULL | NULL | NULL | +------------+-------------+--------------+-------------------- +----------------------+-----------------------+------------+--------- +-------------+--------------------+---------------------+----------- +--------------+--------------+-----------+--------------+------------- +-------------+-----+------+------------------------------------------ +---------------------------------------------- +----------------------------------+---------------------------------- +-----------+-----------+------------+-----------+----------- +-----------+--------------------+-------------+-------------+ /**************************************************** the dir exists in the route showed up. //home2/rodelapena/ i don't know what is going on, the pdbedit command fails when i try to create an user but doesn't when i update it. I'm very new in samba, if you can help me with this problem i'll thank you ever. Thanks a lot. /**************************************************** -- Rodrigo De la Pe?a Soporte Corporativo Calipso Comunicaciones
Whoh man... did you create the unix user-account aswell ?? also try to change these settings: -> encrypt passwords = YES -> passdb backend = mysql:mysql -> #mysql:username column = username: -> #mysql:lanman pass column = lm_pw: -> #mysql:nt pass column = nt_pw: -> #mysql:plain pass column = plain_pw: -> #mysql:unknown_3 column = NULL also what version of samba do you use ?? Rodrigo De la Pena wrote:> hi, > > /**************************************************** > i'm trying to configure samba with the mysql backend but it doesn't > work. my smb.conf file is this: > /**************************************************** > #BOF > [global] > security = user > workgroup = CABRERA > encrypt passwords = no > ;passdb backend = mysql:/usr/local/samba/lib/pdb/mysql.so > passdb backend = mysql:mysql > mysql:mysql host = localhost > mysql:mysql user = samba > mysql:mysql password = abmas > mysql:mysql database = samba > mysql:mysql table = user > > mysql:username column = username: > mysql:lanman pass column = lm_pw: > mysql:nt pass column = nt_pw: > ;mysql:plain pass column = plain_pw: > mysql:unknown_3 column = NULL > > #EOF > > /**************************************************** > when i run smbclient it fails > /**************************************************** > > [root@ns ~]# smbclient //localhost/rodelapena -U rodelapena -d 10 > /**************************************************** > the dir exists in the route showed up. //home2/rodelapena/ > > > i don't know what is going on, the pdbedit command fails when i try to > create an user but doesn't when i update it. > > I'm very new in samba, if you can help me with this problem i'll thank > you ever. > > Thanks a lot. > /**************************************************** > > > >