Once you have removed any services you don't need, the next step is to restrict access to the ones you do need. The best way to do this is to install TCP wrappers. TCP wrappers provide hostname-based access control for your deamons. Most Linux distributions come with TCP wrappers pre-installed. If your system doesn't have them, you can download them from ftp.win.tue.nl .
Programs run from inetd can be started though tcpd, the tcp wrapper daemon.
The first step to setting up tcpd on your system, is to make sure inetd knows to use it. The next step is to configure your access files. The first field specifies a daemon name such as sendmail or telnetd . The wildcard ALL matches all daemons.