Anonymous ftp allows a user without a login on your host to transfer files
to and from a public directory. A user types the ftp command to connect to
your host and types anonymous or ftp as a login name. The user can type
any string of characters as a password. (By convention, the password is the
host name of the user's host). The anonymous user is then given access only
to user ftp's home directory, usually called /home/ftp.
Configuring anonymous ftp access involves the following tasks, described
in this section:
You can follow the instructions in this section, or you can use SAM to
configure anonymous ftp access. SAM (System Administration Manager)
is Hewlett-Packard's windows-based user interface for performing system
administration tasks. To run SAM, type sam at the HP-UX prompt. SAM has
an extensive online help facility.
To Add User ftp to /etc/passwd |
 |
Use a text editor to add a line for user ftp to the /etc/passwd file, as in
the following example:
The password field should be *, the group membership should be guest,
and the login shell should be /usr/bin/false. In this example, user ftp's
user ID is 500, and the anonymous ftp directory is /home/ftp.
Type man 4 passwd at the HP-UX prompt for information on the passwd
file.
To Create the Anonymous ftp Directory |
 |
Create the ftp home directory that you configured in the /etc/passwd file,
as in the following example:
Create the subdirectory /usr/bin under the ftp home directory:
Copy the ls and pwd commands from /usr/bin to ~ftp/usr/bin, and set
the permissions on the commands to 0111 (executable only):
Set the owner of the ~ftp/usr/bin and ~ftp/usr directories to root, and
set the permissions to 0555 (not writeable):
Create the subdirectory etc under the ftp home directory:
Copy /etc/passwd and /etc/group to ~ftp/etc. These files are
required by the ls command, to display the owners of files and directories under ~ftp.
Replace the password field in all entries in /home/ftp/etc/passwd with *,
and delete the shell field from the end of each entry:
Replace the password field in all entries in /home/ftp/etc/group with *:
Set the owner of the files in ~ftp/etc to root, and set the permissions to 0444
(read only):
Set the owner of ~ftp/etc to root, and set the permissions to 0555 (not
writeable):
Create a directory called pub and under ~ftp. Set its owner to user ftp and its
permissions to 0777 (writeable by all). Anonymous ftp users can put files in this
directory to make them available to other anonymous ftp users.
Create a directory called dist and under ~ftp. Set its owner to user root and
its permissions to 0755 (writeable only by root). The superuser can put
read-only files in this directory to make them available to anonymous ftp users.
Set the owner of user ftp's home directory to root and the permissions to 0555
(not writeable).
An anonymous ftp directory has the structure shown in
Figure 2-2 “Directory Structure for Anonymous ftp Account”: