On Fri, Dec 20, 2002 at 12:02:19PM +0530, Amish Munshi wrote:
Is there a way to change passwords using a program or a script? I want to set a password for an account, using PHP script, but I do not mind going through the entire process of sudo, a c program, a shell script, etc. Absolutely anyway that can change a password from a script.
Assuming you have taken care of all the privileges, you can call usermod with the "-p password" option. From the manpage:
-p passwd The encrypted password, as returned by crypt(3). HTH, Sameer.