[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: how to generate passwords?



>I've set up OpenLDAP to do user authentication for a server and now I'm
>trying to make a script so user could change their password from the web
>in PHP but I can generate the password using the crypt function in PHP
>and putting {crypt}whateverpassword  in the userPassword attribute and I

That should work.  You can send me your code off-list if you like and I'll 
take a look.  Does ldapsearch return it uuencoded?

>can log in using SSH but I can't bind using the script I made anymore.
>Anybody could help me with a way to generate passwords in PHP? And also
>how do you generate password for the lmPassword and ntPassword? Thanks

You'd have to look at the function nt_lm_owf_gen in libsmb/smbencrypt.c 
for how the passwords are generated.  It would probably be better to build 
samba with the  --with-libsmbclient and then write a little C to provide 
the functions you need via CORBA or XML-RPC and call those from PHP.

--with-libsmbclient causes the generation of a shared library file that 
provides lots of functions that Samba uses internally.

-- 
-----------------------------------------------------------
Ximian GNOME, Evolution, LTSP, and RedHat Linux + LVM & XFS
-----------------------------------------------------------