/etc/inetd.conf
file lists these servers and their usual ports. The inetd
command listens to all of them; when it detects a connection to any such port, it executes the corresponding server program.
/etc/inetd.conf
file describes a server through seven fields (separated by spaces):
/etc/services
file).
stream
for a TCP connection, dgram
for UDP datagrams.
tcp
or udp
.
wait
or nowait
, to tell inetd
whether it should wait or not for the end of the launched process before accepting another connection. For TCP connections, easily multiplexable, you can usually use nowait
. For programs responding over UDP, you should use nowait
only if the server is capable of managing several connections in parallel. You can suffix this field with a period, followed by the maximum number of connections authorized per minute (the default limit is 40).
argv[0]
in C).
Example 9.1. Excerpt from /etc/inetd.conf
talk dgram udp wait nobody.tty /usr/sbin/in.talkd in.talkd finger stream tcp nowait nobody /usr/sbin/tcpd /usr/sbin/in.fingerd ident stream tcp nowait nobody /usr/sbin/identd identd -i
tcpd
program is frequently used in the /etc/inetd.conf
file. It allows limiting incoming connections by applying access control rules, documented in the hosts_access(5) manual page, and which are configured in the /etc/hosts.allow
and /etc/hosts.deny
files. Once it has been determined that the connection is authorized, tcpd
executes the real server (like /usr/bin/in.fingerd
in our example).