By its very nature, Linux offers many possibilities for remote users, when networked. Much of its popularity rests on the very fact that complex networking tasks can be achieved with relative simplicity and expediency. The downside of this, however, is that Linux can be vulnerable to serious remote compromise and penetration. For the beginner and average user, the solution is an understanding of basic Linux security.
If you have just made a fresh install of Linux, or are planning to do so, ensure it is an up-to-date release of Linux and its application base, as distributions lose currency very quickly. Also, though they are current at the time of shipping, default kernels are often out of date. It is possible that the kernel, which your distribution installs by default, has been found to have one or more security vulnerabilities. Therefore, once installation is complete, it should be a priority to determine if your kernel is the current, stable release. If it is not, check the CHANGES file to see what fixes are in the new kernel. If there are security fixes, the kernel should be upgraded (details of how to upgrade a kernel are in the kernel documentation itself). I often find the best place to do this is http://www.linuxhq.com or http://www.kernel.org. It is often beneficial to upgrade kernels when a new release is made, regardless of its security fixes, as other bugs are also solved.
Once a Linux system is up and running, it can date very quickly: the programs central to its running may be updated soon after your recent installation. If you didn't recently install a distribution, but had an existing system, these programs will also be out of date. Upgrades of such utilities can be done by your distribution's package system (if, indeed, it has one). For my money, however, I prefer to do it manually: I regularly check if my system utilities have been updated, and if the update is significant, I download, compile and install it. For the sake of speaking to the widest audience, and to provide the best understanding, I will discuss this method of maintenance.
So, what are the important system utilities about which I am talking? In the matter of the security of your machine on a network, it means anything which is involved in interfacing your machine to that network. These will usually be network daemons, or servers. To see which of these is running, you should consult your initialisation scripts, i.e., boot time setup scripts, which are usually in a directory off /etc, such as /etc/rc. Reading /etc/inittab should give an indication where they are, if you cannot find them.
The script called rc.inet . . .' (where . . .' signifies some arbitrary characters) is responsible for executing the network daemons. Unless you have a working knowledge and understanding, services such as inetd, http, nfs, rpc, lp, DNS, ftp, samba, pop and others should not be run. That is, unless you have more than basic network security knowledge, you should not run services other than the syslog daemon (often syslogd') and an smtp mail daemon (sendmail' or an equivalent). In order to run only these services, all others should be commented out using a #'. If other services are running, you should kill them immediately. Alternatively, you could reboot.
It is these necessary services - syslogd and the mail daemon - that must be kept up to date. The documentation that comes with the packages will detail what site you should consult in the future to see if the services have been updated.
Under this model, you are running only two services to which you can connect over the network. In themselves, those two services are quite complex, particularly the mail server. A more detailed explanation of mail security can be found at http://www.sendmail.org.
Perhaps the most important aspect of security under Linux, and any environment, is understanding the programs which are running, and their vulnerabilities. This understanding comes with experience and reading.
Next issue, I will look at running services under the Internet daemon inetd, particularly secure remote shell access, and how to restrict access using basic firewalling systems built into the daemon.