OK, so the default access rules on a linux machine are quite lax
Here's how to make them better.
This guide will cover limiting who can log on where
by text, not on any graphical stuff (hence being in the server admin section ;] )
Access control is done through a file called
/etc/security/access.confaccess.conf is composed of one entry per line, with fields separated by a colon (:
)
The fields are:
- Whether to allow or disallow
- Who to allow or disallow
- Where to allow or disallow
So as an example, to disallow root login from anywhere other than local terminals:
-:root:ALL EXCEPT LOCAL
The minus sign says to disallow, then there is root (the account you're limiting), and then ALL EXCEPT LOCAL, which says that you want the rule to apply to everywhere except locally
If you wanted to allow root to login on tty1, you would have
+:root:tty1
Again, with the plus saying that you want to allow, the root being the account you are limiting, and the tty1 being where you are limiting.
The way that I have my servers set up now is to disallow root logins everywhere except tty1 (so I know that I can only be logged in in one place), and disallow anyone who isnt in the wheel or clilogin groups.
-:ALL EXCEPT wheel clilogin root:ALL
-:root:ALL EXCEPT tty1