Automaticly reset pureftp password
Hello There,
I'm trying to write a script that will reset the password of a specific user every night and write the new password of that user in a password.txt file located in the home folder of that user. I've try to write a script with expect, but although I don't get any error message it doesn't reset the password: http://www.linuxquestions.org/questi...orking-923997/ Do you have any idea how can I do this? Best regards, Angel. |
Interesting ... how is the user going to login to get the new passwd once you've changed it???
To say nothing of the dangers of leaving it readable in a user's dir... In any case, this should work to change it Code:
echo newpasswd | passwd --stdin username |
Hi Chris,
Sorry I forgot to mention, I'm not using unix user but virtual user stored in /etc/pureftpd.passwd So to change password I need to use the command pure-pw So your solution does not apply, but it help me a lot to find the answer anyway. The following works fine for me: Code:
( echo "TelPassword" ; echo "TelPassword" ) | pure-pw passwd Tel -f /etc/pureftpd.passwd -m |
Still curious about how the user will know the passwd and the security issue of leaving it lying around .. ?
|
The password is generated randomly every night and send by email to the admin of the account.
I don't store the password in a file any more. |
All times are GMT -5. The time now is 02:01 PM. |