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.
Author comments are in a darker gray color for you to easily identify the posts author in the comments
Bro i think is /etc/nologin.
woops, good eye man.
I wrote /etc/nologin but in the command /etc/login.