Solaris ISP Server 2.0 Reference Guide

Part II Sun Internet FTP Server

SunTM Internet FTP ServerTM 1.1 man pages.

man Pages(1m): Maintenance Commands

ftpIntro(1M)

NAME | DESCRIPTION | LIST OF COMMANDS | EXIT STATUS | ATTRIBUTES | SEE ALSO

NAME

DESCRIPTION

LIST OF COMMANDS

EXIT STATUS

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | DESCRIPTION | LIST OF COMMANDS | EXIT STATUS | ATTRIBUTES | SEE ALSO

ftpaddhost(1M)

NAME | SYNOPSIS | DESCRIPTION | OPERANDS | EXIT STATUS | FILES | ATTRIBUTES | SEE ALSO

NAME

SYNOPSIS

DESCRIPTION

OPERANDS

EXIT STATUS

FILES

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | SYNOPSIS | DESCRIPTION | OPERANDS | EXIT STATUS | FILES | ATTRIBUTES | SEE ALSO

ftpconfig(1M)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | EXIT STATUS | ATTRIBUTES | SEE ALSO

NAME

SYNOPSIS

DESCRIPTION

OPTIONS

OPERANDS

EXIT STATUS

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | EXIT STATUS | ATTRIBUTES | SEE ALSO

ftpcount(1M)

NAME | SYNOPSIS | DESCRIPTION | EXIT STATUS | ATTRIBUTES | SEE ALSO

NAME

SYNOPSIS

DESCRIPTION

EXIT STATUS

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | SYNOPSIS | DESCRIPTION | EXIT STATUS | ATTRIBUTES | SEE ALSO

ftpshut(1M)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | EXIT STATUS | ATTRIBUTES | SEE ALSO

NAME

SYNOPSIS

DESCRIPTION

OPTIONS

OPERANDS

EXIT STATUS

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | OPERANDS | EXIT STATUS | ATTRIBUTES | SEE ALSO

in.ftpd(1M)

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | SECURITY | EXIT STATUS | FILES | ATTRIBUTES | SEE ALSO

NAME

SYNOPSIS

DESCRIPTION

OPTIONS

SECURITY

EXIT STATUS

FILES

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | SYNOPSIS | DESCRIPTION | OPTIONS | SECURITY | EXIT STATUS | FILES | ATTRIBUTES | SEE ALSO

man Pages(4): File Formats

ftpIntro(4)

NAME | DESCRIPTION | LIST OF FILES | ATTRIBUTES | SEE ALSO

NAME

DESCRIPTION

LIST OF FILES

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | DESCRIPTION | LIST OF FILES | ATTRIBUTES | SEE ALSO

ftpaccess(4)

NAME | SYNOPSIS | DESCRIPTION | FILES | ATTRIBUTES | SEE ALSO

NAME

SYNOPSIS

DESCRIPTION

FILES

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | SYNOPSIS | DESCRIPTION | FILES | ATTRIBUTES | SEE ALSO

ftpconversions(4)

NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | FILES | ATTRIBUTES | SEE ALSO

NAME

SYNOPSIS

DESCRIPTION

EXAMPLES

FILES

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | FILES | ATTRIBUTES | SEE ALSO

ftphosts(4)

NAME | SYNOPSIS | DESCRIPTION | ATTRIBUTES | SEE ALSO

NAME

SYNOPSIS

DESCRIPTION

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | SYNOPSIS | DESCRIPTION | ATTRIBUTES | SEE ALSO

ftpservers(4)

NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | ATTRIBUTES | SEE ALSO | NOTES

NAME

SYNOPSIS

DESCRIPTION

EXAMPLES

ATTRIBUTES

SEE ALSO

NOTES

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | ATTRIBUTES | SEE ALSO | NOTES

xferlog(4)

NAME | SYNOPSIS | DESCRIPTION | FILES | ATTRIBUTES | SEE ALSO

NAME

SYNOPSIS

DESCRIPTION

FILES

ATTRIBUTES

SEE ALSO

Sun Internet FTP Server 1.1  Last Revised February 1999

NAME | SYNOPSIS | DESCRIPTION | FILES | ATTRIBUTES | SEE ALSO

Chapter 1 FTP Command-Line Procedures

This section provides the SunTM Internet FTP ServerTM command line procedures for configuration. subscriber authentication, and maintenance.

1.1 FTP Configuration

FTP configuration is comprised of the following steps:

This section assumes:

The examples used assume:

1.1.1 Procedure

  1. Use ftpconfig(1m) to create the anonymous FTP directory:

    ftpconfig -d /opt/IspFtpDir

    This creates the following in the specified directory: bin/, dev/, etc/, pub/, usr/, var/, and Welcome. The directory bin/ is a symbolic link to /usr/bin, and Welcome is the welcome message displayed to the FTP user on successful login.


    Note -

    The ftpconfig(1m) command only needs to be run once regardless of the number of virtual hosts you need to create. Ensure you do not create the ISP anonymous FTP directory in /tmp.


  2. Use ftpaddhost(1m) to create the virtual host directory:

    ftpaddhost /opt/IspFtpDir /export/home/ myVH.org

    This creates the directory /export/home/myVH.org. The contents of the anonymous FTP directory /opt/IspFtpDir are cloned to create the required file hierarchy within /export/home/myVH.org: dev/, etc/, pub/, usr/, var/, and the file Welcome .

    The FTP access configuration file /etc/inet/ftpaccess is copied to the virtual host etc/ directory (/etc/inet/hostname/). Thus, each virtual host you define using ftpaddhost(1m) inherits the configuration defined in /etc/inet/ftpaccess.

  3. Create the subscriber (real user) account in /etc/passwd. See passwd(4) and admintool(1M) for further information. Make note of the user ID associated with the user login name.

  4. Edit /etc/group and enter a unique group ID for the subscriber (real user) account in the file, then add the user login name to the newly created group. See group(4) for further information.

1.2 Subscriber Authentication

The following procedures for configures the virtual host for LDAP authentication.

1.2.1 LDAP

  1. Determine the UID and GID you will assign to the FTP subscriber and subscriber directories.

  2. Create an LDIF file defining the virtual host type (org, net, com, edu, and so on), virtual host name, country code, subscriber directory, UID, and GID.

    You can use the following example as a template, replacing:

    • country_code with the two-letter code for your country, for example us, de, ca, and so on.

    • virtual_host_type with the virtual host type.

      For example if the virtual host is accessed via myVH.org, you would replace virtual_host__type with org

    • Your_ISP_Name with the name of your ISP.

    • Virtual_host_Name with the name of the virtual host.

      For example if the virtual host is accessed via myVH.org, you would replace virtual_host__name with myVH.

    • virtual_host_dir with the full path name to the virtual host root directory.

      For example if the virtual host myVH.org is located in /export/home/myVH.org, you would replace virtual_host__dir with /export/home/myVH.org.


    dn: dc=virtual_host_type
    dc: virtual_host_type
    objectclass: domain
    
    dn: ou=virtual_host_name,o=Your_ISP_Name,c=country_code
    ou: virtual_host_name
    associateddomain: virtual_host_name.virtual_host_type
    objectclass: organizationalUnit
    objectclass: domainRelatedObject
    objectclass: top
    
    dn: dc=virtual_host_name,dc=virtual_host_type
    dc: virtual_host_name
    objectclass: domain
    objectclass: labeledURIObject
    associatedname: ou=virtual_host_name,o=Your_ISP_Name,c=country_code
    description: DNS to DN mapping for virtual_host_name.virtual_host_type
    labeleduri: ldap:///ou=virtual_host_name,o=Your_ISP_Name,c=country_code??sub
    
    dn: ou=Services,ou=virtual_host_name,o=Your_ISP_Name,c=country_code
    ou: Services
    objectclass: organizationalUnit
    
    dn: ou=Groups,ou=virtual_host_name,o=Your_ISP_Name,c=country_code
    ou: Groups
    objectclass: organizationalUnit
    
    dn: ou=People,ou=virtual_host_name,o=Your_ISP_Name,c=country_code
    ou: People
    objectclass: organizationalUnit
    
    dn: ou=SUNWftp,ou=Services,ou=virtual_host_name,o=Your_ISP_Name,c=country_code
    ou: SUNWftp
    objectclass: organizationalUnit
    
    dn: ispversion=1.0,ou=SUNWftp,ou=Services,ou=virtual_host_name,o=Your_ISP_Name,c=country_code
    ispversion: 1.0
    cn: SUNWftp
    objectclass: ispservice
    ispdirectoryroot:virtual_host_dirdn: cn=ftp,ou=People,ou=virtual_host_name,o=Your_ISP_Name,c=country_codecommonname: ftp uid: ftp sn: ftp userpassword: ftp objectclass: ispSubscriber uidnumber: 60001 gidnumber: 70001 ispcontentdirectory: virtual_host_dir
    


    Caution - Caution -

    Before saving the file, ensure there are no trailing blanks. If there are any trailing blanks, ldapadd will report a syntax error.


  3. Save the file as virtual_host_name.ldif, for example, myVH.ldif

  4. The virtual host and subscriber information is added using the ldappadd command syntax:

    # ldapadd -v -D"bindDN" -w bindPassword -f filename.ldif


    Example 1-1

    Assume:

    • You are logged in as root on the computer where Sun Directory Services and the Solaris FTP server are installed.

    • The password of the Directory Service administrator is ftp555.

    • The country code is us.

    • The Directory Service administrator distinguished name is "cn=admin,o=intra,c=us".

    • Your corporate domain name is intra.net.

    • You have created and saved the LDAP configuration file as myVH.ldif.

    The command to add the virtual host and subscriber information to LDAP would then be:


    # ldapadd -v -D"cn=admin,o=intra,c=us" -w ftp555 -f myVH.ldif

1.3 Maintenance

1.3.1 Start ftpd

The standard FTP installation places an entry in /etc/inetd.conf, thereby automatically starting the FTP server when an FTP connection is made.

The ftpshut(1m) command creates the file /var/ftp/shutdown which disables FTP.

To reenable FTP, enter the command:

ftpshut enable

This deletes the /var/ftp/shutdown file, allowing subsequent FTP connections to automatically start the FTP daemon.

1.3.2 Stop ftpd

The ftpshut(1m) command is used to shut down the FTP server. You can optionally specify the number of minutes to new user lockout and disconnect of existing users as well as the logout message, or you can specify a configuration file containing this information.

The ftpshut(1m) command creates the file/var/ftp/shutdown. This blocks the restart of the FTP server until you enter the command ftpshut enable.

Examples:

Please refer to the ftpshut(1m) man page for information on creating and using a shutdown configuration file.

1.3.3 Show Users by Class

Refer to ftpaccess(4) for the definition of class and procedures for defining new classes.

Use the ftpcount(1m) to display the number of active users per class:

/usr/sbin/ftpcount

The number of users per class and the class maximums are displayed:


root# ftpcount
Service class anon                 -   2 users ( 10 maximum) 
Service class guest                -   0 users ( 10 maximum) 
Service class real                 -   0 users 
root# 

1.3.4 Delete an FTP Site

Removal of an FTP virtual host depends on the type of subscriber authentication; and whether or not the virtual host is also serving as a web hosting site.

The following procedure uses the examples:

  1. Remove the FTP virtual host entry from /etc/inet/ftpservers. For example, you would delete the line myVH.org /etc/inet/myVH.org/ftpaccess.

  2. If this is an FTP-only virtual host:

    1. Remove the FTP virtual host entry from /etc/inet/hosts. For example, you would delete the line containing myVH.org from /etc/inet/hosts.

    2. Remove the virtual host chroot directory; in this example, /export/home/myVH.org.

  3. If this is an FTP/web site host:

    1. Change directory to the virtual host chroot directory, in this example /export/home/myVH.org.

    2. Remove the file Welcome, and remove the following directories only if they do not contain web data:dev/, etc/, pub/, usr/, and var/.

  4. Remove the FTP virtual host entries from LDAP using Deja, or via the command line as described by ldapdelete(1m).