grab wtmp path from utmp.h
[unix-history] / usr / src / libexec / ftpd / ftpd.8
CommitLineData
fdb56acd 1.\" Copyright (c) 1985, 1988 The Regents of the University of California.
43c671de 2.\" All rights reserved.
917eb9fe 3.\"
43c671de
KB
4.\" Redistribution and use in source and binary forms are permitted
5.\" provided that the above copyright notice and this paragraph are
6.\" duplicated in all such forms and that any documentation,
7.\" advertising materials, and other materials related to such
8.\" distribution and use acknowledge that the software was developed
9.\" by the University of California, Berkeley. The name of the
10.\" University may not be used to endorse or promote products derived
11.\" from this software without specific prior written permission.
12.\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
13.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
14.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
917eb9fe 15.\"
8ba00015 16.\" @(#)ftpd.8 6.7.1.1 (Berkeley) %G%
43c671de 17.\"
fdb56acd 18.TH FTPD 8 "February 23, 1989"
917eb9fe
KM
19.UC 5
20.SH NAME
21ftpd \- DARPA Internet File Transfer Protocol server
22.SH SYNOPSIS
23.B /etc/ftpd
24[
25.B \-d
26] [
27.B \-l
28] [
29.BR \-t timeout
fdb56acd
MK
30] [
31.BR \-T maxtimeout
917eb9fe
KM
32]
33.SH DESCRIPTION
34.I Ftpd
fdb56acd 35is the DARPA Internet File Transfer Protocol
917eb9fe
KM
36server process. The server uses the TCP protocol
37and listens at the port specified in the ``ftp''
38service specification; see
39.IR services (5).
40.PP
41If the
42.B \-d
43option is specified,
2c32d7db 44debugging information is written to the syslog.
917eb9fe
KM
45.PP
46If the
47.B \-l
48option is specified,
2c32d7db 49each ftp session is logged in the syslog.
917eb9fe
KM
50.PP
51The ftp server
2c32d7db 52will timeout an inactive session after 15 minutes.
917eb9fe
KM
53If the
54.B \-t
55option is specified,
56the inactivity timeout period will be set to
fdb56acd
MK
57.I timeout
58seconds.
59A client may also request a different timeout period;
60the maximum period allowed may be set to
61.I timeout
62seconds with the
63.B \-T
64option.
65The default limit is 2 hours.
917eb9fe
KM
66.PP
67The ftp server currently supports the following ftp
fdb56acd 68requests; case is not distinguished.
917eb9fe
KM
69.PP
70.nf
71.ta \w'Request 'u
72\fBRequest Description\fP
1bd029de 73ABOR abort previous command
917eb9fe
KM
74ACCT specify account (ignored)
75ALLO allocate storage (vacuously)
76APPE append to a file
1bd029de 77CDUP change to parent of current working directory
917eb9fe
KM
78CWD change working directory
79DELE delete a file
80HELP give help information
fdb56acd 81LIST give list files in a directory (``ls -lgA'')
1bd029de 82MKD make a directory
fdb56acd 83MDTM show last modification time of file
917eb9fe 84MODE specify data transfer \fImode\fP
fdb56acd 85NLST give name list of files in directory
917eb9fe
KM
86NOOP do nothing
87PASS specify password
1bd029de 88PASV prepare for server-to-server transfer
917eb9fe 89PORT specify data connection port
1bd029de 90PWD print the current working directory
917eb9fe
KM
91QUIT terminate session
92RETR retrieve a file
1bd029de 93RMD remove a directory
917eb9fe
KM
94RNFR specify rename-from file name
95RNTO specify rename-to file name
fdb56acd
MK
96SITE non-standard commands (see next section)
97SIZE return size of file
98STAT return status of server
917eb9fe 99STOR store a file
1bd029de 100STOU store a file with a unique name
917eb9fe 101STRU specify data transfer \fIstructure\fP
843d1a1c 102SYST show operating system type of server system
917eb9fe
KM
103TYPE specify data transfer \fItype\fP
104USER specify user name
fdb56acd
MK
105XCUP change to parent of current working directory (deprecated)
106XCWD change working directory (deprecated)
107XMKD make a directory (deprecated)
108XPWD print the current working directory (deprecated)
109XRMD remove a directory (deprecated)
110.fi
111.PP
112The following non-standard or UNIX specific commands are supported
113by the SITE request.
114.PP
115.nf
116.ta \w'Request 'u
117\fBRequest Description\fP
118UMASK change umask. \fIE.g.\fP SITE UMASK 002
119IDLE set idle-timer. \fIE.g.\fP SITE IDLE 60
120CHMOD change mode of a file. \fIE.g.\fP SITE CHMOD 755 filename
121HELP give help information. \fIE.g.\fP SITE HELP
917eb9fe
KM
122.fi
123.PP
1bd029de 124The remaining ftp requests specified in Internet RFC 959 are
917eb9fe 125recognized, but not implemented.
fdb56acd
MK
126MDTM and SIZE are not specified in
127RFC 959, but will appear in the next updated FTP RFC.
917eb9fe 128.PP
1bd029de
GM
129The ftp server will abort an active file transfer only when the
130ABOR command is preceded by a Telnet "Interrupt Process" (IP)
131signal and a Telnet "Synch" signal in the command Telnet stream,
132as described in Internet RFC 959.
fdb56acd
MK
133If a STAT command is received during a data transfer, preceded by a Telnet IP
134and Synch, transfer status will be returned.
1bd029de 135.PP
917eb9fe
KM
136.I Ftpd
137interprets file names according to the ``globbing''
138conventions used by
139.IR csh (1).
140This allows users to utilize the metacharacters ``*?[]{}~''.
141.PP
142.I Ftpd
143authenticates users according to three rules.
144.IP 1)
145The user name must be in the password data base,
146.IR /etc/passwd ,
147and not have a null password. In this case a password
148must be provided by the client before any file operations
149may be performed.
150.IP 2)
151The user name must not appear in the file
152.IR /etc/ftpusers .
153.IP 3)
06e77c11
KM
154The user must have a standard shell returned by
155.IR getusershell (3).
156.IP 4)
917eb9fe
KM
157If the user name is ``anonymous'' or ``ftp'', an
158anonymous ftp account must be present in the password
159file (user ``ftp''). In this case the user is allowed
160to log in by specifying any password (by convention this
161is given as the client host's name).
162.PP
163In the last case,
164.I ftpd
165takes special measures to restrict the client's access privileges.
166The server performs a
167.IR chroot (2)
168command to the home directory of the ``ftp'' user.
169In order that system security is not breached, it is recommended
170that the ``ftp'' subtree be constructed with care; the following
171rules are recommended.
172.IP ~ftp)
173Make the home directory owned by ``ftp'' and unwritable by anyone.
174.IP ~ftp/bin)
175Make this directory owned by the super-user and unwritable by
176anyone. The program
177.IR ls (1)
fdb56acd 178must be present to support the list command. This
917eb9fe
KM
179program should have mode 111.
180.IP ~ftp/etc)
181Make this directory owned by the super-user and unwritable by
182anyone. The files
183.IR passwd (5)
184and
185.IR group (5)
186must be present for the
187.I ls
fdb56acd
MK
188command to be able to produce owner names rather than numbers.
189The password field in
190.I passwd
191is not used, and should not contain real encrypted passwords.
192These files should be mode 444.
917eb9fe
KM
193.IP ~ftp/pub)
194Make this directory mode 777 and owned by ``ftp''. Users
195should then place files which are to be accessible via the
196anonymous account in this directory.
197.SH "SEE ALSO"
43c671de 198ftp(1), getusershell(3), syslogd(8)
917eb9fe 199.SH BUGS
917eb9fe
KM
200The anonymous account is inherently dangerous and should
201avoided when possible.
202.PP
203The server must run as the super-user
204to create sockets with privileged port numbers. It maintains
205an effective user id of the logged in user, reverting to
206the super-user only when binding addresses to sockets. The
207possible security holes have been extensively
208scrutinized, but are possibly incomplete.