Select application deamons to support.
Unix uses the concept of a superserver that handles connection
requests, forking off the appropriate server for each connection. This
superserver is named INETD. Inetd is started up in /etc/rc.local with
if [ -f /etc/inetd.conf ] ; then
/etc/inetd & ( echo Starting Inetd ) > /dev/console
inetd manages applications such as telnet, ftp, rlogin, smtp, gopher, rcmd, finger,etc. Here is a sample inetd.conf file.
Setting up the Network on System V (IRIX)
The basic ideas are the same as in the BSD version but the configuration files
are done differently. Under IRIX, there is a shell script
/etc/init.d/network that controls all the network related setup. That
shell script gets it information from some files described below.
inetd is a deamon that manages other deamons. inetd, is responsible for
handling incoming requests for applications like telnet, rlogin, finger,
ftp, and mail. It starts up a client application when one is needed and
kills them off when not needed. inetd only works with deamons that provide
services over the network. The TCP/IP protocol supports the idea of
ports, these ports are pre-defined for well-known applications. inetd
works by attaching itself to these ports and listening for a network
connection. When one occurs, inetd starts up the appropriate deamon and
connects the standard I/O channels to the network port. The advantage of
inetd is that the system has one file to update and it cuts down on
overhead on the system. Without inetd, a deamon for each service supported
would be required to be running at all time.
inetd reads in a configuration file inetd.conf, this file has
six fields, each seperated by a whitespace. The fields in order are:
- The service name. This name must be defined in the file
/etc/services for TCP/UDP applications or handled by the portmap
deamon for RPC services.
- The second column has the type of socket used, possible values are
steam, dgram, and raw. Stream is generally used for
TCP applications and dgram for UDP applications.
- The third column lists the protocol to use. This is either TCP or UDP.
If this application uses RPC services also, then rpc is prepended to the
protocol name as in rpc/tcp.
- The fourth field is either wait or nowait. Wait is used
when you launch a deamon that itself asks as a server for multiple requests
while nowait is used when you want a new copy for each new connection.
- The fifth field gives the username to run the program under. For some
programs you want to select guest just incase bug is found that could
be used to gain access.
- The last fields give the command name and parameters to use.
Here is a small subset of a sample inetd.conf file:
ftp stream tcp nowait root /usr/site/etc/tcpd /usr/etc/ftpd -l
telnet stream tcp nowait root /usr/site/etc/tcpd /usr/etc/telnetd
shell stream tcp nowait root /usr/site/etc/tcpd /usr/etc/rshd -L
login stream tcp nowait root /usr/site/etc/tcpd /usr/etc/rlogind
exec stream tcp nowait root /usr/site/etc/tcpd /usr/etc/rexecd
#finger stream tcp nowait guest /usr/etc/fingerd fingerd
#bootp dgram udp wait root /usr/etc/bootp bootp
ntalk dgram udp wait root /usr/etc/talkd talkd
tcpmux stream tcp nowait root internal
echo stream tcp nowait root internal
discard stream tcp nowait root internal
chargen stream tcp nowait root internal
Common Problems and Tools.
Final Comments.
Unix and networking go hand in hand. Setting up the
network on a host isn't difficult but
debugging problems as they arise is. Having an understanding of what is
happening on the network is a great help.