LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices

Reply
 
Search this Thread
Old 01-19-2006, 10:56 PM   #1
alagenchev
Member
 
Registered: Oct 2004
Location: USA
Distribution: Slackware, Debian, Ubuntu
Posts: 223

Rep: Reputation: 30
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
 
Old 01-19-2006, 11:46 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
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.
 
Old 01-20-2006, 01:49 AM   #3
alagenchev
Member
 
Registered: Oct 2004
Location: USA
Distribution: Slackware, Debian, Ubuntu
Posts: 223

Original Poster
Rep: Reputation: 30
Thanks a lot,

That's exactly what I needed!
Ivan
 
Old 01-20-2006, 05:18 AM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 162Reputation: 162
No problem
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Making users change passwords on first login linuxpyro Linux - Security 1 12-24-2004 02:28 PM
How to make Samba users change password on first use eflester Linux - Security 0 10-12-2004 07:41 PM
ZIPSALCK: cannot login for d 1st time phektus Slackware 2 07-03-2003 10:43 PM
1st boot login problem matsat Linux - Newbie 2 06-25-2003 02:14 PM
Mandrake Linux Root Pswd/Login HELP ElZora Linux - Security 5 12-26-2002 02:47 PM


All times are GMT -5. The time now is 04:38 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration