[Samba] pdb_mysql question...

Luís Miguel Silva lms at ispgaya.pt
Sat Sep 27 16:54:56 GMT 2003


Hello Jelmer,

Thanks for the quick response!
It now loads the plugin correctly :o)

However..im getting another problem.
I thought "smbpasswd -a user password" would create the user on the db...but it doesnt:

root at auth /usr/local/samba/bin# ./smbpasswd -a user password
Connecting to database server, host: localhost, user: samba, password: ambas, database: samba, port: 3306
Failed initialise SAM_ACCOUNT for user user.
Failed to modify password entry for user user
root at auth /usr/local/samba/bin#

(on the mysql server i see this:)
030927 17:48:28      42 Connect     samba at localhost on samba
                     42 Query       SELECT 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,user_sid,group_sid,lm_pw,nt_pw,NULL,acct_ctrl,unknown_3,logon_divs,hours_len,unknown_5,unknown_6 FROM user WHERE username = 'user'

Which evidently tells me it is trying to GET the account before changing it!

Poking around the binaries i saw this new one:
root at auth /usr/local/samba/bin# ./pdbedit -a user
Server's Role (logon server) NOT ADVISED with domain-level security
Connecting to database server, host: localhost, user: samba, password: ambas, database: samba, port: 3306
Connecting to database server, host: localhost, user: samba, password: ambas, database: samba, port: 3306
could not create account to add new user user
root at auth /usr/local/samba/bin#

and on the mysql server i see:
030927 17:50:11      45 Connect     samba at localhost on samba
                     46 Connect     samba at localhost on samba

It just connects and logs off!

How do i had a user/change its password?

I created the mysql account with:
grant all privileges on samba.* to samba at localhost identified by 'ambas' with grant option;

It *should* have enough privileges!

Is there any official howto on how to (sucessfully) use pdb_mysql???

Thanks!
+-----------------------------------------
| Luís Miguel Silva
| Network Administrator@ ISPGaya.pt
| Rua António Rodrigues da Rocha, 291/341 
| Sto. Ovídio • 4400-025 V. N. de Gaia
| Portugal
| T: +351 22 3745730/3/5  F: +351 22 3745738
| G: +351 93 6371253      E: lms at ispgaya.pt
| H: http://lms.ispgaya.pt/
+----------------------------------------- 

-----Mensagem original-----
De: Jelmer Vernooij [mailto:jelmer at charis.lan.vernstok.nl]Em nome de
Jelmer Vernooij
Enviada: sábado, 27 de Setembro de 2003 17:36
Para: Luís Miguel Silva
Cc: samba at lists.samba.org
Assunto: Re: [Samba] pdb_mysql question...


Hi,

On Sat, Sep 27, 2003 at 05:35:15PM +0100, Luís Miguel Silva wrote about '[Samba] pdb_mysql question...':
> Iam trying to install samba 3.0 with pdb_mysql support though im getting some trouble i cant understand.

> After reading the output of ./configure --help, i used the following configure args:
> ./configure --with-expsam=xml,mysql --with-pam --with-pam_smbpass
> make
> make install

> then i took a look at ./examples/pdb/mysql/smb.conf and:
> root at auth /usr/src/installs/samba-3.0.0/examples/pdb/mysql# cat smb.conf
> [global]
> netbios name = FOOBAR
> workgroup = TESTGROUP
> security = domain
> domain logons = yes
> domain master = yes
> passdb backend = plugin:/usr/local/samba/lib/pdb_mysql.so:mysql
> mysql:mysql host = rhonwyn
> mysql:mysql user = samba
> mysql:mysql password = ambas
> mysql:mysql database = samba
> root at auth /usr/src/installs/samba-3.0.0/examples/pdb/mysql# ls -l /usr/local/samba/lib/pdb_mysql.so
> /bin/ls: /usr/local/samba/lib/pdb_mysql.so: No such file or directory
> root at auth /usr/src/installs/samba-3.0.0/examples/pdb/mysql# ls -l /usr/local/samba/lib/pdb/mysql.so
> -rwxr-xr-x    1 root     root       270098 Sep 27 17:15 /usr/local/samba/lib/pdb/mysql.so*
> root at auth /usr/src/installs/samba-3.0.0/examples/pdb/mysql#

> So i made up a simple test with:
> root at auth /usr/src/installs/samba-3.0.0/examples/pdb/mysql# cat /usr/local/samba/lib/smb.conf
> [global]
> netbios name = FOOBAR
> workgroup = TESTGROUP
> security = domain
> domain logons = yes
> domain master = yes
> passdb backend = plugin:/usr/local/samba/lib/pdb/mysql.so:mysql
> mysql:mysql host = localhost
> mysql:mysql user = samba
> mysql:mysql password = ambas
> mysql:mysql database = samba
> root at auth /usr/src/installs/samba-3.0.0/examples/pdb/mysql#

> It booted up correctly but when i try to had a user i get:
> root at auth /usr/local/samba/bin# ./smbpasswd -a lms
> New SMB password:
> Retype new SMB password:
> No builtin nor plugin backend for plugin found
> Loading plugin:/usr/local/samba/lib/pdb/mysql.so:mysql failed!
> Failed initialise SAM_ACCOUNT for user lms.
> Failed to modify password entry for user lms
> root at auth /usr/local/samba/bin#

> Can anybody tell me how to solve this? i cant find this "error" mentioned anywhere on the net.
> I need to upgrade a server to use this auth in a couple of days so im pretty desperate.

Try the following in your smb.conf:

 passdb backend = mysql:mysql

(the 'plugin' backend is obsolete).

Jelmer

-- 
Jelmer Vernooij <jelmer at nl.linux.org> - http://jelmer.vernstok.nl/


More information about the samba mailing list