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. Neither the name of the University nor the names of its contributors
13 .\" may be used to endorse or promote products derived from this software
14 .\" without specific prior written permission.
16 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
17 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
20 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94
29 .\" $FreeBSD: src/libexec/ftpd/ftpd.8,v 1.74 2007/04/20 09:08:20 trhodes Exp $
31 .Dd September 11, 2019
36 .Nd Internet File Transfer Protocol server
39 .Op Fl 468ADdEhMmOoRrSUvW
45 .Op Fl T Ar maxtimeout
52 Internet File Transfer Protocol
57 and listens at the port specified with the
61 service specification; see
65 .Bl -tag -width indent
69 is specified, accept connections via
75 is specified, accept connections via
79 Enable transparent UTF-8 mode.
80 RFC\ 2640 compliant clients will be told that the character encoding
81 used by the server is UTF-8, which is the only effect of the option.
83 This option does not enable any encoding conversion for server file names;
84 it implies instead that the names of files on the server are encoded
86 As for files uploaded via FTP, it is the duty of the RFC\ 2640 compliant
87 client to convert their names from the client's local encoding to UTF-8.
88 FTP command names and own
90 messages are always encoded in ASCII, which is a subset of UTF-8.
91 Hence no need for server-side conversion at all.
93 Allow only anonymous ftp access.
97 is specified, accept connections only on the specified
100 With this option set,
102 will detach and become a daemon, accepting connections on the FTP port and
103 forking children processes to handle them.
104 This is lower overhead than starting
108 and is thus useful on busy servers to reduce load.
110 Debugging information is written to the syslog using
113 Disable the EPSV command.
114 This is useful for servers behind older firewalls.
116 Disable printing host-specific information, such as the
117 server software version or hostname, in server messages.
119 Advertise the hostname as
121 instead of using the value of
124 Each successful and failed
126 session is logged using syslog with a facility of
128 If this option is specified twice, the retrieve (get), store (put), append,
129 delete, make directory, remove directory and rename operations and
130 their filename arguments are also logged.
134 .Pa /var/log/xferlog .
136 Prevent anonymous users from creating directories.
138 Permit anonymous users to overwrite or modify
139 existing files if allowed by file system permissions.
140 By default, anonymous users cannot modify existing files;
141 in particular, files to upload will be created under a unique name.
143 Put server in write-only mode for anonymous users only.
144 RETR is disabled for anonymous users, preventing anonymous downloads.
145 This has no effect if
149 Put server in write-only mode.
150 RETR is disabled, preventing downloads.
154 is specified, accept connections at
156 specified as a numeric value or service name, instead of at the default
162 is specified, write the daemon's process ID to
164 instead of the default pid file,
165 .Pa /var/run/ftpd.pid .
167 With this option set,
169 will revert to historical behavior with regard to security checks on
170 user operations and restrictions on PORT requests.
173 will only honor PORT commands directed to unprivileged ports on the
174 remote user's host (which violates the FTP protocol specification but
175 closes some security holes).
177 Put server in read-only mode.
178 All commands which may modify the local file system are disabled.
180 With this option set,
182 logs all anonymous file downloads to the file
184 when this file exists.
186 A client may also request a different timeout period;
187 the maximum period allowed may be set to
192 The default limit is 2 hours.
194 The inactivity timeout period is set to
196 seconds (the default is 15 minutes).
198 This option instructs ftpd to use data ports in the range of
199 .Dv IP_PORTRANGE_DEFAULT
200 instead of in the range of
201 .Dv IP_PORTRANGE_HIGH .
202 Such a change may be useful for some specific firewall configurations;
205 for more information.
207 Note that option is a virtual no-op in
210 ranges are identical by default.
212 The default file creation mode mask is set to
214 which is expected to be an octal numeric value.
218 This option may be overridden by
224 Do not log FTP sessions to
230 can be used to disable ftp access.
233 displays it and exits.
238 prints it before issuing the
245 prints it after a successful login.
246 Note the motd file used is the one
247 relative to the login environment.
248 This means the one in
250 in the anonymous user's case.
252 The ftp server currently supports the following ftp requests.
253 The case of the requests is ignored.
254 Requests marked [RW] are
258 .Bl -column "Request" -offset indent
259 .It Sy Request Ta Sy "Description"
260 .It ABOR Ta "abort previous command"
261 .It ACCT Ta "specify account (ignored)"
262 .It ALLO Ta "allocate storage (vacuously)"
263 .It APPE Ta "append to a file [RW]"
264 .It CDUP Ta "change to parent of current working directory"
265 .It CWD Ta "change working directory"
266 .It DELE Ta "delete a file [RW]"
267 .It EPRT Ta "specify data connection port, multiprotocol"
268 .It EPSV Ta "prepare for server-to-server transfer, multiprotocol"
269 .It FEAT Ta "give information on extended features of server"
270 .It HELP Ta "give help information"
271 .It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA"
272 .It LPRT Ta "specify data connection port, multiprotocol"
273 .It LPSV Ta "prepare for server-to-server transfer, multiprotocol"
274 .It MDTM Ta "show last modification time of file"
275 .It MKD Ta "make a directory [RW]"
276 .It MODE Ta "specify data transfer" Em mode
277 .It NLST Ta "give name list of files in directory"
278 .It NOOP Ta "do nothing"
279 .It PASS Ta "specify password"
280 .It PASV Ta "prepare for server-to-server transfer"
281 .It PORT Ta "specify data connection port"
282 .It PWD Ta "print the current working directory"
283 .It QUIT Ta "terminate session"
284 .It REST Ta "restart incomplete transfer"
285 .It RETR Ta "retrieve a file"
286 .It RMD Ta "remove a directory [RW]"
287 .It RNFR Ta "specify rename-from file name [RW]"
288 .It RNTO Ta "specify rename-to file name [RW]"
289 .It SITE Ta "non-standard commands (see next section)"
290 .It SIZE Ta "return size of file"
291 .It STAT Ta "return status of server"
292 .It STOR Ta "store a file [RW]"
293 .It STOU Ta "store a file with a unique name [RW]"
294 .It STRU Ta "specify data transfer" Em structure
295 .It SYST Ta "show operating system type of server system"
296 .It TYPE Ta "specify data transfer" Em type
297 .It USER Ta "specify user name"
298 .It XCUP Ta "change to parent of current working directory (deprecated)"
299 .It XCWD Ta "change working directory (deprecated)"
300 .It XMKD Ta "make a directory (deprecated) [RW]"
301 .It XPWD Ta "print the current working directory (deprecated)"
302 .It XRMD Ta "remove a directory (deprecated) [RW]"
305 The following non-standard or
307 specific commands are supported
310 .Bl -column Request -offset indent
311 .It Sy Request Ta Sy Description
312 .It UMASK Ta change umask, e.g. ``SITE UMASK 002''
313 .It IDLE Ta set idle-timer, e.g. ``SITE IDLE 60''
314 .It CHMOD Ta "change mode of a file [RW], e.g. ``SITE CHMOD 755 filename''"
315 .It MD5 Ta "report the files MD5 checksum, e.g. ``SITE MD5 filename''"
316 .It HELP Ta give help information
319 Note: SITE requests are disabled in case of anonymous logins.
321 The remaining ftp requests specified in Internet RFC 959
323 recognized, but not implemented.
324 MDTM and SIZE are not specified in RFC 959, but will appear in the
325 next updated FTP RFC.
326 To avoid possible denial-of-service attacks, SIZE requests against
327 files larger than 10240 bytes will be denied if the current transfer
330 The ftp server will abort an active file transfer only when the
332 command is preceded by a Telnet "Interrupt Process" (IP)
333 signal and a Telnet "Synch" signal in the command Telnet stream,
334 as described in Internet RFC 959.
337 command is received during a data transfer, preceded by a Telnet IP
338 and Synch, transfer status will be returned.
342 utility interprets file names according to the
346 This allows users to utilize the metacharacters
351 utility authenticates users according to six rules.
352 .Bl -enum -offset indent
354 The login name must be in the password data base
355 and not have a null password.
356 In this case a password must be provided by the client before any
357 file operations may be performed.
359 The login name must not appear in the file
362 The login name must not be a member of a group specified in the file
364 Entries in this file interpreted as group names are prefixed by an "at"
368 The user must have a standard shell returned by
371 If the user name appears in the file
373 or the user is a member of a group with a group entry in this file,
374 i.e., one prefixed with
376 the session's root will be changed to the directory specified
377 in this file or to the user's login directory by
383 account (see next item).
386 for a detailed description of the format of this file.
387 This facility may also be triggered by enabling the boolean "ftp-chroot"
390 However, the user must still supply a password.
391 This feature is intended as a compromise between a fully anonymous
392 account and a fully privileged account.
393 The account should also be set up as for an anonymous account.
400 anonymous ftp account must be present in the password
403 In this case the user is allowed
404 to log in by specifying any password (by convention an email address for
405 the user should be used as the password).
408 option is set, all transfers are logged as well.
413 takes special measures to restrict the client's access privileges.
414 The server performs a
416 to the home directory of the
419 As a special case if the
421 user's home directory pathname contains the
425 uses its left-hand side as the name of the directory to do
427 to, and its right-hand side to change the current directory to afterwards.
428 A typical example for this case would be
429 .Pa /usr/local/ftp/./pub .
430 In order that system security is not breached, it is recommended
433 subtree be constructed with care, following these rules:
434 .Bl -tag -width "~ftp/pub" -offset indent
436 Make the home directory owned by
438 and unwritable by anyone.
440 Make this directory owned by
442 and unwritable by anyone (mode 555).
443 The files pwd.db (see
447 must be present for the
449 command to be able to produce owner names rather than numbers.
450 The password field in
452 is not used, and should not contain real passwords.
455 if present, will be printed after a successful login.
456 These files should be mode 444.
458 This directory and the subdirectories beneath it should be owned
459 by the users and groups responsible for placing files in them,
460 and be writable only by them (mode 755 or 775).
463 be owned or writable by
465 or its group, otherwise guest users
466 can fill the drive with unwanted files.
469 If the system has multiple IP addresses,
471 supports the idea of virtual hosts, which provides the ability to
472 define multiple anonymous ftp areas, each one allocated to a different
476 contains information pertaining to each of the virtual hosts.
477 Each host is defined on its own line which contains a number of
478 fields separated by whitespace:
479 .Bl -tag -offset indent -width hostname
481 Contains the hostname or IP address of the virtual host.
483 Contains a user record in the system password file.
484 As with normal anonymous ftp, this user's access uid, gid and group
485 memberships determine file access to the anonymous ftp area.
486 The anonymous ftp area (to which any user is chrooted on login)
487 is determined by the home directory defined for the account.
488 User id and group for any ftp account may be the same as for the
491 File to which all file transfers are logged, which
495 This file is the welcome message displayed before the server ready
498 .Pa /etc/ftpwelcome .
500 This file is displayed after the user logs in.
505 Lines beginning with a '#' are ignored and can be used to include
508 Defining a virtual host for the primary IP address or hostname
509 changes the default for ftp logins to that address.
510 The 'user', 'statfile', 'welcome' and 'motd' fields may be left
511 blank, or a single hyphen '-' used to indicate that the default
514 As with any anonymous login configuration, due care must be given
515 to setup and maintenance to guard against security related problems.
519 utility has internal support for handling remote requests to list
520 files, and will not execute
522 in either a chrooted or non-chrooted environment.
525 executable need not be placed into the chrooted tree, nor need the
529 .Bl -tag -width ".Pa /var/run/ftpd.pid" -compact
531 List of unwelcome/restricted users.
532 .It Pa /etc/ftpchroot
533 List of normal users who should be chroot'd.
535 Virtual hosting configuration file.
536 .It Pa /etc/ftpwelcome
539 Welcome notice after login.
540 .It Pa /var/run/ftpd.pid
541 Default pid file for daemon mode.
542 .It Pa /var/run/nologin
543 Displayed and access refused.
545 Log file for anonymous transfers.
546 .It Pa /var/log/xferlog
547 Default place for session logs.
562 IPv6 support was added in WIDE Hydrangea IPv6 stack kit.
564 The server must run as the super-user
565 to create sockets with privileged port numbers.
567 an effective user id of the logged in user, reverting to
568 the super-user only when binding addresses to sockets.
570 possible security holes have been extensively
571 scrutinized, but are possibly incomplete.