Hi,
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.
Thanks in advance.
Bye.
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.
On Fri, Dec 20, 2002 at 12:10:58PM +0530, Sameer D. Sahasrabuddhe wrote:
- LUG meet on 12 Jan. 2003 @ VJTI
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?
The encrypted password, as returned by crypt(3).
Thanks sameer, when I was writing a program for crypt, I realized that there is an easier way, I did
passwd pass --stdin < amish
where amish is a file where I store the new password and pass is a use I created to test passwords. Definately this is not secured since anyone can see the file amish, so I will impliment it taking proper precautions. Thanks for the help.
HTH, Sameer. -- MTech Student, Reconfigurable Computing Lab, KReSIT, IIT-Bombay.
The Old Man and the Sea LITE(tm) -- by Ernest Hemingway
An old man goes fishing, but doesn't have much luck.
-- _______________________________________________