Sunday, 2 December 2012

Temporarily Disable User logins

       In case of any emergency maintenance activity, if you want to prevent users login to the server follow the steps. 

        This will not control root user login.
 
#touch  /etc/nologin
#vi /etc/nologin 
This system is down for maintenance.. No logins are permitted until 7.00 AM

  When a normal user logs in, the message in the /etc/nologin will be display and the login is rejected. Once maintenance window got completed, you can remove the file or if you reboot the machine automatically this file got deleted.

#rm /etc/nologin 

Note: 
       This is common for  Linux, Solaris and AIX. In Linux, ensure the line account required pam_nologin.so  is added in the /etc/pam.d/ssh file
 

No comments:

Post a Comment