Kiran Kumar M wrote:

> How can I change the password at the command line itself,
> for ex.: passwd <userid> <password>
> I want to eliminate the confirmation.

Something along these lines should do it:

usermod -p `perl -e "print crypt('newpasswd', 'XX')"` userlogin

replace XX with a relatively random two character (letter/number) combo.

Of course that assumes you're not using MD5 passwords.  the perl command
would be slightly different if you are...

As someone else pointed out, that can be dangerous.  But if there are no
potentially malicious users of the system, I wouldn't worry about it too
much.  I did something like that from a script at one time, and it
worked OK.



_______________________________________________
Redhat-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to