Linux is convenient and powerful, but its widespread use by folks who don't really have much idea about computer security, and its availability to malicious people who want to find ways to break computers, mean it is a popular target for network-based attacks.
The best thing, of course, is to get educated about computer security in general. Failing that, here are three easy steps to take, in order of importance, that will make your Linux box an order of magnitude more secure while you figure out which services you really need and how they work.
N.B.: no warranty expressed or implied. Use at your own risk (see "the Ultimate Firewall").
As root, go to /etc and edit the files hosts.allow
and hosts.deny.
Add the following line to hosts.deny:
ALL:ALL
Add the following line to hosts.allow:
ALL:LOCAL
This will deny access to all machines outside of Princeton (query: restrict access to
local subnet??? ). Other possibilities for hosts.allow list:
ALL:.princeton.edu (allow access from Princeton machines) ALL:128.112.136.0/255.255.252.0 (allow access from CS 136 subnet) ALL:cituser@arizona.princeton.edu (allow access for particular users)
inetd.conf The idea here is to shut off services you
may not need. New security holes are discovered all the time, but if you're not running a
service it doesn't matter if it has a security-related bug in it. Edit /etc/inetd.conf.
Comment out, by putting a # at the beginning of the line, all unnecessary
services. As a start, I suggest leaving only telnet, identd, and
time uncommented (you can add services such as ftp later, if you
decide you want them. [Note: as I was writing this, there was a new ftp
security hole announced. If you don't need it, keep it turned off!] You can still use
telnet and ftp from your Linux box to connect to other
machines).
After you've updated /etc/inetd.conf you have to tickle the inetd
daemon so it sees the updates:
kill -HUP `ps aux | grep inetd | grep -v grep | awk '{print $2}'`
Most of these security fixes (there are about 13 in total as of Feb. 1999) are relatively minor, and primarily accessible by local users; this is a fairly sharp contrast with RH 5.1. (For this reason I strongly recommend installing RH 5.2 instead of 5.1, and reasonably up-to-date distributions in general.) Nevertheless, you should look them over and decide which you need to install. My inexpert opinion is as follows:
This should be enough for basic peace of mind, but you may also want to: