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

RE : how to generate passwords?

Well here is the script I made, don't laugh I'm not a good programmer
and I just made that in like a few minutes. I don't think it's secure or
anything like that but at least it works and that's what I needed for

Thanks to all who helped me.

Jean-Rene Cormier


if ($ds) {

if ($r == 1) {
if ($newpass1 == $newpass2) {
if ($newpass1 != $null) {
$info["userPassword"] = rtrim(shell_exec("/usr/sbin/slappasswd -h
{crypt} -s $newpass1"));
$info["lmPassword"] = rtrim(shell_exec("/usr/bin/mkntpwd -L
$info["ntPassword"] = rtrim(shell_exec("/usr/bin/mkntpwd -N

$mod_r =
echo "You password has been changed";
} else {
echo "You need to place a new password";
} else {
echo "The password doesn't match";
} else {
echo "Password is incorrect";
} else {
echo "Can't connect to LDAP server.";

-----Message d'origine-----
De : owner-openldap-software@OpenLDAP.org
[mailto:owner-openldap-software@OpenLDAP.org] De la part de tarjei@nu.no
Envoyé : 20 mars, 2002 09:24
À : openldap-software@OpenLDAP.org
Objet : Re: how to generate passwords?

You may also take a look at the mkntpass program. I think it's fairly 
easy to find if you read any of the samba-tng w/ldap howtos.

PS: I would apreciate if the finished phpscript would be made available 
to me (and the general public).


Tarjei Huse

ivan wrote:

>On Tue, 19 Mar 2002, Jean-Rene Cormier wrote:
>I do not know much about PHP, but if you running linux (e.g RH 7.2 you
>use mkpasswd to get a random string and pass it crypt to generate
>>I've set up OpenLDAP to do user authentication for a server and now
>>trying to make a script so user could change their password from the
>>in PHP but I can generate the password using the crypt function in PHP
>>and putting {crypt}whateverpassword  in the userPassword attribute and
>>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
>>how do you generate password for the lmPassword and ntPassword? Thanks
>>Jean-Rene Cormier