-->
Page 151
Several tools are available to help you administer your FTP server. These tools were automatically installed as part of the wu-ftp package when the wu-ftpd RPM was installed. These utilities help you see the current status of the server as well as control its shutdown procedure:
The ftpshut command helps make shutting down the FTP server easier. 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
ftpshut -l <login-minutes> -d <drop-minutes> <time> <warning message>
where <login-minutes> is the number of minutes before the server shutdown that the server will begin refusing new FTP transactions. <drop-minutes> is the number of minutes before the 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 in 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 causes the server to shut down in 60 minutes.) The last option is the most drastic; by specifying the string now, the server shuts down immediately.
<warning message> is the message displayed on all the FTP clients 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 displays all the active users on the system connected through FTP. The output of the command is in the format of the /bin/ps command. This format of this command is
<pid> <tty> <stat> <time> <connection details>
where <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 that it is the currently running process. <time> indicates how much actual CPU time that instance of the FTP has taken, and finally, <connection details> tells where the connection is coming from, who is the user, and what that user's current function is.
Page 152
The following is an example of output from ftpwho:
Service class all: 10448 ? S 0:00 ftpd: vestax.domain.com: anonymous/sshah@domain.com: IDLE 10501 ? S 0:00 ftpd: toybox.domain.com: heidi: RETR mklinux-ALL.sit.bin - 2 users ( -1 maximum)
Here, you can see that two users are logged in (an unlimited number of users is allowed to connect). The first user is an anonymous user who claims to be sshah@domain.com and is currently not performing any functions. The second user, who has the username heidi, is currently retrieving the file mklinux-ALL.sit.bin.
ftpcount, which is a simplified version of ftpwho, shows only the total count of users logged in to the system and the maximum number of users allowed. A sample output from ftpcount shows the following:
Service class all - 2 users ( -1 maximum)
You might think that the proliferation of the World Wide Web would make FTP servers extinct; however, the last few years have shown us that quite the opposite is true. People are still deploying FTP sites in full force because of the ease of which they can be established and maintained. No cute HTML to do, no extra workjust put the file in the right place for download and let people get it.
This chapter covers a lot of detail on configuring the wu-ftpd server. The key points to remember when working with the FTP server are as follows: