Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Remote Access Services Administrator's Guide: HP-UX 11i v2, HP-UX 11i v3 > Chapter 2 Configuring FTP

Configuring Anonymous FTP Access

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

One of the main administrative tasks in configuring the FTP daemon is providing access for certain user classes to the files available on the FTP server. FTP recognizes three different user classes for access control purposes:

  • Anonymous user

  • Guest user

  • Real user

Anonymous FTP allows a user without a login on your host to transfer files to and from a public directory. A user can type the ftp command to connect to your host and type anonymous or ftp as a login name. The user can then 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 the user ftp’s home directory, usually called /home/ftp.

The difference between the anonymous and guest ftp class is that a guest user needs a password to log in. Unlike anonymous ftp, you can restrict guest users to certain directory structures on the server system, which gives you additional control over who is allowed to ftp to a system.

The following sections describe the tasks involved in setting up an anonymous ftp access:

  • Adding a user ftp to the /etc/passwd file

  • Creating the anonymous FTP directory

You can follow the instructions in this section, or you can use System Administration Manager (SAM) to configure anonymous ftp access. SAM is an online user interface for performing system administration tasks. It provides extensive online help to configure anonymous ftp access. To run SAM, type sam at the HP-UX prompt.

Adding a User ftp to the /etc/passwd File

Use a text editor to open the /etc/passwd file, and add an entry for the user ftp as shown in the following example:

ftp:*:500:guest:anonymous ftp:/home/ftp:/usr/bin/false

The password field must be *, the group membership must be guest, and the login shell must be /usr/bin/false. In this example, the user ftp’s user ID is 500, and the anonymous ftp directory is /home/ftp .

For more information on the passwd file, type man 4 passwd at the HP-UX prompt.

Creating an Anonymous FTP Directory

The anonymous FTP directory consists of four subdirectories: usr, etc, pub, and dist, created under the /home/ftp directory. These subdirectories allow the FTP user to obtain the same directory structure as a real user.

To create an anonymous FTP directory, complete the following steps:

  1. Create the ftp home directory that you configured in the /etc/passwd file, as in the following example:

    # cd /home
    # mkdir ftp
  2. Create the subdirectory /usr/bin under the ftp home directory:

    # cd /home/ftp
    # mkdir usr
    # cd usr
    # mkdir bin
  3. Copy the file /sbin/ls to the /home/ftp/usr/bin directory, and set the permission of the /home/ftp/usr/bin directory to 0111 (executable only):

    # cp /sbin/ls /home/ftp/usr/bin
    # chmod 0111 /home/ftp/usr/bin/ls
    NOTE: If you want ftpd to use the /usr/bin/ls command, instead of the /sbin/ls command, to support directory listing, copy the relevant libraries specified as follows:
    • For Integrity systems, create the hpux32 directory under the /home/ftp/usr/lib directory, which must be owned by the root. Ensure that you change the permissions for the /home/ftp/usr/lib/hpux32 directory to 0555 (the directory cannot be written or edited).

      Copy the following library files to the /home/ftp/usr/lib/hpux32 directory:

      • /usr/lib/hpux32/dld.so

      • /usr/lib/hpux32/libc.so.1

      • /usr/lib/hpux32/libdl.so.1

      • /usr/lib/hpux32/libxcurses.so.1

      • /usr/lib/hpux32/uld.so

    • For HP-UX 11i v2 PA-RISC systems, copy the following library files to the /home/ftp/usr/lib directory:

    • /usr/lib/dld.sl

    • /usr/lib/libc.2

    • /usr/lib/libdld.2

    • /usr/lib/libxcurses.1

  4. Set the owner of the /home/ftp/usr/bin and /home/ftp/usr directories to root, and set the permissions to 0555 (the directory cannot be written or edited):

    # chown root /home/ftp/usr/bin
    # chmod 0555 /home/ftp/usr/bin
    # chown root /home/ftp/usr
    # chmod 0555 /home/ftp/usr
  5. Create the subdirectory etc under the ftp home directory:

    # cd /home/ftp
    # mkdir etc
  6. Copy the files /etc/passwd and /etc/group to the /home/ftp/etc directory. The ls command requires these commands to display the owners of the files and directories under the /home/ftp directory.

    # cp /etc/passwd /home/ftp/etc
    # cp /etc/group /home/ftp/etc
  7. Replace the password field in all entries in the /home/ftp/etc/passwd file with *, and delete the shell field from the end of each entry, as shown in the following example:

    #ftp:*:500:guest:anonymous ftp:/home/ftp:
    #acb:*:8996:20::/home/acb:
  8. Replace the password field in all the entries in the /home/ftp/etc/group file with *, as shown in the following example:

    #users:*:20:acb
    #guest:*:21:ftp
  9. Set the owner of the files in the /home/ftp/etc directory to root, and set the permission of the /home/ftp/etc/group directory to 0444 (read-only), as shown in the following example:

    # chown root /home/ftp/etc/passwd
    # chmod 0444 /home/ftp/etc/passwd
    # chown root /home/ftp/etc/group
    # chmod 0444 /home/ftp/etc/group
  10. Set the owner of the /home/ftp/etc directory to root, and set the permission of the /home/ftp/etc directory to 0555 (that is, the directory cannot be written or edited), as shown in the following example:

    # chown root /home/ftp/etc
    # chmod 0555 /home/ftp/etc
  11. Create the pub directory under /home/ftp. Set the owner of the /home/ftp/pub directory to user ftp and its permissions to 0777 (read, write, and execute permissions), as shown in the following example:

    # mkdir /home/ftp/pub
    # chown ftp /home/ftp/pub
    # chmod 0777 /home/ftp/pub

    Anonymous ftp users can put files in this directory to make them available to other anonymous ftp users.

  12. Create a directory called dist under /home/ftp. Set the owner of the /home/ftp/dist directory to user root and its permissions to 0755 (writable only by root), as shown in the following example:

    # mkdir /home/ftp/dist
    # chown root /home/ftp/dist
    # chmod 0755 /home/ftp/dist

    The superuser can put read-only files in this directory to make them available to anonymous ftp users.

  13. Set the owner of user ftp’s home directory to root and the permissions to 0555 (not writable), as shown in the following example:

    # chown root /home/ftp
    # chmod 0555 /home/ftp

Figure 2-1 shows the directory structure for an anonymous ftp directory.

Figure 2-1 Directory Structure for Anonymous FTP Account

Directory Structure for Anonymous FTP Account
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.