LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Newbie
User Name
Password
Linux - Newbie This forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Thread Tools
Old 02-07-2008, 04:19 PM   #1
ssy68
LQ Newbie
 
Registered: Jan 2008
Posts: 10
Thanked: 0
How to force user to change password after expiration in Linux?


[Log in to get rid of this advertisement]
In Linux system, I have the password aging set to 2 days in /etc/login.defs. I created a user and password. After 2 days, when I try to login, the user is locked out because of password has been expired. Is there a way that can allow the user to login after the password expires, but force the user to change the password after login and the user is not allowed to do anything without changing a new password?

Thanks.
ssy68 is offline     Reply With Quote
Old 02-07-2008, 04:42 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313
Thanked: 0
IF your using shadow suite, then simply set the inactive to how many days after the password expires to allow the user to change it. 0 means never make the account inactive.

To change a current user

usermod -f0 username

To make this the default for new users

useradd -D -f0
leonscape is offline     Reply With Quote
Old 02-11-2008, 12:59 PM   #3
ssy68
LQ Newbie
 
Registered: Jan 2008
Posts: 10
Thanked: 0

Original Poster
I tried this, but I still can not login after the user password is expired, and there is no way to change password for the user except login as root. Is there any other way or script or so can do the thing as I expected?

Thanks.
ssy68 is offline     Reply With Quote
Old 02-11-2008, 02:32 PM   #4
ssy68
LQ Newbie
 
Registered: Jan 2008
Posts: 10
Thanked: 0

Original Poster
I also tried to use "passwd -e user" to expire a user and see if the force password changing functionality work, but I don't see the prompt to force me to change password. Is my linux system or PAM module has problem? or there is any configuration I need to change to see the force prompt? or I need other modules to make work? How to debug/fix this issue?

Thanks.
ssy68 is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

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 force a user/password prompt to logon? binary66 Puppy 5 09-08-2006 06:50 AM
How to force user to enter username and password sxcheng Linux - Security 1 02-23-2005 06:46 AM
How to force a user to change their NIS password at logon? synthol6 AIX 0 10-07-2004 11:36 AM
Password expiration klmn1 Linux - Networking 1 12-26-2002 01:08 PM


All times are GMT -5. The time now is 03:30 AM.

Main Menu
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
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration