nisant
1
Hi,
I'm trying to create a shell to change some user password with random string.
I've tried to use stdin redirection to supply the new password by a response file:
passwd theuser < respfile
but I continue to be prompted for supplying pwd via console keyboard.
Can you help me to find a way to change pwd in an unattended mode?
Thanks a lot.
RTM
2
Search these forums for Expect - Expect home page
Another way you could do it is to use Perl to create another password/shadow file, maniuplate the temp file and copy it over the old.
nisant
3
The first solution requires a big amount of work but would solve a set of cases larger than the simple password change task.
The second is more specific for my problem but is non suitable for all Unix OS (some doesn't use passwd/shadow to store passwords).
For Linux someone told me about chpasswd command that accepts a file for account/password definition.
This could solve the problem for Linux based platforms.
Thank you for help.