12.07.2015 Views

download

download

download

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Network Services—Internet Serversinetd DaemonThe internet "super-server" or inetd is a wrapper around various smaller networkservices. The inetd(8) utility listens to specified TCP or UDP ports. Once aconnection for each port is detected, it will launch an appropriate daemon andhandover the connection to that daemon. Once the connection is closed, the daemonis also closed.This will be very useful for the smaller services, such as tftp, finger, and ftp, asthey may not have a lot of requests, and consequently don't have to be loaded as aseparate daemon. So, they can listen in the background for new requests. Instead,inetd(8) will play this role for these services and listen to as many ports, asspecified. Rather than running multiple services, only one service (inetd daemon)will be loaded.The inetd configuration file is located at /etc/inetd.conf, and it can be enabledby adding the following line to the /etc/rc.conf file:inetd_enable=YESThe default configuration of inetd does not listen for any incoming connection. Theconfiguration file contains sample configuration lines for popular services, but iscommented out. Hence, you should uncomment any line, depending on the serviceyou want to enable, and restart the inetd daemon.For example, to enable FTP service on your host using inetd, you shoulduncomment the appropriate line (remove the # mark from the beginning of the line)in the /etc/inetd.conf file:ftp stream tcp nowait root /usr/libexec/ftpd ftpd –lYou may have noticed that there are two lines for most of the services listed in theinetd configuration file. Each line specified in the inetd configuration file shouldlisten to TCP (IPv4) or TCP6 (IPv6), if it is supported by the service, so that you canspecify each service over IPv4 or IPv6, separately.In the previous example, we enabled FTP service over TCP/IPv4. In order to reloadthe inetd configuration (if running), the following command should be issued:# /etc/rc.d/inetd reloadYou can verify the inetd services using the sockstat(1) utility as follows:# sockstat -l | grep inetdroot inetd 797 5 tcp4 *:21 *:*This shows that inetd is listening to TCP4 port 21 (which is FTP service).[ 204 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!