Configuring File Transfer Protocol (FTP) servers

Configuring compression and archival commands

Compression, uncompression, and tar archival are implicit operations that you can use with the get command in ftp(1tcp). When you request a file from an FTP server using get, ftpd attempts to supply a file with the specified name from the current directory. If the server cannot find the file, it will then attempt to generate the requested filename from those listed in the current directory using the conversion rules in /etc/ftpconversions. If ftpd finds an output filename that matches the one specified, it performs the conversion and sends the result to you.

For example, you would enter the ftp command get foo to have the remote FTP server uncompress the file named foo.Z before sending it to you. (If a file named foo also exists in the same directory as foo.Z, the server will send you this instead.) Similarly, the command get bar.Z would cause the server to compress the file named bar before transmitting it. To archive and compress the hierarchy below a directory named src so that it can be sent as one file, you would enter get src.tar.Z.

To control who is allowed to use the compression and archival commands on an FTP server, edit the arguments to the compress and tar keyword lines in /etc/ftpaccess. By default, the following lines in this file allow the class all (consisting of anonymous, guest, and real users) to use the commands:

compress	yes	all
tar		yes	all
If you want to prevent anonymous FTP users from using these commands, create a class anonclass containing anonymous and amend the lines to read:
compress	no	anonclass
compress	yes	all
tar		no	anonclass
tar		yes	all

By default, the FTP Server Manager configures the compress and tar binaries for use on an FTP server. To make additional compression and archival programs available for use:

  1. Edit /etc/ftpconversions to define the rules for automatically compressing, uncompressing, archiving, and unarchiving files based on their file extension. Suitable rules are already given in ftpconversions for the compress, cpio and tar commands.

    Rules are also listed in the ftpconversions file for archival and compression programs such as gzip, zip, and unzip. These programs are not provided with UnixWare but you can obtain them from the Internet if required.

  2. Each rule in the ftpconversions file show which programs are needed to perform a particular conversion. The pathnames are specified relative to the FTP home directory. If the programs do not already exist in the FTP home area, you must copy them there together with any dynamic linked libraries that they need.

    Copy the binary for each program to the appropriate directory (usually ~ftp/bin) in the FTP home area. Change the mode of each copied binary to 111, and change its owner and group to root and sys:

    chmod 111 filename
    chown root:sys filename


    NOTE: Some commands require other commands to be copied to the FTP area. For example, to be able to archive directory hierarchies, cpio needs to read output piped from find. To perform the piping, cpio also needs the pipeline program which must exist in FTP's ~ftp/etc/inet directory. The FTP Server Manager installs pipeline when the FTP home area is created.

  3. Run the command dump -Lv filename on each binary to find out which dynamic linked libraries it uses. (You can also use the ldd command if this is available on your system.) For example, cpio requires the libraries libc.so.1, libxattr.so, and libthread.so.1 from /usr/lib. Copy each library to the appropriate ~ftp/usr/lib or ~ftp/lib directory in the FTP home area if it is not already present. Change the mode of the copied library to 444, and change its owner and group to root and sys:

    chmod 444 filename
    chown root:sys filename


    NOTE: As an exception, the mode of the library libc.so.1 must be 111. This library should already be present in the FTP area's ~ftp/usr/lib directory.

See also:


© 1999 The Santa Cruz Operation, Inc. All rights reserved.
UnixWare 7 Release 7.1.1 - 5 November 1999