LinuxQuestions.org
Visit Jeremy's Blog.
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, 09: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, 10:46 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
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, 12: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, 04:18 AM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

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

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 02:33 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