]> git.saurik.com Git - apple/network_cmds.git/blob - ftpd.tproj/ftpd.8
eb93c38e4b0536de9582690c348886586fc4e8a3
[apple/network_cmds.git] / ftpd.tproj / ftpd.8
1 .\" Copyright (c) 1985, 1988, 1991, 1993
2 .\" The Regents of the University of California. All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
19 .\"
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
30 .\" SUCH DAMAGE.
31 .\"
32 .\" @(#)ftpd.8 8.3 (Berkeley) 6/1/94
33 .\"
34 .Dd June 1, 1994
35 .Dt FTPD 8
36 .Os BSD 4.2
37 .Sh NAME
38 .Nm ftpd
39 .Nd
40 Internet File Transfer Protocol server
41 .Sh SYNOPSIS
42 .Nm ftpd
43 .Op Fl dl
44 .Op Fl T Ar maxtimeout
45 .Op Fl t Ar timeout
46 .Sh DESCRIPTION
47 .Nm Ftpd
48 is the
49 Internet File Transfer Protocol
50 server process. The server uses the
51 .Tn TCP
52 protocol
53 and listens at the port specified in the
54 .Dq ftp
55 service specification; see
56 .Xr services 5 .
57 .Pp
58 Available options:
59 .Bl -tag -width Ds
60 .It Fl d
61 Debugging information is written to the syslog using LOG_FTP.
62 .It Fl l
63 Each successful and failed
64 .Xr ftp 1
65 session is logged using syslog with a facility of LOG_FTP.
66 If this option is specified twice, the retrieve (get), store (put), append,
67 delete, make directory, remove directory and rename operations and
68 their filename arguments are also logged.
69 .It Fl T
70 A client may also request a different timeout period;
71 the maximum period allowed may be set to
72 .Ar timeout
73 seconds with the
74 .Fl T
75 option.
76 The default limit is 2 hours.
77 .It Fl t
78 The inactivity timeout period is set to
79 .Ar timeout
80 seconds (the default is 15 minutes).
81 .El
82 .Pp
83 The file
84 .Pa /etc/nologin
85 can be used to disable ftp access.
86 If the file exists,
87 .Nm
88 displays it and exits.
89 If the file
90 .Pa /etc/ftpwelcome
91 exists,
92 .Nm
93 prints it before issuing the
94 .Dq ready
95 message.
96 If the file
97 .Pa /etc/motd
98 exists,
99 .Nm
100 prints it after a successful login.
101 .Pp
102 The ftp server currently supports the following ftp requests.
103 The case of the requests is ignored.
104 .Bl -column "Request" -offset indent
105 .It Request Ta "Description"
106 .It ABOR Ta "abort previous command"
107 .It ACCT Ta "specify account (ignored)"
108 .It ALLO Ta "allocate storage (vacuously)"
109 .It APPE Ta "append to a file"
110 .It CDUP Ta "change to parent of current working directory"
111 .It CWD Ta "change working directory"
112 .It DELE Ta "delete a file"
113 .It HELP Ta "give help information"
114 .It LIST Ta "give list files in a directory" Pq Dq Li "ls -lgA"
115 .It MKD Ta "make a directory"
116 .It MDTM Ta "show last modification time of file"
117 .It MODE Ta "specify data transfer" Em mode
118 .It NLST Ta "give name list of files in directory"
119 .It NOOP Ta "do nothing"
120 .It PASS Ta "specify password"
121 .It PASV Ta "prepare for server-to-server transfer"
122 .It PORT Ta "specify data connection port"
123 .It PWD Ta "print the current working directory"
124 .It QUIT Ta "terminate session"
125 .It REST Ta "restart incomplete transfer"
126 .It RETR Ta "retrieve a file"
127 .It RMD Ta "remove a directory"
128 .It RNFR Ta "specify rename-from file name"
129 .It RNTO Ta "specify rename-to file name"
130 .It SITE Ta "non-standard commands (see next section)"
131 .It SIZE Ta "return size of file"
132 .It STAT Ta "return status of server"
133 .It STOR Ta "store a file"
134 .It STOU Ta "store a file with a unique name"
135 .It STRU Ta "specify data transfer" Em structure
136 .It SYST Ta "show operating system type of server system"
137 .It TYPE Ta "specify data transfer" Em type
138 .It USER Ta "specify user name"
139 .It XCUP Ta "change to parent of current working directory (deprecated)"
140 .It XCWD Ta "change working directory (deprecated)"
141 .It XMKD Ta "make a directory (deprecated)"
142 .It XPWD Ta "print the current working directory (deprecated)"
143 .It XRMD Ta "remove a directory (deprecated)"
144 .El
145 .Pp
146 The following non-standard or
147 .Tn UNIX
148 specific commands are supported
149 by the
150 SITE request.
151 .Pp
152 .Bl -column Request -offset indent
153 .It Sy Request Ta Sy Description
154 .It UMASK Ta change umask, e.g. ``SITE UMASK 002''
155 .It IDLE Ta set idle-timer, e.g. ``SITE IDLE 60''
156 .It CHMOD Ta change mode of a file, e.g. ``SITE CHMOD 755 filename''
157 .It HELP Ta give help information.
158 .El
159 .Pp
160 The remaining ftp requests specified in Internet RFC 959
161 are
162 recognized, but not implemented.
163 MDTM and SIZE are not specified in RFC 959, but will appear in the
164 next updated FTP RFC.
165 .Pp
166 The ftp server will abort an active file transfer only when the
167 ABOR
168 command is preceded by a Telnet "Interrupt Process" (IP)
169 signal and a Telnet "Synch" signal in the command Telnet stream,
170 as described in Internet RFC 959.
171 If a
172 STAT
173 command is received during a data transfer, preceded by a Telnet IP
174 and Synch, transfer status will be returned.
175 .Pp
176 .Nm Ftpd
177 interprets file names according to the
178 .Dq globbing
179 conventions used by
180 .Xr csh 1 .
181 This allows users to utilize the metacharacters
182 .Dq Li \&*?[]{}~ .
183 .Pp
184 .Nm Ftpd
185 authenticates users according to three rules.
186 .Pp
187 .Bl -enum -offset indent
188 .It
189 The login name must be in the password data base,
190 .Pa /etc/passwd ,
191 and not have a null password.
192 In this case a password must be provided by the client before any
193 file operations may be performed.
194 .It
195 The login name must not appear in the file
196 .Pa /etc/ftpusers .
197 .It
198 The user must have a standard shell returned by
199 .Xr getusershell 3 .
200 .It
201 If the user name is
202 .Dq anonymous
203 or
204 .Dq ftp ,
205 an
206 anonymous ftp account must be present in the password
207 file (user
208 .Dq ftp ) .
209 In this case the user is allowed
210 to log in by specifying any password (by convention an email address for
211 the user should be used as the password).
212 .El
213 .Pp
214 In the last case,
215 .Nm ftpd
216 takes special measures to restrict the client's access privileges.
217 The server performs a
218 .Xr chroot 2
219 to the home directory of the
220 .Dq ftp
221 user.
222 In order that system security is not breached, it is recommended
223 that the
224 .Dq ftp
225 subtree be constructed with care, following these rules:
226 .Bl -tag -width "~ftp/pub" -offset indent
227 .It Pa ~ftp
228 Make the home directory owned by
229 .Dq root
230 and unwritable by anyone.
231 .ne 1i
232 .It Pa ~ftp/bin
233 Make this directory owned by
234 .Dq root
235 and unwritable by anyone (mode 555).
236 The program
237 .Xr ls 1
238 must be present to support the list command.
239 This program should be mode 111.
240 .It Pa ~ftp/etc
241 Make this directory owned by
242 .Dq root
243 and unwritable by anyone (mode 555).
244 The files
245 .Xr passwd 5
246 and
247 .Xr group 5
248 must be present for the
249 .Xr ls
250 command to be able to produce owner names rather than numbers.
251 The password field in
252 .Xr passwd
253 is not used, and should not contain real passwords.
254 The file
255 .Pa motd ,
256 if present, will be printed after a successful login.
257 These files should be mode 444.
258 .It Pa ~ftp/pub
259 Make this directory mode 777 and owned by
260 .Dq ftp .
261 Guests
262 can then place files which are to be accessible via the anonymous
263 account in this directory.
264 .El
265 .Sh FILES
266 .Bl -tag -width /etc/ftpwelcome -compact
267 .It Pa /etc/ftpusers
268 List of unwelcome/restricted users.
269 .It Pa /etc/ftpwelcome
270 Welcome notice.
271 .It Pa /etc/motd
272 Welcome notice after login.
273 .It Pa /etc/nologin
274 Displayed and access refused.
275 .El
276 .Sh SEE ALSO
277 .Xr ftp 1 ,
278 .Xr getusershell 3 ,
279 .Xr syslogd 8
280 .Sh BUGS
281 The server must run as the super-user
282 to create sockets with privileged port numbers. It maintains
283 an effective user id of the logged in user, reverting to
284 the super-user only when binding addresses to sockets. The
285 possible security holes have been extensively
286 scrutinized, but are possibly incomplete.
287 .Sh HISTORY
288 The
289 .Nm
290 command appeared in
291 .Bx 4.2 .