LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   make users change pswd on 1st login (https://www.linuxquestions.org/questions/linux-security-4/make-users-change-pswd-on-1st-login-405616/)

alagenchev 01-19-2006 09:56 PM

make users change pswd on 1st login
 
Hi, I have set up a sftp/ssh server at home, and I would like to give access to my friends. I am the only admin, and only I can add users. However, I would like to give them the freedom to pick their passwords. Most of my friends don't know jack about UNIX, so I would like to make them change their passwords with a nice looking script, on the first login. how can I do that. I am thinking about writing a shell script, but how can I make it execute only on the first login. I am open to other solutions as well.
Thanx for any help

gilead 01-19-2006 10:46 PM

As far as shell access (SSH) goes, once you create the account, run:

Code:

passwd -e username
Where username is the new user you created. The existing password is now expired. When they log in using SSH, they'll enter the password you gave them and go through the following:

Code:

login as: oracle
oracle@xx.xxx.xx.xx's password:
Last login: Fri Jan 20 14:35:47 2006 from xx.xxx.xx.xx
Linux 2.6.13.
WARNING: Your password has expired.
You must change your password now and login again!
Changing password for oracle
Old password:
Enter the new password (minimum of 5, maximum of 127 characters)
Please use a combination of upper and lower case letters and numbers.
New password:
Re-enter new password:

It's not pretty (and entering the old password twice is a pain), but it saves you some mucking around.

alagenchev 01-20-2006 12:49 AM

Thanks a lot,

That's exactly what I needed!
Ivan

gilead 01-20-2006 04:18 AM

No problem :)


All times are GMT -5. The time now is 04:16 PM.