command to skip enter current password
I'm in root, and added a user test1 by useradd command.
Now I want to do something like 'su - test1 -c passwd' to change the password for test1 as user test1. The prompt will be: Changing password for test1 (current) UNIX password: But the test1 doesn't have a current password. Is there a command to let me su to be test1 from root but it will not prompt for the current password, and just let me type the new password? Thanks. |
If you are root, you could just say passwd test1 to add a password.
|
how about skipping the su step and just changing the password.
Code:
it-etch:~# passwd test1 |
I want to change passwd as test1 not as root. Because I want test1 password to apply pam restirctions. If I don't su, pam restrictions will not work.
|
What about changing the password via "# passwd test1" and -then- su'ing over and changing it?
|
Try writing a short Expect script and call that
su - test1 -c myscript Expect is designed to automate manual stuff like the paswd cmd |
ssy, if you change test12's password, you change tests1's password - it doesn't matter who does it (onlu root or test1 can probably).
Take up up the suggestion to either be root and passwd test1 or as another user sudo passwd test1 PAM will use test1's password just fine |
All times are GMT -5. The time now is 09:01 PM. |