Installing and Administering Internet Services

172 Chapter 5
Configuring TFTP and BOOTP Servers
Configuring the TFTP Server
$ mkdir /home/tftpdir$
$ chown tftp /home/tftpdir
$ chgrp guest /home/tftpdir
$ chmod 700 /home/tftpdir
Specify the files available to clients in the tftpd command line in
/etc/inetd.conf:
tftpd dgram udp wait root /usr/lbin/tftpd tftpd [path...]
[path...] is a list of the files or directories that you want to make
available to TFTP clients. File or directory names are separated by
spaces. Each file or directory is assumed to be relative to /.
Reconfigure /usr/sbin/inetd:
/usr/sbin/inetd -c
If you have both an /etc/passwd entry for the user tftp and files
specified in the tftpd command line, tftpd first looks for a file relative
to the user tftp’s home directory. If the file is not found, then tftpd
looks for the file relative to the path specified in the tftpd command. If
two files with the same name are in both locations, tftpd accesses the
one under tftp’s home directory.
Verify Your tftpd Installation
To verify your tftpd installation, create a file and use the tftp program
to perform a file transfer:
1. Create a file that is readable by the user tftp. The file should be in
the user tftps home directory or in a directory specified with the
tftpd command. For example,
$ echo "Hello, this is a test." > /export/testfile
$ chown tftp /export/testfile
$ chmod 400 /export/testfile
Make sure that an /etc/passwd entry exists for the user tftp.
2. Using a TFTP client, try to retrieve the file:
$ tftp localhost
tftp> get /export/testfile
Received 24 bytes in 0.6 seconds
tftp> quit
You can specify either the IP address or name of the remote host. In
order to get a file from a directory specified as an argument to the
tftpd command, you must specify the full path name. If this step
fails, see “Troubleshooting BOOTP and TFTP Servers” on page 185.