1 .\" Copyright (c) 1985, 1988, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
12 .\" 3. All advertising materials mentioning features or use of this software
13 .\" must display the following acknowledgement:
14 .\" This product includes software developed by the University of
15 .\" California, Berkeley and its contributors.
16 .\" 4. Neither the name of the University nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94
33 .\" $FreeBSD: src/libexec/ftpd/ftpd.8,v 1.36 2000/12/18 08:33:25 ru Exp $
41 Internet File Transfer Protocol server
55 .Op Fl T Ar maxtimeout
62 Internet File Transfer Protocol
63 server process. The server uses the
66 and listens at the port specified in the
68 service specification; see
72 .Bl -tag -width indent
74 Debugging information is written to the syslog using LOG_FTP.
76 Each successful and failed
78 session is logged using syslog with a facility of LOG_FTP.
79 If this option is specified twice, the retrieve (get), store (put), append,
80 delete, make directory, remove directory and rename operations and
81 their filename arguments are also logged. Note: LOG_FTP messages
84 by default, and may have to be enabled in
90 will detach and become a daemon, accepting connections on the FTP port and
91 forking children processes to handle them.
92 This is lower overhead than starting
96 and is thus useful on busy servers to reduce load.
100 will revert to historical behavior with regard to security checks on
101 user operations and restrictions on PORT requests.
104 will only honor PORT commands directed to unprivileged ports on the
105 remote user's host (which violates the FTP protocol specification but
106 closes some security holes).
108 With this option set,
110 logs all anonymous file downloads to the file
112 when this file exists.
114 In previous versions of
116 when a passive mode client requested a data connection to the server,
117 the server would use data ports in the range 1024..4999. Now, by default,
118 the server will use data ports in the range 49152..65535. Specifying this
119 option will revert to the old behavior.
121 A client may also request a different timeout period;
122 the maximum period allowed may be set to
127 The default limit is 2 hours.
129 The inactivity timeout period is set to
131 seconds (the default is 15 minutes).
135 is specified, accept connections only on the specified
140 is specified, write the daemon's process ID to
145 is specified, accept connections via AF_INET6 socket.
149 is specified, accept IPv4 connections.
152 is also specified, accept IPv4 connection via AF_INET6 socket.
155 is not specified, accept IPv4 connection via AF_INET socket.
157 Allow only anonymous ftp access.
159 Put server in read-only mode.
160 All commands which may modify the local filesystem are disabled.
162 Disable the EPSV command.
163 This is useful for servers behind older firewalls.
168 can be used to disable ftp access.
171 displays it and exits.
176 prints it before issuing the
183 prints it after a successful login. Note the motd file used is the one
184 relative to the login environment. This means the one in
186 in the anonymous user's case.
188 The ftp server currently supports the following ftp requests.
189 The case of the requests is ignored. Requests marked [RW] are
193 .Bl -column "Request" -offset indent
194 .It Sy Request Ta Sy "Description"
195 .It ABOR Ta "abort previous command"
196 .It ACCT Ta "specify account (ignored)"
197 .It ALLO Ta "allocate storage (vacuously)"
198 .It APPE Ta "append to a file [RW]"
199 .It CDUP Ta "change to parent of current working directory"
200 .It CWD Ta "change working directory"
201 .It DELE Ta "delete a file [RW]"
202 .It EPRT Ta "specify data connection port, multiprotocol"
203 .It EPSV Ta "prepare for server-to-server transfer, multiprotocol"
204 .It HELP Ta "give help information"
205 .It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA"
206 .It LPRT Ta "specify data connection port, multiprotocol"
207 .It LPSV Ta "prepare for server-to-server transfer, multiprotocol"
208 .It MDTM Ta "show last modification time of file"
209 .It MKD Ta "make a directory [RW]"
210 .It MODE Ta "specify data transfer" Em mode
211 .It NLST Ta "give name list of files in directory"
212 .It NOOP Ta "do nothing"
213 .It PASS Ta "specify password"
214 .It PASV Ta "prepare for server-to-server transfer"
215 .It PORT Ta "specify data connection port"
216 .It PWD Ta "print the current working directory"
217 .It QUIT Ta "terminate session"
218 .It REST Ta "restart incomplete transfer"
219 .It RETR Ta "retrieve a file"
220 .It RMD Ta "remove a directory [RW]"
221 .It RNFR Ta "specify rename-from file name [RW]"
222 .It RNTO Ta "specify rename-to file name [RW]"
223 .It SITE Ta "non-standard commands (see next section)"
224 .It SIZE Ta "return size of file"
225 .It STAT Ta "return status of server"
226 .It STOR Ta "store a file [RW]"
227 .It STOU Ta "store a file with a unique name [RW]"
228 .It STRU Ta "specify data transfer" Em structure
229 .It SYST Ta "show operating system type of server system"
230 .It TYPE Ta "specify data transfer" Em type
231 .It USER Ta "specify user name"
232 .It XCUP Ta "change to parent of current working directory (deprecated)"
233 .It XCWD Ta "change working directory (deprecated)"
234 .It XMKD Ta "make a directory (deprecated) [RW]"
235 .It XPWD Ta "print the current working directory (deprecated)"
236 .It XRMD Ta "remove a directory (deprecated) [RW]"
239 The following non-standard or
241 specific commands are supported
245 .Bl -column Request -offset indent
246 .It Sy Request Ta Sy Description
247 .It UMASK Ta change umask, e.g. ``SITE UMASK 002''
248 .It IDLE Ta set idle-timer, e.g. ``SITE IDLE 60''
249 .It CHMOD Ta "change mode of a file [RW], e.g. ``SITE CHMOD 755 filename''"
250 .It HELP Ta give help information
253 The remaining ftp requests specified in Internet RFC 959
255 recognized, but not implemented.
256 MDTM and SIZE are not specified in RFC 959, but will appear in the
257 next updated FTP RFC.
259 The ftp server will abort an active file transfer only when the
261 command is preceded by a Telnet "Interrupt Process" (IP)
262 signal and a Telnet "Synch" signal in the command Telnet stream,
263 as described in Internet RFC 959.
266 command is received during a data transfer, preceded by a Telnet IP
267 and Synch, transfer status will be returned.
270 interprets file names according to the
274 This allows users to utilize the metacharacters
278 authenticates users according to six rules.
280 .Bl -enum -offset indent
282 The login name must be in the password data base
283 and not have a null password.
284 In this case a password must be provided by the client before any
285 file operations may be performed.
286 If the user has an S/Key key, the response from a successful USER
287 command will include an S/Key challenge.
288 The client may choose to respond with a PASS command giving either
289 a standard password or an S/Key one-time password.
290 The server will automatically determine which type of
291 password it has been given and attempt to authenticate accordingly.
294 for more information on S/Key authentication.
295 S/Key is a Trademark of Bellcore.
297 The login name must not appear in the file
300 The login name must not be a member of a group specified in the file
302 Entries in this file interpreted as group names are prefixed by an "at"
306 The user must have a standard shell returned by
309 If the user name appears in the file
311 or the user is a member of a group with a group entry in this file,
312 i.e. one prefixed with
314 the session's root will be changed to the user's login directory by
320 account (see next item).
321 This facility may also be triggered by enabling the boolean "ftp-chroot"
324 However, the user must still supply a password.
325 This feature is intended as a compromise between a fully anonymous
326 account and a fully privileged account.
327 The account should also be set up as for an anonymous account.
334 anonymous ftp account must be present in the password
337 In this case the user is allowed
338 to log in by specifying any password (by convention an email address for
339 the user should be used as the password).
342 option is set, all transfers are logged as well.
347 takes special measures to restrict the client's access privileges.
348 The server performs a
350 to the home directory of the
353 In order that system security is not breached, it is recommended
356 subtree be constructed with care, following these rules:
357 .Bl -tag -width "~ftp/pub" -offset indent
359 Make the home directory owned by
361 and unwritable by anyone.
363 Make this directory owned by
365 and unwritable by anyone (mode 555).
366 The files pwd.db (see
370 must be present for the
372 command to be able to produce owner names rather than numbers.
373 The password field in
375 is not used, and should not contain real passwords.
378 if present, will be printed after a successful login.
379 These files should be mode 444.
381 Make this directory mode 777 and owned by
384 can then place files which are to be accessible via the anonymous
385 account in this directory.
388 If the system has multiple IP addresses,
390 supports the idea of virtual hosts, which provides the ability to
391 define multiple anonymous ftp areas, each one allocated to a different
395 contains information pertaining to each of the virtual hosts.
396 Each host is defined on its own line which contains a number of
397 fields separated by whitespace:
398 .Bl -tag -offset indent -width hostname
400 Contains the hostname or IP address of the virtual host.
402 Contains a user record in the system password file.
403 As with normal anonymous ftp, this user's access uid, gid and group
404 memberships determine file access to the anonymous ftp area.
405 The anonymous ftp area (to which any user is chrooted on login)
406 is determined by the home directory defined for the account.
407 User id and group for any ftp account may be the same as for the
410 File to which all file transfers are logged, which
414 This file is the welcome message displayed before the server ready
417 .Pa /etc/ftpwelcome .
419 This file is displayed after the user logs in.
424 Lines beginning with a '#' are ignored and can be used to include
427 Defining a virtual host for the primary IP address or hostname
428 changes the default for ftp logins to that address.
429 The 'user', 'statfile', 'welcome' and 'motd' fields may be left
430 blank, or a single hypen '-' used to indicate that the default
433 As with any anonymous login configuration, due care must be given
434 to setup and maintenance to guard against security related problems.
437 has internal support for handling remote requests to list
438 files, and will not execute
440 in either a chrooted or non-chrooted environment. The
442 executable need not be placed into the chrooted tree, nor need the
446 .Bl -tag -width /etc/ftpwelcome -compact
448 List of unwelcome/restricted users.
449 .It Pa /etc/ftpchroot
450 List of normal users who should be chroot'd.
452 Virtual hosting configuration file.
453 .It Pa /etc/ftpwelcome
456 Welcome notice after login.
457 .It Pa /var/run/nologin
458 Displayed and access refused.
460 Log file for anonymous transfers.
470 The server must run as the super-user
471 to create sockets with privileged port numbers. It maintains
472 an effective user id of the logged in user, reverting to
473 the super-user only when binding addresses to sockets. The
474 possible security holes have been extensively
475 scrutinized, but are possibly incomplete.
481 IPv6 support was added in WIDE Hydrangea IPv6 stack kit.