Red Hat Linux 7 Unleashed

Red Hat Linux 7 Unleashed

By William Ball

FTP Administrative Tools

Several are available to help you administer your FTP server. These tools were automatically installed as part of the wu-ftp package when the server was installed. These utilities help you see the current status of the server and control its shutdown procedure:

ftprestart

The ftprestart command performs the reverse of the ftpshut command, and is used to restart an FTP server that has been shut down. The format of ftprestart is as follows:

ftprestart -V

The -V option merely prints a version number.

ftpshut

The ftpshut command eases shutdown procedures of the FTP server. This capability, of course, applies only if you are running the server all the time—instead of leaving it to be invoked from inetd as needed. The format of ftpshut is as follows:

ftpshut -l login-minutes -d drop-minutes time warning message

login-minutes is the number of minutes before server shutdown that the server will begin refusing new FTP transactions. drop-minutes is the number of minutes before server shutdown that the server will begin dropping existing connections. The default value for login-minutes is 10, and the default for drop-minutes is 5.

time is the time at which the server will be shut down. You can specify this time one of three ways. The first is to specify the time in military format without the colon (for example, 0312 to indicate 3:12 a.m.). The second is to specify the number of minutes to wait before shutting down. The format of this method is + min,, where min is the number of minutes to wait (for example, +60 shuts the server down in 60 minutes). The last option is the most drastic; if you specify the string now, the server shuts down immediately.

warning message is the message displayed to all FTP clients, instructing them that the server will be shut down. See the description of the shutdown command for the /etc/ftpaccess file earlier in this chapter for details on the formatting available for the warning message.

ftpwho

ftpwho displays all the active FTP users on the system. The output of the command is in the format of the /bin/ps command. The format of this command follows:


   pid tty stat time connection details

pid is the process ID of the FTP daemon handling the transfer; tty is always a question mark (?) because the connection is coming from FTP, not Telnet; stat is the status of that particular instance of the daemon, where S means it's sleeping, Z means it has crashed (gone zombie), and R means it's the currently running process. time indicates how much actual CPU time that instance of the FTP has taken. Finally, connection details tells where the connection is coming from, who the user is, and that user's current function.

The following is an example of output from ftpwho:

Service class all:
 1184 ?        SN     0:00 ftpd: dell.home.org: anonymous/horsey@sawbill.com: IDLE
 1181 ?        SN     0:00 ftpd: green.home.org: bball: IDLE
   -   2 users (-1 maximum)

Here you can see that two users are logged in. (An unlimited number of users are allowed to connect). The first user is an anonymous user who claims to be horsey@sawbill.com and is currently not performing any functions. The second user, who has the username bball, is currently also idle.

ftpcount

ftpcount, which is a simplified version of ftpwho, shows the current total of users in each class defined in /etc/ftpaccess. A sample output from ftpcount shows the following:

Service class all                  -   2 users ( -1 maximum)

Share ThisShare This

Informit Network