logo       

[SUMMARY] Changing password via script: msg#00026

os.solaris.managers.summaries

Subject: [SUMMARY] Changing password via script

Hello everyone,

I've received a couple of answers. Thanks to everyone who gave a hint about
this.

The question was: How can I change via script or similar the password for
hundred of users without having to type it manually?

The general consensus was to use "expect" in order to feed the standard
"passwd" program. Other suggested to play with awk, sed or other utilities
in order to change "/etc/shadow" as needed.

As an example, here is a little piece of expect code that Mike Mann sent to
me:

--------------------------------------------------------------
spawn passwd david
expect "New Password: "
send "secret\r"
expect "Re-enter new Password: "
send "secret\r"
expect "passwd: password successfully changed for david"
--------------------------------------------------------------

Thanks to everyone for your help.

Regards,
David Arroyo


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise