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
40 .Nd Internet File Transfer Protocol server
43 .Op Fl 46ADdEhMmOoRrSUvW
48 .Op Fl T Ar maxtimeout
55 Internet File Transfer Protocol
60 and listens at the port specified with the
64 service specification; see
68 .Bl -tag -width indent
72 is specified, accept connections via
78 is specified, accept connections via
82 Allow only anonymous ftp access.
86 is specified, accept connections only on the specified
91 will detach and become a daemon, accepting connections on the FTP port and
92 forking children processes to handle them.
93 This is lower overhead than starting
97 and is thus useful on busy servers to reduce load.
99 Debugging information is written to the syslog using
102 Disable the EPSV command.
103 This is useful for servers behind older firewalls.
105 Disable printing host-specific information, such as the
106 server software version or hostname, in server messages.
108 Each successful and failed
110 session is logged using syslog with a facility of
112 If this option is specified twice, the retrieve (get), store (put), append,
113 delete, make directory, remove directory and rename operations and
114 their filename arguments are also logged.
118 .Pa /var/log/xferlog .
120 Prevent anonymous users from creating directories.
122 Permit anonymous users to overwrite or modify
123 existing files if allowed by file system permissions.
124 By default, anonymous users cannot modify existing files;
125 in particular, files to upload will be created under a unique name.
127 Put server in write-only mode for anonymous users only.
128 RETR is disabled for anonymous users, preventing anonymous downloads.
129 This has no effect if
133 Put server in write-only mode.
134 RETR is disabled, preventing downloads.
138 is specified, accept connections at
140 specified as a numeric value or service name, instead of at the default
146 is specified, write the daemon's process ID to
148 instead of the default pid file,
149 .Pa /var/run/ftpd.pid .
151 With this option set,
153 will revert to historical behavior with regard to security checks on
154 user operations and restrictions on PORT requests.
157 will only honor PORT commands directed to unprivileged ports on the
158 remote user's host (which violates the FTP protocol specification but
159 closes some security holes).
161 Put server in read-only mode.
162 All commands which may modify the local file system are disabled.
164 With this option set,
166 logs all anonymous file downloads to the file
168 when this file exists.
170 A client may also request a different timeout period;
171 the maximum period allowed may be set to
176 The default limit is 2 hours.
178 The inactivity timeout period is set to
180 seconds (the default is 15 minutes).
182 This option instructs ftpd to use data ports in the range of
183 .Dv IP_PORTRANGE_DEFAULT
184 instead of in the range of
185 .Dv IP_PORTRANGE_HIGH .
186 Such a change may be useful for some specific firewall configurations;
189 for more information.
191 Note that option is a virtual no-op in
194 ranges are indentical by default.
196 The default file creation mode mask is set to
198 which is expected to be an octal numeric value.
202 This option may be overridden by
208 Do not log FTP sessions to
214 can be used to disable ftp access.
217 displays it and exits.
222 prints it before issuing the
229 prints it after a successful login.
230 Note the motd file used is the one
231 relative to the login environment.
232 This means the one in
234 in the anonymous user's case.
236 The ftp server currently supports the following ftp requests.
237 The case of the requests is ignored.
238 Requests marked [RW] are
242 .Bl -column "Request" -offset indent
243 .It Sy Request Ta Sy "Description"
244 .It ABOR Ta "abort previous command"
245 .It ACCT Ta "specify account (ignored)"
246 .It ALLO Ta "allocate storage (vacuously)"
247 .It APPE Ta "append to a file [RW]"
248 .It CDUP Ta "change to parent of current working directory"
249 .It CWD Ta "change working directory"
250 .It DELE Ta "delete a file [RW]"
251 .It EPRT Ta "specify data connection port, multiprotocol"
252 .It EPSV Ta "prepare for server-to-server transfer, multiprotocol"
253 .It HELP Ta "give help information"
254 .It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA"
255 .It LPRT Ta "specify data connection port, multiprotocol"
256 .It LPSV Ta "prepare for server-to-server transfer, multiprotocol"
257 .It MDTM Ta "show last modification time of file"
258 .It MKD Ta "make a directory [RW]"
259 .It MODE Ta "specify data transfer" Em mode
260 .It NLST Ta "give name list of files in directory"
261 .It NOOP Ta "do nothing"
262 .It PASS Ta "specify password"
263 .It PASV Ta "prepare for server-to-server transfer"
264 .It PORT Ta "specify data connection port"
265 .It PWD Ta "print the current working directory"
266 .It QUIT Ta "terminate session"
267 .It REST Ta "restart incomplete transfer"
268 .It RETR Ta "retrieve a file"
269 .It RMD Ta "remove a directory [RW]"
270 .It RNFR Ta "specify rename-from file name [RW]"
271 .It RNTO Ta "specify rename-to file name [RW]"
272 .It SITE Ta "non-standard commands (see next section)"
273 .It SIZE Ta "return size of file"
274 .It STAT Ta "return status of server"
275 .It STOR Ta "store a file [RW]"
276 .It STOU Ta "store a file with a unique name [RW]"
277 .It STRU Ta "specify data transfer" Em structure
278 .It SYST Ta "show operating system type of server system"
279 .It TYPE Ta "specify data transfer" Em type
280 .It USER Ta "specify user name"
281 .It XCUP Ta "change to parent of current working directory (deprecated)"
282 .It XCWD Ta "change working directory (deprecated)"
283 .It XMKD Ta "make a directory (deprecated) [RW]"
284 .It XPWD Ta "print the current working directory (deprecated)"
285 .It XRMD Ta "remove a directory (deprecated) [RW]"
288 The following non-standard or
290 specific commands are supported
294 .Bl -column Request -offset indent
295 .It Sy Request Ta Sy Description
296 .It UMASK Ta change umask, e.g. ``SITE UMASK 002''
297 .It IDLE Ta set idle-timer, e.g. ``SITE IDLE 60''
298 .It CHMOD Ta "change mode of a file [RW], e.g. ``SITE CHMOD 755 filename''"
299 .It MD5 Ta "report the files MD5 checksum, e.g. ``SITE MD5 filename''"
300 .It HELP Ta give help information
303 Note: SITE requests are disabled in case of anonymous logins.
305 The remaining ftp requests specified in Internet RFC 959
307 recognized, but not implemented.
308 MDTM and SIZE are not specified in RFC 959, but will appear in the
309 next updated FTP RFC.
310 To avoid possible denial-of-service attacks, SIZE requests against
311 files larger than 10240 bytes will be denied if the current transfer
314 The ftp server will abort an active file transfer only when the
316 command is preceded by a Telnet "Interrupt Process" (IP)
317 signal and a Telnet "Synch" signal in the command Telnet stream,
318 as described in Internet RFC 959.
321 command is received during a data transfer, preceded by a Telnet IP
322 and Synch, transfer status will be returned.
326 utility interprets file names according to the
330 This allows users to utilize the metacharacters
335 utility authenticates users according to six rules.
337 .Bl -enum -offset indent
339 The login name must be in the password data base
340 and not have a null password.
341 In this case a password must be provided by the client before any
342 file operations may be performed.
343 If the user has an S/Key key, the response from a successful USER
344 command will include an S/Key challenge.
345 The client may choose to respond with a PASS command giving either
346 a standard password or an S/Key one-time password.
347 The server will automatically determine which type of
348 password it has been given and attempt to authenticate accordingly.
351 for more information on S/Key authentication.
352 S/Key is a Trademark of Bellcore.
354 The login name must not appear in the file
357 The login name must not be a member of a group specified in the file
359 Entries in this file interpreted as group names are prefixed by an "at"
363 The user must have a standard shell returned by
366 If the user name appears in the file
368 or the user is a member of a group with a group entry in this file,
369 i.e., one prefixed with
371 the session's root will be changed to the directory specified
372 in this file or to the user's login directory by
378 account (see next item).
381 for a detailed description of the format of this file.
382 This facility may also be triggered by enabling the boolean "ftp-chroot"
385 However, the user must still supply a password.
386 This feature is intended as a compromise between a fully anonymous
387 account and a fully privileged account.
388 The account should also be set up as for an anonymous account.
395 anonymous ftp account must be present in the password
398 In this case the user is allowed
399 to log in by specifying any password (by convention an email address for
400 the user should be used as the password).
403 option is set, all transfers are logged as well.
408 takes special measures to restrict the client's access privileges.
409 The server performs a
411 to the home directory of the
414 As a special case if the
416 user's home directory pathname contains the
420 uses its left-hand side as the name of the directory to do
422 to, and its right-hand side to change the current directory to afterwards.
423 A typical example for this case would be
424 .Pa /usr/local/ftp/./pub .
425 In order that system security is not breached, it is recommended
428 subtree be constructed with care, following these rules:
429 .Bl -tag -width "~ftp/pub" -offset indent
431 Make the home directory owned by
433 and unwritable by anyone.
435 Make this directory owned by
437 and unwritable by anyone (mode 555).
438 The files pwd.db (see
442 must be present for the
444 command to be able to produce owner names rather than numbers.
445 The password field in
447 is not used, and should not contain real passwords.
450 if present, will be printed after a successful login.
451 These files should be mode 444.
453 This directory and the subdirectories beneath it should be owned
454 by the users and groups responsible for placing files in them,
455 and be writable only by them (mode 755 or 775).
458 be owned or writable by
460 or its group, otherwise guest users
461 can fill the drive with unwanted files.
464 If the system has multiple IP addresses,
466 supports the idea of virtual hosts, which provides the ability to
467 define multiple anonymous ftp areas, each one allocated to a different
471 contains information pertaining to each of the virtual hosts.
472 Each host is defined on its own line which contains a number of
473 fields separated by whitespace:
474 .Bl -tag -offset indent -width hostname
476 Contains the hostname or IP address of the virtual host.
478 Contains a user record in the system password file.
479 As with normal anonymous ftp, this user's access uid, gid and group
480 memberships determine file access to the anonymous ftp area.
481 The anonymous ftp area (to which any user is chrooted on login)
482 is determined by the home directory defined for the account.
483 User id and group for any ftp account may be the same as for the
486 File to which all file transfers are logged, which
490 This file is the welcome message displayed before the server ready
493 .Pa /etc/ftpwelcome .
495 This file is displayed after the user logs in.
500 Lines beginning with a '#' are ignored and can be used to include
503 Defining a virtual host for the primary IP address or hostname
504 changes the default for ftp logins to that address.
505 The 'user', 'statfile', 'welcome' and 'motd' fields may be left
506 blank, or a single hyphen '-' used to indicate that the default
509 As with any anonymous login configuration, due care must be given
510 to setup and maintenance to guard against security related problems.
514 utility has internal support for handling remote requests to list
515 files, and will not execute
517 in either a chrooted or non-chrooted environment.
520 executable need not be placed into the chrooted tree, nor need the
524 .Bl -tag -width ".Pa /var/run/ftpd.pid" -compact
526 List of unwelcome/restricted users.
527 .It Pa /etc/ftpchroot
528 List of normal users who should be chroot'd.
530 Virtual hosting configuration file.
531 .It Pa /etc/ftpwelcome
534 Welcome notice after login.
535 .It Pa /var/run/ftpd.pid
536 Default pid file for daemon mode.
537 .It Pa /var/run/nologin
538 Displayed and access refused.
540 Log file for anonymous transfers.
541 .It Pa /var/log/xferlog
542 Default place for session logs.
558 IPv6 support was added in WIDE Hydrangea IPv6 stack kit.
560 The server must run as the super-user
561 to create sockets with privileged port numbers.
563 an effective user id of the logged in user, reverting to
564 the super-user only when binding addresses to sockets.
566 possible security holes have been extensively
567 scrutinized, but are possibly incomplete.