Extensions to FTP Supported by Serv-U

See Also

 

Serv-U supports a number of FTP standards:

 

·          RFC959 - The File Transfer Protocol

·          RFC1123 - Requirements of Internet Hosts

·          RFC1579 - Firewall-Friendly FTP

·          RFC1760 - The S/KEY One-Time Password System

·          RFC2289 - A One-Time Password System

·          RFC2389 - Feature Negotiation Mechanism for the File Transfer Protocol

·          RFC2228 - FTP Security Extensions

·          RFC2246 - The TLS Protocol

 

·          draft-ietf-ftpext-mlst-15.txt - Extensions to FTP

·          draft-murray-auth-ftp-ssl-05.txt - Securing FTP with TLS

 

In addition, Serv-U supports a number of command extensions and non-standard FTP commands. They are listed below.

 

SSCN

This stands for Set Secured Client Negotiation, and tells the server how to handshake secure data connections using SSL. It is used for direct server-to-server transfers (FXP). The syntax is:

 

 SSCN

 SSCN [ON/OFF]

 

The command without any option returns the current SSCN setting, this can be "CLIENT METHOD" or "SERVER METHOD" (default). Sending "SSCN ON" switches to client method for SSL negotiations, "SSCN OFF" switches to server method.

 

CCC

Stands for Clear Command Channel. This switches a secure FTP session from secure command channel to a clear-text command channel. Its use is for logging in through a secure connection, so user name and password are encrypted, then switching to a clear-text command channel so a NAT firewall can read the (now clear-text) commands and provide proper address translation and port forwarding for PORT commands.

 

CLNT

An FTP client can tell the server what brand and version it is by using the "CLieNT" command. The syntax is:

 

 CLNT <client ID string>

 

The client ID string is displayed in the user activity pane.

 

XCRC

The XCRC command provides a mechanism for FTP clients to verify a file’s integrity on the server. It uses the standard CRC-32 algorithm to calculate a cyclic-redundancy-check, a "finger print" of the file. This syntax is:

 

 XCRC <path/file>

 XCRC <path/file> <end>

 XCRC <path/file> <start> <end>

 

The path/file name can optionally be enclosed in quotes. The <end> parameter tells the server the offset where it should stop calculating the CRC. The <start> parameter is the offset where Serv-U should start calculating the CRC.

 

REST

This is the "RESTart" command, described in RFC959 for resuming file transfers. Serv-U, and all other FTP servers, use the REST command in a non-standard way. The syntax is:

 

 REST <offset>

 

The <offset> parameter is required, and is the file offset where Serv-U should start resuming. The REST command has to be followed by STOR, RETR, PORT, or PASV. Any other command cancels the restart offset. REST can be used for resuming file downloads and uploads. In case of resuming a file upload normally ‘append’ access is required to resume at the end of the file, or ‘delete’ access to resume at any position in the file. In case a user reconnects from the same IP subnet and resumes within 12 hours of the initial file upload, only ‘write’ access is required.

 

NLST, LIST

These are the two FTP commands that deal with directory listings, NLST stands for "Name LiST", LIST is "LIST directory". LIST by default returns a long format directory listing with all files and directories, NLST returns a list of file names only (no directories) unless the option "NLST also lists directories" is enabled. Normally they do not have options, or rather, the only option according to RFC959 is a directory path or file, which should be listed. Serv-U’s version of the dir listing commands supports most of the UNIX ‘ls’ options, just like UNIX FTP servers do. These can be convenient for retrieving custom tailored directory listings. Supported options are:

 

 -a = list all entries including those starting with '.'

 -b = force printing of non-printable characters in octal

 -c = use modification time for listing sorting

 -d = if argument is a dir list only name, not contents

 -e  = list only files

 -f = enable -a, -U, disable -l, -s

 -i = print i-node number in first column

 -k = use 1024 bytes for block size (default is 512 bytes)

 -l = list in long format (default for LIST)

 -m = stream output, list accross page separated by commas

 -n = like -l, but use UID and GID numbers instead of names

 -o = like -l, but without the group info

 -p = put '/' after directory names

 -q = print non-printable characters as '?'

 -r = reverse sort order

 -s = give size of each entry in blocks

 -t = sort by modification time instead of name

 -u = use time of last access for sorting

 -w:NN = set line length to NN characters (default is 80)

 -x = multi-column output with entries sorted accross

 -A = list all entries, except for '.' and '..'

 -B = ignore names ending on '~' for dir listing

 -C = multi-column output with entries sorted down

 -F = put '/' after dir names, '@' after links

 -G = do not display group info

 -I:"XX" = add pattern XX to the list of patterns to ignore

 -L = if argument is a link, list file or dir it references

 -N = force printing of non-printable characters

 -Q = quote names as C-syntax strings

 -R = recursively list sub directories

 -S = sort by size (default is date)

 -T = show extended date/time info for long format listings

 -U = do not sort dir listing

 -X = sort by extension of the name (default is date)

 -1 = print one entry per line of output

 

Most client FTP programs do not let you specify options to the dir listing command, which means these options will not help you much. The command line client which comes with Windows 95 and NT does let you specify options, just add them to the command. For example ‘dir -lR’ will make a long format recursive listing of all files and directories at or below your current directory.

 

MDTM

Like the previous commands this is from the UNIX world and it lets you query the server for the "Modification Date and TiMe" of a file or directory. Unlike UNIX Serv-U also lets the client set the modification date and time of files on the server, if the user has sufficient access rights to do this. Its use is in synchronizing uploaded files with those on the client. Normally FTP has no way to explicitly set the date of uploaded files, they simply get the date they were created on the server. MDTM lets the client change that so they get the date of the original file on the server. Works for directories too. The syntax to set the date and time is:

 

 MDTM <yyyymmddhhmmss[+-zzz]> <path/file>

 

Where <yyyymmddhhmmss> is optional, if missing MDTM simply returns the modification date and time of the specified file. If present it is the year, month, day, hour, minutes, and seconds the file should get set to, in UTC. The next part, [+-zzz], is optional time zone information of the FTP client in minutes relative to UTC. If the client provides this info Serv-U will take care to convert the date and time to the proper local time at the server, so dates and times are kept consistent (a file created at 4 in the morning in the Eastern US would be created at 10 in Central Europe). If no time zone info is given Serv-U assumes you are specifying UTC. Many FTP client programs support the MDTM command. The command line FTP client lets you send this by adding the ‘quote’ command, so an example would be ‘quote mdtm 19980525162603 file.txt’.

 

SITE EXEC

This is the "SITE EXECute" command, to remotely start programs on the server. The syntax is:

 

 SITE EXEC <command line>

 

If the user has sufficient privileges this will execute the specified command line on the server.

 

SITE INDEX

This command from the Macintosh world was added to better support the Mac FTP client Fetch. It lets the client retrieve a recursive directory listing via the command connection. The syntax is:

 

 SITE INDEX <path>

 

The path may contain wildcard characters in its last part, to allow selective retrieval of for example all text files. The command line FTP client would do this (for example) by using ‘quote site index *.txt’.

 

SITE PSWD

This is the "SITE PaSsWorD" command for changing the user’s password remotely via a FTP client program. Normally FTP does not allow the user to change their password. If the user has sufficient privileges this will make life easier for the system administrator by leaving password changes up to the user. The syntax is:

 

 SITE PSWD <oldpassword> <newpassword>

 

The passwords may alternatively be enclosed by quotes. This can be useful in case one of the passwords contains spaces. Few FTP clients support this command at the moment. FTP Voyager is one of the few, and in CuteFTP you can add it ‘by hand’. Of course, the command line FTP client also lets you use this command by using it via ‘quote’.

 

SITE ZONE

Sometimes a FTP client program needs to know the time zone of the server, for example to adapt the dates and times in a directory listing to the local time. This option reveals the server’s time zone relative to UTC. The syntax is:

 

 SITE ZONE

 

A typical reply would look like this:

 

 210 UTC-240

 

This would indicate the server is 240 minutes behind UTC. The time shown already takes summer time into account (daylight savings time as it is called in some parts of the world).

 

SITE SET TRANSFERPROGRESS

This command is for turning notification to the FTP client about the progress of a file transfer on or off. When switched on the server will inform the client every few seconds on the file transfer progress. Having feedback of the progress of a file transfer is especially useful during direct server-to-server transfers (Also named 'FXP'). The syntax is:

 

 SITE SET TRANSFERPROGRESS ON

 

This will switch transfer progress notification on.

 

 SITE SET TRANSFERPROGRESS OFF

 

This will switch transfer progress notification off.

 

SITE CHMOD

The "SITE Change Mode" command comes from UNIX where it is used to change access rights for files and directories. There is no direct equivalent in Windows, it has been added due to popular demand, even though it does not make a whole lot of sense in a Windows file system context. The syntax is:

 

 SITE CHMOD <nnnn> <path/file>

 

In this <nnnn> is the permission code in octal format. First number is for setting IDs and is not supported by Serv-U, second number is for setting ‘owner’ permissions, third number is for setting ‘group’ permissions and not supported by Serv-U, fourth and last number is for setting ‘other’ permissions and not supported by Serv-U. The octal number format is:

 

 4 = read permission

 2 = write permission

 1 = search/execute permission

 

For FTP clients that support the CHMOD command, you can change the file's ‘read-only’ and ‘hidden’ attributes. The server will only look at the ‘owner’ number of the CHMOD command (ie. ‘group’ and ‘other’ are ignored). To make a file read-only the ‘read’ bit has to be set while the ‘write’ bit has to be reset. For the command this means "SITE CHMOD 4xx file.txt" (with "xx" any value) or "SITE CHMOD 5xx file.txt". To remove the read-only attribute just set the "read" and "write" bits, ie. "SITE CHMOD 6xx file.txt". To set the hidden attribute of a file both the "read" and "write" bits need to be reset, ie. "SITE CHMOD 0xx file.txt". Directory listings reflect the file's attributes by showing "r--" for read-only files and "---" for hidden files.

 

SITE MSG

The "SITE MeSsaGe" command can be used to send a message from an FTP client to the system administrator. The system administrator has the ability to view and send messages back, through the Administrator program. The syntax is:

 

 SITE MSG <message>