HP-UX IP Address and Client Management Administrator's Guide HP-UX 11i v2, HP-UX 11i v3
The example indicates that the user tftp has access only to the /home/tftpdir directory on
the client system. If you do not specify the user tftp in the /etc/passwd file, tftpd has root
access to the files or directories that you specify in the entry for tftp in the/etc/inetd.conf
file. If a tftp entry exists in the /etc/passwd file, 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 tftpd does not find the file in the home directory, then
it looks for the file relative to the paths 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, create a home directory for the user tftp, make the user tftp the directory owner,
and ensure that the directory gives the user tftp read, write, and execute permissions. For
example:
$ mkdir /home/tftpdir$ $ chown tftp /home/ftpdir
$ chgrp guest /home/tftpdir $ chmod 700 /home/tftpdir
Method 2
Specify the files available to clients in the tftpd entry in the /etc/inetd.conf file as follows:
• For IPv4 address:
tftpd dgram udp wait root /usr/lbin/tftpd tftpd
[path...]
• For IPv4 and IPv6 address
tftpd dgram udp6 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 the root directory (.).
Reconfigure /usr/sbin/inetd using the following command:
/usr/sbin/inetd -c
If you have both an /etc/passwd entry for the user tftp and the files specified in the tftpd
entry in the /etc/inetd.conf file, 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
file under tftp’s home directory.
NOTE: HP recommends that you use Method 1 to configure tftp on your system.
Verifying the tftpd Installation
To verify the tftpd installation, create a file and use the tftp program to perform a file transfer
using the following steps:
1. Create a file that is readable by the user tftp. The file must be in the user tftp’s home
directory or in a directory specified with the tftpd entry. 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
108 Configuring the BOOTP and TFTP Servers