[Samba] pdb_mysql question...

Luís Miguel Silva lms at ispgaya.pt
Sat Sep 27 17:53:03 GMT 2003

Hello everybody,

Thanks to Jelmers help im now able to use mysql support sucessfully (thanks again Jelmer).

I now need a way to generate NT4/LM hashes so i can insert new accounts without using smbpasswd.
Has anybody got a script/windows program/cgi/whatever to do this?

I cant find any function to generate a NT4/LM hash!

My problem is im coding a windows program to generate/manage all the users on the system and i want to be able to do it in ONE single step!

Its pretty stupid having to add the users on the windows machine and then go to the server terminal and execute
smbpasswd -a user password

(heh..sorry for my bad english, i hope i made my self clear :o)

Thanks in advance,
| 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:55
Para: Luís Miguel Silva
Cc: samba at lists.samba.org
Assunto: Re: [Samba] pdb_mysql question...


On Sat, Sep 27, 2003 at 05:54:56PM +0100, Luís Miguel Silva wrote about 'RE: [Samba] pdb_mysql question...':
> 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!
It checks whether the account already exists. Oh, make sure there is a
unix account named 'user' before you add a Samba account with such a

> 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!
Probably because there's no unix account for the user yet...

> How do i had a user/change its password?

> Is there any official howto on how to (sucessfully) use pdb_mysql???
Read the HOWTO collection from the tarball and/or read
the version generated out of CVS at http://samba.vernstok.nl/.

Jelmer Vernooij                                              <jelmer at samba.org>
http://samba.org/~jelmer/                             http://samba.vernstok.nl/
Last CVS commit: Fri Sep 26 12:22:04 2003 (1d 4h 30m ago)
Bugs in bugzilla: 14 

More information about the samba mailing list