• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

The Geek Diary

CONCEPTS | BASICS | HOWTO

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • Linux Services
    • VCS
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
    • Data Guard
  • DevOps
    • Docker
    • Shell Scripting
  • Interview Questions
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Enable Password Aging in Linux with NIS

By admin

In order to enable password aging in Linux, the shadow file is used. Password aging is not managed in the /etc/passwd file with Linux, unlike other systems.

1. In /etc/login.defs, define PASS_MAX_DAYS to 90 instead of the default 9999:

# vi /etc/login.defs
PASS_MAX_DAYS=90

The above data from /etc/login.defs is used by useradd command and it creates the users with the mentioned password age.

2. For existing users reset the password aging using the following comand:

# chage -M 90 username

3. Run the command authconfig and make sure shadow passwords are enabled. NIS by default will not build the shadow file. Edit the file /var/yp/Makefile and make the following changes:

# vi /var/yp/Makefile
MERGE_PASSWD=false

In the line all:, add shadow as follows:

all:  shadow passwd group hosts rpc services netid protocols mail

4. Run the makefile. It will create a new map shadow.

5. Now NIS holds the password aging information, which can be seen by the following command:

# ypcat shadow.byname | grep user

Filed Under: Linux

Some more articles you might also be interested in …

  1. Troubleshooting “connection refused” From Remote Servers in CentOS/RHEL 7 (Either Firewalld or iptables service issue)
  2. How to add or delete a samba user under Linux
  3. 6 Bash Shell Command Line Chaining Operators in Linux
  4. How to Use the ssh-keygen Command to configure passwordless ssh
  5. CentOS / RHEL 6,7 : How to enable or disable XDMCP service (GDM)
  6. How to Configure an NFSv4-only Client using nfsconf in CentOS/RHEL 8
  7. How to Setup VNC Server for New User in CentOS/RHEL 5
  8. CentOS / RHEL 6 : How to Disable / Enable direct root login via telnet
  9. How to Permanently set the ethtool settings in CentOS/RHEL 6
  10. How to disable NetworkManager on CentOS / RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • What are Command Rules in oracle Database
  • Using Rule Sets in Oracle Database Vault
  • How Realms Work in Oracle Database Vault
  • How to use Privilege Analysis in Oracle Database
  • Archives
  • Contact Us
  • Copyright

© 2021 · The Geek Diary