Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-05-2015, 03:12 PM   #1
Registered: Feb 2007
Location: Sweden
Distribution: CentOS, Suse, Red Hat, OpenBSD, Solaris, Slackware
Posts: 40

Rep: Reputation: 15
Question Problem with changing /etc/login.defs


First I want to inform you that I'm running a RHEL 6.5 system.

I have some questions about the /etc/login.defs file. Does this file apply to all the users on the system, or does everyone have separate files?

I want to change the PASS_MAX_DAYS value from 99999 to 90 for all users on the system and wonder whats the correct way to do this? I noticed that after I changed this file manually it doesn't work. When typing "chage --list [username]" it shows a completley different value. Also, after managing this file, do I have to restart/reload some daemons or services to make it happen?

Could someone give me some good advice in this issue?

Thank you in advance.

Old 05-05-2015, 04:26 PM   #2
Senior Member
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
I have some questions about the /etc/login.defs file. Does this file apply to all the users on the system, or does everyone have separate files?
Yes this applies to all users on the system. However, it will not automatically change the values of existing users. Once you make the changes in this file the newly created users will have the definitions defined in this file but for existing users you have to make the changes manually. You can use a bash script to make the changes for existing users.
Old 05-05-2015, 10:52 PM   #3
Senior Member
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Is used by Linux-PAM. So any software compiled with PAM uses this data.
Old 05-05-2015, 11:01 PM   #4
Registered: May 2015
Posts: 39

Rep: Reputation: Disabled
The /etc/login.defs
is the file set the shadow password parameters, its contain the users account settings on the os its contain the min and max days for accounts access , contain the encryption method contain the umask settings you can check this man page for more information

If you would like to change the days and the warn days

Set the PASS_MAX_DAYS parameter to 90
# sudo chage --maxdays 90 <user>

Set the PASS_MIN_DAYS parameter
# sudo chage --mindays 7 <user>

Set the PASS_WARN_AGE parameter
# sudo chage --warndays 7 <user>

Change <user> the user account you want to conigure

I consile to give umask 077 to /etc/login.defs


login, system parameters, user account, user preferences

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
The login.defs file Corrado Linux - Security 1 04-16-2013 09:28 AM
LOGIN.DEFS defaults Linux_Kidd Linux - Server 3 09-04-2012 09:24 AM
I deleted login.defs by a mistake :( mortinoi Slackware 8 05-07-2010 02:57 PM
login.defs password expiry noir911 Linux - General 1 01-07-2007 12:38 PM
/etc/login.defs binary_0011 Linux - Newbie 1 11-06-2006 09:44 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration