The tftp daemon is shown commented out as well. tftp implements the
TFTP is commonly used by diskless clients and Xterminals to download their code from a boot server. If you need to run tftpd for this reason, make sure to limit its scope to those directories from which clients will retrieve files; you will need to add those directory names to tftpd 's command line. This is shown in the second tftp line in the example.
The tcpd Access Control Facility
Since opening a computer to network access involves many security risks, applications are designed to guard against several types of attacks. Some security features, however, may be flawed (most drastically demonstrated by the RTM Internet worm, which exploited a hole in a number of programs, including old versions of the sendmail mail daemon), or do not distinguish between secure hosts from which requests for a particular service will be accepted and insecure hosts whose requests should be rejected. We've already briefly discussed the finger and tftp services. Network Administrator would want to limit access to these services to 'trusted hosts' only, which is impossible with the usual setup, for which inetd provides this service either to all clients or not at all.
A useful tool for managing host-specific access is tcpd, often called the daemon 'wrapper.'[69] For TCP services you want to monitor or protect, it is invoked instead of the server program. tcpd checks if the remote host is allowed to use that service, and only if this succeeds will it execute the real server program. tcpd also logs the request to the syslog daemon. Note that this does not work with UDP-based services.
For example, to wrap the finger daemon, you have to change the corresponding line in
# unwrapped finger daemon
finger stream tcp nowait bin /usr/sbin/fingerd in.fingerd
to this:
# wrap finger daemon
finger stream tcp nowait root /usr/sbin/tcpd in.fingerd
Without adding any access control, this will appear to the client as the usual finger setup, except that any requests are logged to syslog 's
Two files called
Entries in the access files look like this:
To deny access to the finger and tftp services to all but the local hosts, put the following in
in.tftpd, in.fingerd: ALL EXCEPT LOCAL,
The optional
in.ftpd: ALL EXCEPT LOCAL, .vbrew.com :
echo 'request from %d@%h: >> /var/log/finger.log;
if [ %h != 'vlager.vbrew.com:' ]; then
finger -l @%h >> /var/log/finger.log
fi
The
The Services and Protocols Files
The port numbers on which certain 'standard' services are offered are defined in the Assigned Numbers RFC. To enable server and client programs to convert service names to these numbers, at least part of the list is kept on each host; it is stored in a file called
Here,
