LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux 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
  Search this Thread
Old 02-07-2008, 03:19 PM   #1
ssy68
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Rep: Reputation: 0
How to force user to change password after expiration in Linux?


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.
 
Old 02-07-2008, 03:42 PM   #2
leonscape
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Debian SID / KDE 3.5
Posts: 2,313

Rep: Reputation: 48
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
 
Old 02-11-2008, 11:59 AM   #3
ssy68
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 02-11-2008, 01:32 PM   #4
ssy68
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 06-30-2011, 02:54 PM   #5
davidscholler
LQ Newbie
 
Registered: Mar 2010
Posts: 1

Rep: Reputation: 0
To quickly expire an account and have it prompt for change

chage -d 0 <username>
 
  


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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