HPlogo Installing and Administering Internet Services: HP 9000 Networking > Chapter 5 Configuring TFTP and BOOTP Servers

Configuring the TFTP Server

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

To manually configure the TFTP server, tftpd, you need to modify the tftpd entry in the /etc/inetd.conf file or create an entry for the user tftp in the /etc/passwd file. If you use SAM to configure your system as a BOOTP server, your system is automatically configured as a TFTP server. The following sections explain the manual method for configuring and verifying tftpd.

NOTE: You must be superuser to configure the TFTP server.

Procedure for Configuring tftpd

Configuring tftpd on your system allows you to make files available to remote clients that support TFTP. For new tftpd installations, you can do this in one of two ways:

  • Add the user tftp to /etc/passwd. For example,

    tftp:*:510:10:TFTP:/home/tftpdir:/usr/bin/false

    HP recommends that you use this method. If there is no /etc/passwd entry for the user tftp, tftpd has root access to any files or directories you specify in the entry for tftp in the /etc/inetd.conf file. If an /etc/passwd entry exists for the user tftp, tftpd cannot read or write files unless they are readable or writeable by the user tftp.

    If you create an /etc/passwd entry for the user tftp, tftpd first looks for a file relative to the home directory of the user tftp. If the file is not found there, then tftpd looks for the file relative to the path(s) specified with the tftpd command. If you want to give remote systems permission to retrieve a file through TFTP, the file must be readable by the user tftp. If you want to give remote systems permission to transmit a file to your system through TFTP, the file must be writeable by the user tftp. For example, to create a home directory for the user tftp, make the directory owner the user tftp, and ensure the directory gives the user tftp read, write, and execute permissions. For example:

    $ 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 tftp's 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”.

  3. Compare the ASCII files to verify data transfer:

    $ diff testfile /export/testfile
    $

  4. Remove the test file once you have verified the installation.

© 2000 Hewlett-Packard Development Company, L.P.