1ea022d16SRodney W. Grimes.\" Copyright (c) 1985, 1988, 1991, 1993 2ea022d16SRodney W. Grimes.\" The Regents of the University of California. All rights reserved. 3ea022d16SRodney W. Grimes.\" 4ea022d16SRodney W. Grimes.\" Redistribution and use in source and binary forms, with or without 5ea022d16SRodney W. Grimes.\" modification, are permitted provided that the following conditions 6ea022d16SRodney W. Grimes.\" are met: 7ea022d16SRodney W. Grimes.\" 1. Redistributions of source code must retain the above copyright 8ea022d16SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer. 9ea022d16SRodney W. Grimes.\" 2. Redistributions in binary form must reproduce the above copyright 10ea022d16SRodney W. Grimes.\" notice, this list of conditions and the following disclaimer in the 11ea022d16SRodney W. Grimes.\" documentation and/or other materials provided with the distribution. 12ea022d16SRodney W. Grimes.\" 3. All advertising materials mentioning features or use of this software 13ea022d16SRodney W. Grimes.\" must display the following acknowledgement: 14ea022d16SRodney W. Grimes.\" This product includes software developed by the University of 15ea022d16SRodney W. Grimes.\" California, Berkeley and its contributors. 16ea022d16SRodney W. Grimes.\" 4. Neither the name of the University nor the names of its contributors 17ea022d16SRodney W. Grimes.\" may be used to endorse or promote products derived from this software 18ea022d16SRodney W. Grimes.\" without specific prior written permission. 19ea022d16SRodney W. Grimes.\" 20ea022d16SRodney W. Grimes.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21ea022d16SRodney W. Grimes.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22ea022d16SRodney W. Grimes.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23ea022d16SRodney W. Grimes.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24ea022d16SRodney W. Grimes.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25ea022d16SRodney W. Grimes.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26ea022d16SRodney W. Grimes.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27ea022d16SRodney W. Grimes.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28ea022d16SRodney W. Grimes.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29ea022d16SRodney W. Grimes.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30ea022d16SRodney W. Grimes.\" SUCH DAMAGE. 31ea022d16SRodney W. Grimes.\" 32ea022d16SRodney W. Grimes.\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94 33ea022d16SRodney W. Grimes.\" 34ea022d16SRodney W. Grimes.Dd April 19, 1994 35ea022d16SRodney W. Grimes.Dt FTPD 8 36ea022d16SRodney W. Grimes.Os BSD 4.2 37ea022d16SRodney W. Grimes.Sh NAME 38ea022d16SRodney W. Grimes.Nm ftpd 39ea022d16SRodney W. Grimes.Nd 40ea022d16SRodney W. GrimesInternet File Transfer Protocol server 41ea022d16SRodney W. Grimes.Sh SYNOPSIS 42ea022d16SRodney W. Grimes.Nm ftpd 43ea022d16SRodney W. Grimes.Op Fl dl 443eb568f2SGuido van Rooij.Op Fl S 45ea022d16SRodney W. Grimes.Op Fl T Ar maxtimeout 46ea022d16SRodney W. Grimes.Op Fl t Ar timeout 47ea022d16SRodney W. Grimes.Sh DESCRIPTION 48ea022d16SRodney W. Grimes.Nm Ftpd 49ea022d16SRodney W. Grimesis the 50ea022d16SRodney W. GrimesInternet File Transfer Protocol 51ea022d16SRodney W. Grimesserver process. The server uses the 52ea022d16SRodney W. Grimes.Tn TCP 53ea022d16SRodney W. Grimesprotocol 54ea022d16SRodney W. Grimesand listens at the port specified in the 55ea022d16SRodney W. Grimes.Dq ftp 56ea022d16SRodney W. Grimesservice specification; see 57ea022d16SRodney W. Grimes.Xr services 5 . 58ea022d16SRodney W. Grimes.Pp 59ea022d16SRodney W. GrimesAvailable options: 60ea022d16SRodney W. Grimes.Bl -tag -width Ds 61ea022d16SRodney W. Grimes.It Fl d 62ea022d16SRodney W. GrimesDebugging information is written to the syslog using LOG_FTP. 63ea022d16SRodney W. Grimes.It Fl l 64ea022d16SRodney W. GrimesEach successful and failed 65ea022d16SRodney W. Grimes.Xr ftp 1 66ea022d16SRodney W. Grimessession is logged using syslog with a facility of LOG_FTP. 67ea022d16SRodney W. GrimesIf this option is specified twice, the retrieve (get), store (put), append, 68ea022d16SRodney W. Grimesdelete, make directory, remove directory and rename operations and 69ea022d16SRodney W. Grimestheir filename arguments are also logged. 703eb568f2SGuido van Rooij.It Fl S 713eb568f2SGuido van RooijWith this option set, 723eb568f2SGuido van Rooij.Nm ftpd 733eb568f2SGuido van Rooijlogs all anonymous transfers to the file 743eb568f2SGuido van Rooij.Pa /var/log/ftpd 753eb568f2SGuido van Rooijwhen this file exists. 763eb568f2SGuido van Rooij. 77ea022d16SRodney W. Grimes.It Fl T 78ea022d16SRodney W. GrimesA client may also request a different timeout period; 79ea022d16SRodney W. Grimesthe maximum period allowed may be set to 80ea022d16SRodney W. Grimes.Ar timeout 81ea022d16SRodney W. Grimesseconds with the 82ea022d16SRodney W. Grimes.Fl T 83ea022d16SRodney W. Grimesoption. 84ea022d16SRodney W. GrimesThe default limit is 2 hours. 85ea022d16SRodney W. Grimes.It Fl t 86ea022d16SRodney W. GrimesThe inactivity timeout period is set to 87ea022d16SRodney W. Grimes.Ar timeout 88ea022d16SRodney W. Grimesseconds (the default is 15 minutes). 89ea022d16SRodney W. Grimes.El 90ea022d16SRodney W. Grimes.Pp 91ea022d16SRodney W. GrimesThe file 92ea022d16SRodney W. Grimes.Pa /etc/nologin 93ea022d16SRodney W. Grimescan be used to disable ftp access. 94ea022d16SRodney W. GrimesIf the file exists, 95ea022d16SRodney W. Grimes.Nm 96ea022d16SRodney W. Grimesdisplays it and exits. 97ea022d16SRodney W. GrimesIf the file 98ea022d16SRodney W. Grimes.Pa /etc/ftpwelcome 99ea022d16SRodney W. Grimesexists, 100ea022d16SRodney W. Grimes.Nm 101ea022d16SRodney W. Grimesprints it before issuing the 102ea022d16SRodney W. Grimes.Dq ready 103ea022d16SRodney W. Grimesmessage. 104ea022d16SRodney W. GrimesIf the file 105025362a7SGary Palmer.Pa /etc/ftpmotd 106ea022d16SRodney W. Grimesexists, 107ea022d16SRodney W. Grimes.Nm 108ea022d16SRodney W. Grimesprints it after a successful login. 109ea022d16SRodney W. Grimes.Pp 110ea022d16SRodney W. GrimesThe ftp server currently supports the following ftp requests. 111ea022d16SRodney W. GrimesThe case of the requests is ignored. 112ea022d16SRodney W. Grimes.Bl -column "Request" -offset indent 113ea022d16SRodney W. Grimes.It Request Ta "Description" 114ea022d16SRodney W. Grimes.It ABOR Ta "abort previous command" 115ea022d16SRodney W. Grimes.It ACCT Ta "specify account (ignored)" 116ea022d16SRodney W. Grimes.It ALLO Ta "allocate storage (vacuously)" 117ea022d16SRodney W. Grimes.It APPE Ta "append to a file" 118ea022d16SRodney W. Grimes.It CDUP Ta "change to parent of current working directory" 119ea022d16SRodney W. Grimes.It CWD Ta "change working directory" 120ea022d16SRodney W. Grimes.It DELE Ta "delete a file" 121ea022d16SRodney W. Grimes.It HELP Ta "give help information" 122ea022d16SRodney W. Grimes.It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA" 123ea022d16SRodney W. Grimes.It MKD Ta "make a directory" 124ea022d16SRodney W. Grimes.It MDTM Ta "show last modification time of file" 125ea022d16SRodney W. Grimes.It MODE Ta "specify data transfer" Em mode 126ea022d16SRodney W. Grimes.It NLST Ta "give name list of files in directory" 127ea022d16SRodney W. Grimes.It NOOP Ta "do nothing" 128ea022d16SRodney W. Grimes.It PASS Ta "specify password" 129ea022d16SRodney W. Grimes.It PASV Ta "prepare for server-to-server transfer" 130ea022d16SRodney W. Grimes.It PORT Ta "specify data connection port" 131ea022d16SRodney W. Grimes.It PWD Ta "print the current working directory" 132ea022d16SRodney W. Grimes.It QUIT Ta "terminate session" 133ea022d16SRodney W. Grimes.It REST Ta "restart incomplete transfer" 134ea022d16SRodney W. Grimes.It RETR Ta "retrieve a file" 135ea022d16SRodney W. Grimes.It RMD Ta "remove a directory" 136ea022d16SRodney W. Grimes.It RNFR Ta "specify rename-from file name" 137ea022d16SRodney W. Grimes.It RNTO Ta "specify rename-to file name" 138ea022d16SRodney W. Grimes.It SITE Ta "non-standard commands (see next section)" 139ea022d16SRodney W. Grimes.It SIZE Ta "return size of file" 140ea022d16SRodney W. Grimes.It STAT Ta "return status of server" 141ea022d16SRodney W. Grimes.It STOR Ta "store a file" 142ea022d16SRodney W. Grimes.It STOU Ta "store a file with a unique name" 143ea022d16SRodney W. Grimes.It STRU Ta "specify data transfer" Em structure 144ea022d16SRodney W. Grimes.It SYST Ta "show operating system type of server system" 145ea022d16SRodney W. Grimes.It TYPE Ta "specify data transfer" Em type 146ea022d16SRodney W. Grimes.It USER Ta "specify user name" 147ea022d16SRodney W. Grimes.It XCUP Ta "change to parent of current working directory (deprecated)" 148ea022d16SRodney W. Grimes.It XCWD Ta "change working directory (deprecated)" 149ea022d16SRodney W. Grimes.It XMKD Ta "make a directory (deprecated)" 150ea022d16SRodney W. Grimes.It XPWD Ta "print the current working directory (deprecated)" 151ea022d16SRodney W. Grimes.It XRMD Ta "remove a directory (deprecated)" 152ea022d16SRodney W. Grimes.El 153ea022d16SRodney W. Grimes.Pp 154ea022d16SRodney W. GrimesThe following non-standard or 155ea022d16SRodney W. Grimes.Tn UNIX 156ea022d16SRodney W. Grimesspecific commands are supported 157ea022d16SRodney W. Grimesby the 158ea022d16SRodney W. GrimesSITE request. 159ea022d16SRodney W. Grimes.Pp 160ea022d16SRodney W. Grimes.Bl -column Request -offset indent 161ea022d16SRodney W. Grimes.It Sy Request Ta Sy Description 162ea022d16SRodney W. Grimes.It UMASK Ta change umask, e.g. ``SITE UMASK 002'' 163ea022d16SRodney W. Grimes.It IDLE Ta set idle-timer, e.g. ``SITE IDLE 60'' 164ea022d16SRodney W. Grimes.It CHMOD Ta change mode of a file, e.g. ``SITE CHMOD 755 filename'' 165ea022d16SRodney W. Grimes.It HELP Ta give help information. 166ea022d16SRodney W. Grimes.El 167ea022d16SRodney W. Grimes.Pp 168ea022d16SRodney W. GrimesThe remaining ftp requests specified in Internet RFC 959 169ea022d16SRodney W. Grimesare 170ea022d16SRodney W. Grimesrecognized, but not implemented. 171ea022d16SRodney W. GrimesMDTM and SIZE are not specified in RFC 959, but will appear in the 172ea022d16SRodney W. Grimesnext updated FTP RFC. 173ea022d16SRodney W. Grimes.Pp 174ea022d16SRodney W. GrimesThe ftp server will abort an active file transfer only when the 175ea022d16SRodney W. GrimesABOR 176ea022d16SRodney W. Grimescommand is preceded by a Telnet "Interrupt Process" (IP) 177ea022d16SRodney W. Grimessignal and a Telnet "Synch" signal in the command Telnet stream, 178ea022d16SRodney W. Grimesas described in Internet RFC 959. 179ea022d16SRodney W. GrimesIf a 180ea022d16SRodney W. GrimesSTAT 181ea022d16SRodney W. Grimescommand is received during a data transfer, preceded by a Telnet IP 182ea022d16SRodney W. Grimesand Synch, transfer status will be returned. 183ea022d16SRodney W. Grimes.Pp 184ea022d16SRodney W. Grimes.Nm Ftpd 185ea022d16SRodney W. Grimesinterprets file names according to the 186ea022d16SRodney W. Grimes.Dq globbing 187ea022d16SRodney W. Grimesconventions used by 188ea022d16SRodney W. Grimes.Xr csh 1 . 189ea022d16SRodney W. GrimesThis allows users to utilize the metacharacters 190ea022d16SRodney W. Grimes.Dq Li \&*?[]{}~ . 191ea022d16SRodney W. Grimes.Pp 192ea022d16SRodney W. Grimes.Nm Ftpd 193ea022d16SRodney W. Grimesauthenticates users according to three rules. 194ea022d16SRodney W. Grimes.Pp 195ea022d16SRodney W. Grimes.Bl -enum -offset indent 196ea022d16SRodney W. Grimes.It 197ea022d16SRodney W. GrimesThe login name must be in the password data base, 198ea022d16SRodney W. Grimes.Pa /etc/passwd , 199ea022d16SRodney W. Grimesand not have a null password. 200ea022d16SRodney W. GrimesIn this case a password must be provided by the client before any 201ea022d16SRodney W. Grimesfile operations may be performed. 202ea022d16SRodney W. Grimes.It 203ea022d16SRodney W. GrimesThe login name must not appear in the file 204ea022d16SRodney W. Grimes.Pa /etc/ftpusers . 205ea022d16SRodney W. Grimes.It 206ea022d16SRodney W. GrimesThe user must have a standard shell returned by 207ea022d16SRodney W. Grimes.Xr getusershell 3 . 208ea022d16SRodney W. Grimes.It 209ea022d16SRodney W. GrimesIf the user name is 210ea022d16SRodney W. Grimes.Dq anonymous 211ea022d16SRodney W. Grimesor 212ea022d16SRodney W. Grimes.Dq ftp , 213ea022d16SRodney W. Grimesan 214ea022d16SRodney W. Grimesanonymous ftp account must be present in the password 215ea022d16SRodney W. Grimesfile (user 216ea022d16SRodney W. Grimes.Dq ftp ) . 217ea022d16SRodney W. GrimesIn this case the user is allowed 218ea022d16SRodney W. Grimesto log in by specifying any password (by convention an email address for 2193eb568f2SGuido van Rooijthe user should be used as the password). When the 2203eb568f2SGuido van Rooij.Fl S 2213eb568f2SGuido van Rooijoption is set, all transfers are logged as well. 222ea022d16SRodney W. Grimes.El 223ea022d16SRodney W. Grimes.Pp 224ea022d16SRodney W. GrimesIn the last case, 225ea022d16SRodney W. Grimes.Nm ftpd 226ea022d16SRodney W. Grimestakes special measures to restrict the client's access privileges. 227ea022d16SRodney W. GrimesThe server performs a 228ea022d16SRodney W. Grimes.Xr chroot 2 229ea022d16SRodney W. Grimesto the home directory of the 230ea022d16SRodney W. Grimes.Dq ftp 231ea022d16SRodney W. Grimesuser. 232ea022d16SRodney W. GrimesIn order that system security is not breached, it is recommended 233ea022d16SRodney W. Grimesthat the 234ea022d16SRodney W. Grimes.Dq ftp 235ea022d16SRodney W. Grimessubtree be constructed with care, following these rules: 236ea022d16SRodney W. Grimes.Bl -tag -width "~ftp/pub" -offset indent 237ea022d16SRodney W. Grimes.It Pa ~ftp 238ea022d16SRodney W. GrimesMake the home directory owned by 239ea022d16SRodney W. Grimes.Dq root 240ea022d16SRodney W. Grimesand unwritable by anyone. 241ea022d16SRodney W. Grimes.It Pa ~ftp/bin 242ea022d16SRodney W. GrimesMake this directory owned by 243ea022d16SRodney W. Grimes.Dq root 244ea022d16SRodney W. Grimesand unwritable by anyone (mode 555). 245ea022d16SRodney W. GrimesThe program 246ea022d16SRodney W. Grimes.Xr ls 1 247ea022d16SRodney W. Grimesmust be present to support the list command. 248ea022d16SRodney W. GrimesThis program should be mode 111. 249ea022d16SRodney W. Grimes.It Pa ~ftp/etc 250ea022d16SRodney W. GrimesMake this directory owned by 251ea022d16SRodney W. Grimes.Dq root 252ea022d16SRodney W. Grimesand unwritable by anyone (mode 555). 253ea022d16SRodney W. GrimesThe files 254ea022d16SRodney W. Grimes.Xr passwd 5 255ea022d16SRodney W. Grimesand 256ea022d16SRodney W. Grimes.Xr group 5 257ea022d16SRodney W. Grimesmust be present for the 258ea022d16SRodney W. Grimes.Xr ls 259ea022d16SRodney W. Grimescommand to be able to produce owner names rather than numbers. 260ea022d16SRodney W. GrimesThe password field in 261ea022d16SRodney W. Grimes.Xr passwd 262ea022d16SRodney W. Grimesis not used, and should not contain real passwords. 263ea022d16SRodney W. GrimesThe file 2647253b58bSGary Palmer.Pa ftpmotd , 265ea022d16SRodney W. Grimesif present, will be printed after a successful login. 266ea022d16SRodney W. GrimesThese files should be mode 444. 267ea022d16SRodney W. Grimes.It Pa ~ftp/pub 268ea022d16SRodney W. GrimesMake this directory mode 777 and owned by 269ea022d16SRodney W. Grimes.Dq ftp . 270ea022d16SRodney W. GrimesGuests 271ea022d16SRodney W. Grimescan then place files which are to be accessible via the anonymous 272ea022d16SRodney W. Grimesaccount in this directory. 273ea022d16SRodney W. Grimes.El 274ea022d16SRodney W. Grimes.Sh FILES 275ea022d16SRodney W. Grimes.Bl -tag -width /etc/ftpwelcome -compact 276ea022d16SRodney W. Grimes.It Pa /etc/ftpusers 277ea022d16SRodney W. GrimesList of unwelcome/restricted users. 278ea022d16SRodney W. Grimes.It Pa /etc/ftpwelcome 279ea022d16SRodney W. GrimesWelcome notice. 2807253b58bSGary Palmer.It Pa /etc/ftpmotd 281ea022d16SRodney W. GrimesWelcome notice after login. 282ea022d16SRodney W. Grimes.It Pa /etc/nologin 283ea022d16SRodney W. GrimesDisplayed and access refused. 2843eb568f2SGuido van Rooij.It Pa /var/log/ftpd 2853eb568f2SGuido van RooijLog file for anonymous transfers. 286ea022d16SRodney W. Grimes.El 287ea022d16SRodney W. Grimes.Sh SEE ALSO 288ea022d16SRodney W. Grimes.Xr ftp 1 , 289ea022d16SRodney W. Grimes.Xr getusershell 3 , 290ea022d16SRodney W. Grimes.Xr syslogd 8 291ea022d16SRodney W. Grimes.Sh BUGS 292ea022d16SRodney W. GrimesThe server must run as the super-user 293ea022d16SRodney W. Grimesto create sockets with privileged port numbers. It maintains 294ea022d16SRodney W. Grimesan effective user id of the logged in user, reverting to 295ea022d16SRodney W. Grimesthe super-user only when binding addresses to sockets. The 296ea022d16SRodney W. Grimespossible security holes have been extensively 297ea022d16SRodney W. Grimesscrutinized, but are possibly incomplete. 298ea022d16SRodney W. Grimes.Sh HISTORY 299ea022d16SRodney W. GrimesThe 300ea022d16SRodney W. Grimes.Nm 301ea022d16SRodney W. Grimescommand appeared in 302ea022d16SRodney W. Grimes.Bx 4.2 . 303