MYSYSAD.COM

Disable All Users From Logging Into the System

· Users & security

There are times when you may need to prevent users from logging into the system. Here is a way of doing that.

# cat > /etc/nologin
The system is currently unavailable to all users. Try back in two hours.
Ctrl+d

Here is the message you will get when you try to login as a user. As you can see, it echoes the contents of the /etc/nologin file.

# login
login: esofthub
Password:
The system is currently unavailable to all users. Try back in two hours.