Temporarily disable user logins in Linux

As a Linux administrator it is sometimes necessary to stop users from login in to your box. This scenario is typically seen during system maintenance cycles, critical updates or scheduled/unscheduled software installs.

The easiest way to accomplish this is to simply create a nologin file in /etc/ .

To stop users from login in run the following command.

# touch /etc/nologin

To reverse the effect and allow users to log in run the following command.

# rm /etc/nologin

The above commands work fine on my CenOS5 and openSUSE 10.2 machines.

2 Responses to “Temporarily disable user logins in Linux”

Author comments are in a darker gray color for you to easily identify the posts author in the comments

  1. Aik says:

    Bro i think is /etc/nologin. :P

  2. Danny says:

    woops, good eye man.

    I wrote /etc/nologin but in the command /etc/login.

Leave a Reply

© 2008-2009 The Danesh Project
Powered by Wordpress and made by Guerrilla. Best viewed in Mozilla Firefox