HP-UX System Administrator's Guide: Configuration Management HP-UX 11i v3 (B3921-90017, September 2010)
3. Copy the ls command from /sbin to /home/ftp/usr/bin, and set the
permissions on the command to execute only (mode 0111):
# cp /sbin/ls /home/ftp/usr/bin
# chmod u=x,g=x,o=x /home/ftp/usr/bin/ls
4. Set the owner of the /home/ftp/usr/bin and /home/ftp/usr directories to
root, and set the permissions to read-execute (not writable) (mode 0555):
# chown root /home/ftp/usr/bin
# chmod u=rx,g=rx,o=rx /home/ftp/usr/bin
# chown root /home/ftp/usr
# chmod u=rx,g=rx,o=rx /home/ftp/usr
5. Create the subdirectory etc under the ftp directory:
# cd /home/ftp
# mkdir etc
6. Copy /etc/passwd and /etc/group to /home/ftp/etc.
These files are required by the ls command, to display the owners of files and
directories under /home/ftp.
# cp /etc/passwd /home/ftp/etc
# cp /etc/group /home/ftp/etc
7. In all entries in /home/ftp/etc/passwd, replace the password field with an
asterisk (*), and delete the shell field, for example:
ftp:*:500:1:anonymous ftp:/home/ftp:
tom:*:8996:20::/home/tom:
8. In all entries in /home/ftp/etc/group, replace the password field with an
asterisk (*):
users:*:20:acb
guest:*:21:ftp1
9. Change the owner of the files in /home/ftp/etc to root, and set the permissions
to read only (mode 0444):
# chown root /home/ftp/etc
# chmod u=r,g=r,o=r /home/ftp/etc
10. Create a directory pub (for public) under /home/ftp, and change its owner to
user ftp and its permissions to writable by all (mode 0777).
Anonymous FTP users can put files in this directory to make them available to
other anonymous FTP users.
# mkdir /home/ftp/pub
# chown ftp /home/ftp/pub
# chmod u=rwx,g=rwx,o=rwx /home/ftp/pub
You can create other directories to provide separate categories, such as /home/
ftp/draft and /home/ftp/final.
Configuring File Transfer Protocol (FTP) 91