ftpd(8)

πŸ’– ftpd β€” the Internet File Transfer Protocol server, bestie edition πŸ’–

okay so. this is the manual page for ftpd (that's the System Manager's Manual section, aka section 8, aka the "grown-up sysadmin stuff" zone) and honestly? she's iconic. she's literally the FTP server process. no cap.


✨ SYNOPSIS ✨

ftpd [option ...]

πŸ¦‹ DESCRIPTION πŸ¦‹

so ftpd is the Internet File Transfer Protocol server process β€” the main character, fr fr. she speaks the TCP protocol and she listens at the port that's specified in the β€œftp” service specification. wanna know more about that? go check out services(5). πŸ’…


🌸 OPTIONS 🌸

okay bestie, here's where it gets juicy. every single one of these, no skips:

  • -4, --ipv4 β€” restricts the daemon to listening on IPv4 addresses only. just the v4 girls.
  • -6, --ipv6 β€” restricts the daemon to listening on IPv6 addresses only. v6 supremacy, but only if you asked.
  • -d, --debug β€” debugging info gets written to the syslog, using LOG_FTP. detective mode activated πŸ”
  • -l, --logging β€” every successful and failed ftp(1) session gets logged via syslog with a facility of LOG_FTP. and if you specify this option twice? oh she's thorough β€” the retrieve (get), store (put), append, delete, make directory, remove directory and rename operations and their filename arguments get logged too. double it and give it to the next person πŸ“
  • -A, --anonymous-only β€” only anonymous login is allowed. that's it, that's the guest list. πŸ™ˆ
  • -D, --daemon β€” ftpd enters daemon-mode. this lets her run without inetd. she doesn't need a chaperone, okay? independent queen. πŸ‘‘
  • -q, --no-version β€” quiet mode. no info about the version of the ftpd gets handed to the client. she's mysterious like that. 🀫
  • -T, --max-timeout timeout β€” a client can request a different timeout period, and the maximum period allowed can be set to timeout seconds with this -T option. the default limit is 2 hours. know your limits bestie πŸ’…
  • -t, --timeout timeout β€” the inactivity timeout period gets set to timeout seconds. the default is 15 minutes. (ghost them for 15 min and they're gone πŸ’€)
  • -p, --pidfile pidfile β€” changes the default location of the pidfile. moving day! πŸ“¦
  • -a, --auth auth β€” gives anonymous another login-name (don't worry, anonymous and ftpd will still work). auth can be one of:
    • default β€” use passwd authentication.
    • pam β€” use the PAM service 'ftp'.
  • --non-rfc2577 β€” neglects RFC 2577 by giving out information on missing users. yikes, she's being a little messy on purpose. πŸ’€
  • -u, --umask value β€” sets the default umask to value.
  • -?, --help β€” displays a help list. we love a self-aware icon.
  • --usage β€” displays a short usage message.
  • -V, --version β€” displays the program version. πŸ’–

🌈 OPERATION 🌈

the file /etc/nologin can be used to disable ftp access. if that file exists, ftpd displays it and exits. periodt. if the file /etc/ftpwelcome exists, ftpd prints it before issuing the β€œready” message. and if the file /etc/motd exists, ftpd prints it after a successful login. ✨

the ftp server currently supports the following ftp requests. the case of the requests is ignored β€” she's not picky like that. πŸ’…

  • ABOR β€” abort previous command
  • ACCT β€” specify account (ignored)
  • ALLO β€” allocate storage (vacuously)
  • APPE β€” append to a file
  • CDUP β€” change to parent of current working directory
  • CWD β€” change working directory
  • DELE β€” delete a file
  • EPRT β€” extended data connection port, RFC 2428
  • EPSV β€” extended passive transfer request, RFC 2428
  • FEAT β€” display command extensions
  • HELP β€” give help information
  • LIST β€” give list files in a directory (β€œls -lgA”)
  • LPRT β€” long data connection port, RFC 1639
  • LPSV β€” long passive transfer request, RFC 1639
  • MKD β€” make a directory
  • MDTM β€” show last modification time of file
  • MODE β€” specify data transfer mode
  • NLST β€” give name list of files in directory
  • NOOP β€” do nothing
  • OPTS β€” option settings
  • PASS β€” specify password
  • PASV β€” prepare for server-to-server transfer
  • PORT β€” specify data connection port
  • PWD β€” print the current working directory
  • QUIT β€” terminate session
  • REST β€” restart incomplete transfer
  • RETR β€” retrieve a file
  • RMD β€” remove a directory
  • RNFR β€” specify rename-from file name
  • RNTO β€” specify rename-to file name
  • SITE β€” non-standard commands (see next section πŸ‘€)
  • SIZE β€” return size of file
  • STAT β€” return status of server
  • STOR β€” store a file
  • STOU β€” store a file with a unique name
  • STRU β€” specify data transfer structure
  • SYST β€” show operating system type of server system
  • TYPE β€” specify data transfer type
  • USER β€” specify user name
  • XCUP β€” change to parent of current working directory (deprecated)
  • XCWD β€” change working directory (deprecated)
  • XMKD β€” make a directory (deprecated)
  • XPWD β€” print the current working directory (deprecated)
  • XRMD β€” remove a directory (deprecated)

πŸŽ€ SITE requests πŸŽ€

the following non-standard or UNIX specific commands are supported by the SITE request:

  • UMASK β€” change umask, e.g. SITE UMASK 002
  • IDLE β€” set idle-timer, e.g. SITE IDLE 60
  • CHMOD β€” change mode of a file, e.g. SITE CHMOD 755 filename
  • HELP β€” give help information.

the remaining ftp requests specified in Internet RFC 959 are recognized, but not implemented. and heads up: MDTM and SIZE are not specified in RFC 959, but they will appear in the next updated FTP RFC. foreshadowing ✨

the ftp server will abort an active file transfer only when the ABOR command is preceded by a Telnet "Interrupt Process" (IP) signal and a Telnet "Synch" signal in the command Telnet stream, as described in Internet RFC 959. and if a STAT command is received during a data transfer β€” preceded by a Telnet IP and Synch β€” transfer status will be returned. very specific, very demure. πŸ’…

ftpd interprets file names according to the β€œglobbing” conventions used by csh(1). this lets users utilize the metacharacters β€œ*?[]{}~”. slay. 🌟

ftpd authenticates users according to three rules. (yes bestie, she says "three" and then lists four. we don't question the icon. πŸ™ˆ)

  1. The login name must be in the password data base, /etc/passwd, and not have a null password. in this case a password must be provided by the client before any file operations may be performed.
  2. The login name must not appear in the file /etc/ftpusers.
  3. The user must have a standard shell returned by getusershell(3).
  4. If the user name is β€œanonymous” or β€œftp”, an anonymous ftp account must be present in the password file (user β€œftp”). in this case the user is allowed to log in by specifying any password (by convention an email address for the user should be used as the password).

in the last case, ftpd takes special measures to restrict the client's access privileges. the server performs a chroot(2) to the home directory of the β€œftp” user. so that system security is not breached, it is recommended that the β€œftp” subtree be constructed with care, following these rules:

  • ~ftp β€” make the home directory owned by β€œroot” and unwritable by anyone.
  • ~ftp/bin β€” make this directory owned by β€œroot” and unwritable by anyone (mode 555). the program ls(1) must be present to support the list command. this program should be mode 111.
  • ~ftp/etc β€” make this directory owned by β€œroot” and unwritable by anyone (mode 555). the files passwd(5) and group(5) must be present for the ls command to be able to produce owner names rather than numbers. the password field in passwd is not used, and should not contain real passwords. the file motd, if present, will be printed after a successful login. these files should be mode 444.
  • ~ftp/pub β€” make this directory mode 777 and owned by β€œftp”. guests can then place files which are to be accessible via the anonymous account in this directory.
ok real talk bestie β€” that ~ftp setup section is the part you do not skip. security is the vibe. πŸ”’

🧚 FILES 🧚

  • /etc/ftpusers β€” list of unwelcome/restricted users.
  • /etc/ftpchroot β€” list of users to change root to their home directory.
  • /etc/ftpwelcome β€” welcome notice.
  • /etc/motd β€” welcome notice after login.
  • /etc/nologin β€” displayed and access refused.

⭐ SEE ALSO ⭐

ftp(1), getusershell(3), syslogd(8)


πŸ’€ BUGS πŸ’€

the server must run as the super-user to create sockets with privileged port numbers. she maintains an effective user id of the logged in user, reverting to the super-user only when binding addresses to sockets. the possible security holes have been extensively scrutinized, but are possibly incomplete. so like... mostly audited. not fully. be normal about it. 😭


🫢 HISTORY 🫢

the ftpd command appeared in 4.2BSD. she's been here. she's a legend. she's iconic. periodt. 🌈


and that's the whole page, no cap β€” brought to you by GNU Network Utilities, dated February 9, 2019. love that for us. bye bestie, go secure your ~ftp πŸŽ€πŸ’–βœ¨

πŸ“¦ where this page comes from