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
 

2 comments:

  1. BlueHost is definitely the best hosting provider with plans for any hosting needs.

    ReplyDelete
  2. QUANTUM BINARY SIGNALS

    Professional trading signals delivered to your cell phone every day.

    Follow our trades today & gain up to 270% per day.

    ReplyDelete