How can I prevent logins? I need a way to disable logins from the root user account without being at the server console itself.
Many modern Unix/Linux systems respect the /etc/nologin file. Simply login as root and do "touch /etc/nologin". This restricts logins to root only. When you want to allow users again, "rm /etc/nologin".
Many systems also allow you to add text to /etc/nologin. When users attempt to login, they see that text.
$ ssh email@example.com
Logins currently not allowed.
Check back in an hour or so, thanks.
Older systems like SCO Unix don't have that. For these systems, you need to add code to /etc/profile. For example, you could add this: