|
|
To print: Select File and then Print from your browser's menu
-------------------------------------------------------------- This story was printed from ZDNet Australia. --------------------------------------------------------------
|
Improve your Linux security: Stop unnecessary services By Mary Ann Richardson, TechRepublic July 19, 2002 URL: http://www.zdnet.com.au/insight/soa/Improve-your-Linux-security-Stop-unnecessary-services/0,139023731,120266775,00.htm
Although the default installation scripts that come with various Linux distribution CDs make it easy to install Linux, they also add a vast number of services to your system, which, at best, you'll probably never use, or at worst, leave ports open to external break-ins.
The more services that are running, the more ports that will be left open to intruders. So to protect your system, it’s best to turn off any unnecessary services.Find which services are running Before you can decide which services are unnecessary, you need to know which services are running. To find out, run netstat.
First, open a terminal window and use su to switch to root. Then enter the command # netstat –tap > listening.services, followed by the command # less listening.services.
In general, if you can’t identify a service that is listed, you probably don’t need it. If it is not obvious from the netstat output what a service is, use the ps, find, grep, or locate command to find more information about the program or its specific PID. Also check /etc/services for an unfamiliar service name or port number. Decide which services to turn off Since I plan to use my Linux system as a stand-alone desktop with access to the Internet, I should first check to see if any of the services listed in Table A are active.
Table A
For example, netstat reported that the services login and shell as currently running. As I note in Table 1, these are actually rlogin and rsh and should be turned off. The telnet and ftp daemons listed are servers that accept incoming connections to the machine. Again, because this is a stand-alone system, I should turn these services off. I can always use an ftp or telnet client when I need to download files or telnet over the Internet. The netstat command also reported that the http server is running, which is required by some distributions to access online documentation. If I intend to keep this service running, I will need to check that it is not accessible from outside the system. Turn off the unnecessary services Once you have decided which services are unnecessary, you can begin turning them off. It’s a good idea to turn off one service, and then run your system for a while without the service to see if it is OK. If so, then stop another service and repeat the process until all unnecessary services are no longer running.
Users logged on as root can turn off a service by entering the path name for the service script followed by the stop option. For example, to turn off nfs, enter: # /etc/init.d/nfs stop.
TechRepublic is the online community and information resource for all IT professionals, from support staff to executives. We offer in-depth technical articles written for IT professionals by IT professionals. In addition to articles on everything from Windows to e-mail to fire walls, we offer IT industry analysis, downloads, management tips, discussion forums, and e-newsletters.
Copyright © 2009 CBS Interactive, a CBS Company. All Rights Reserved. |