The best thing, of course, is to get educated about computer security in general. Failing that, here are four 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").
This material is a work in progress, constructive feedback is much appreciated ... most of this advice is targeted towards Red Hat 5.2 and towards machines in the Ecology and Evolutionary Department at Princeton University, but it should be somewhat more widely applicable.
Last update: 16 June 1999 (RH 6.0 patch descriptions)
As of 14 June, kernel 2.0.37 is available. According to
www.kernelnotes.org,
"Probably the last 2.0.x release. It fixes a number of DoS (Denial of Service) vulnerabilities, so it's probably worth upgrading."
However, Red Hat has not yet wrapped this in a bow and made it pretty,
so you'll have to read the
kernel upgrade notes and make your own way,
probably patching and compiling the kernel source yourself (not
for the faint of heart). [If you really want to do this, get
the source RPMs from RedHat and the 2.0.37 patch from kernelnotes.org,
read all documentation you can get your hands on, and don't say I
didn't warn you. Otherwise, Red Hat will probably come out with some
slightly more pre-packaged solution soon.]
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:LOCALThis will deny access to all machines outside of Princeton. There are other possibilities for the
hosts.allow list,
I really haven't researched what will work in any great detail.
ALL:.princeton.edu (allow access from Princeton machines) ALL:128.112.113.0/255.255.252.0 (allow access from Eno/MGB subnet) ALL:cituser@arizona.princeton.edu (allow access for particular users)(If you are not an Eno/EEB user, you'll need to configure that middle line for your particular subnet.)
Or use the following script: enable-tcpwrap (download, change mode (chmod +x enable-tcpwrap), execute).
inetd.conf
The inetd system daemon is
a "clearing house" for a variety of network
services; inetd.conf is its configuration file.
Shut off all the services you don't 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 major new
ftp security hole announced. If you don't need it,
turn it 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:
killall -HUP inetdOr you can copy this shell script (untested!) to edit your
inetd.conf file and tickle inetd
automatically ...
Suggested services to shut off:
You can use an existing mechanism in RH 5.2
to disable automatic startup of services: these tools are
/sbin/chkconfig (command-line) and /usr/sbin/ntsysv
(text menu) or /usr/sbin/ntsysv (X11 menu).
Or you can use my auto-config script
(copy it to a file and run it, or just copy the commands straight to
the command line in a bash shell)
to automate the process.
There is another option that you can use,
a script I wrote (it should work generally on most SysV-based Unices):
however, I recommend that if you can you should use the existing
chkconfig mechanism under Linux.
uname -a for
info), I would suggest upgrading immediately!]
Nevertheless, you should look them over and decide which you
need to install.
My inexpert opinions about patches
are available:
If you have time, or are interested, there's always more you can do in the way of security ...
comp.security.unix or (if it
happens: currently under review) comp.os.linux.security