Prevent non-users from login into the system

Sometimes as administrator, you may need to some immediate repair work and need to prevent users from logging in immediately, you can easily do that by doing the following:

# touch /etc/nologin

If the file exists, only the root can gain accessnow