LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 05-05-2015, 02:12 PM   #1
LuxLuv
Member
 
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


Hi,

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.

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

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quote:
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, 09:52 PM   #3
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
/etc/login.defs
Is used by Linux-PAM. So any software compiled with PAM uses this data.
 
Old 05-05-2015, 10:01 PM   #4
ccunlimited
Member
 
Registered: May 2015
Posts: 40

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
http://man7.org/linux/man-pages/man5/login.defs.5.html

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
 
  


Reply

Tags
login, system parameters, user account, user preferences



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

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

All times are GMT -5. The time now is 02:35 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
Open Source Consulting | Domain Registration