LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-31-2012, 01:15 AM   #1
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Rep: Reputation: 79
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.
 
Old 01-31-2012, 11:32 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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
 
1 members found this post helpful.
Old 02-01-2012, 02:18 AM   #3
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Original Poster
Rep: Reputation: 79
Wink

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,

Last edited by angel115; 02-01-2012 at 02:21 AM.
 
Old 02-01-2012, 07:52 PM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Still curious about how the user will know the passwd and the security issue of leaving it lying around .. ?
 
Old 02-06-2012, 04:57 AM   #5
angel115
Member
 
Registered: Jul 2005
Location: France / Ireland
Distribution: Debian mainly, and Ubuntu
Posts: 542

Original Poster
Rep: Reputation: 79
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to reset password ? vibinlakshman Ubuntu 15 07-08-2012 09:13 AM
[SOLVED] Autoreset pureftp password with expect script, no error but not working. angel115 Programming 4 02-28-2012 02:58 AM
How to retrieve( or reset) root password in Mandrake Linux, as I forgot my password? Reghunath Linux - Software 4 05-08-2008 04:11 AM
reset password duki Linux - Newbie 5 09-05-2007 04:12 AM
Password reset hongman Linux - Newbie 2 07-11-2005 05:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration