LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Automaticly reset pureftp password (https://www.linuxquestions.org/questions/linux-software-2/automaticly-reset-pureftp-password-926663/)

angel115 01-31-2012 01:15 AM

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.

chrism01 01-31-2012 11:32 PM

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

angel115 02-01-2012 02:18 AM

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
Thanks a lot,

chrism01 02-01-2012 07:52 PM

Still curious about how the user will know the passwd and the security issue of leaving it lying around .. ?

angel115 02-06-2012 04:57 AM

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.