Tuesday, January 20, 2015

password policy

we have set password policy for Linux. we made configuration in
/etc/pam.d & / etc/login.defs but after doing this we checked using
#chage -l unixadmin it shows old configuration details those are not
reflecting, which we have make changes in configuration file.

can anybody tell me how to refresh login.defs file
or how to apply those changes to all users except root.

Linux nsk

<nsklinux@gmail.com>

___________________________________________________________________________________

#chage -I -1 -m 0 -M 99999 -E -1 ctmac631   
ctmac631 is example user
and 
faillog -u (-r for unlock) username (user status in linux)

Sagar B

<forlinuxdata@gmail.com>
__________________________________________________________________________________________________________________________________


If you have local use on each server then you dont have any option to run command for each use on each server :(

but yes to bypass this you can make script :)
Steps,
1. make backup of /etc/passwd/ & /etc/group file
2. Now, generate list of users which are affected in users.txt
3. Now you have to run for loop directly on your command prompt via root user.
    Ex. for x in `cat users.lst`
          do
          chage -I -1 -m 0 -M 99999 -E -1 $x
          
faillog -u $x
           done

And if you want to perform same on all server just run all this commands from single machine from where you have authorized_keys configured ( this will usefull to you for future use as well ) via root user

Sagar B

<forlinuxdata@gmail.com>
__________________________________________________________________________________
 
 

Amol Jangam

<amol.jangam85@gmail.com>
 
 

Amol Jangam

<amol.jangam85@gmail.com 

No comments:

Post a Comment