[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How can I change a password from a script?



Enrico Zini wrote:
> Now we have shadow passwords, MD5 hashes, NIS, LDAP, PAM... wow!  It's
> fantastic, but I need something that knows how to change passwords on my
> system, because I don't.

Check out chpasswd - you can pass it a list of username:newpassword
pairs.

> I would like to call passwd from my setuid root CGI (in which all security
> precautions would have been taken), feed him the new password and let him to
> whatever it pleases, but it could complain about passwords being too weak.

Look into cgiwrap.  It'll take care of a lot of the security issues for
you.

If you're doing this to make it easier on the commandline-phobics to
change their password, consider changing their shell to /usr/bin/passwd
and embedding a telnet link in the web page.  This is assuming from your
comments about Samba that you're using your linux box as a server and
the users never login directly - obviously this won't work if they're
actually using their shell accounts.

No suid root cgi that way, no having to worry about the security issues.

jpb
-- 
Joe Block <jpb@creol.ucf.edu>
CREOL System Administrator

Social graces are the packet headers of everyday life.


Reply to: