?? ftpd_8.txt
字號:
.\" $OpenBSD: ftpd.8,v 1.65 2007/05/31 19:19:39 jmc Exp $
.\" $NetBSD: ftpd.8,v 1.8 1996/01/14 20:55:23 thorpej Exp $
.\"
.\" Copyright (c) 1985, 1988, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)ftpd.8 8.2 (Berkeley) 4/19/94
.\"
.Dd $Mdocdate$
.Dt FTPD 8
.Os
.Sh NAME
.Nm ftpd
.Nd Internet File Transfer Protocol server
.Sh SYNOPSIS
.Nm ftpd
.Op Fl 46ADdlMnPSU
.Op Fl T Ar maxtimeout
.Op Fl t Ar timeout
.Op Fl u Ar mask
.Sh DESCRIPTION
.Nm
is the Internet File Transfer Protocol server process.
The server uses the
.Tn TCP
protocol
and listens at the port specified in the
.Dq ftp
service specification; see
.Xr services 5 .
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl 4
When
.Fl D
is specified, forces
.Nm
to use IPv4 addresses only.
.It Fl 6
When
.Fl D
is specified, forces
.Nm
to use IPv6 addresses only.
.It Fl A
Permit only anonymous FTP connections
(unless the
.Fl n
option is specified),
accounts listed in
.Pa /etc/ftpchroot
or users in a login class with the
.Dq ftp-chroot
variable set (see below).
Other connection attempts are refused.
.It Fl D
With this option set,
.Nm
will detach and become a daemon, accepting connections on the FTP port and
forking child processes to handle them.
This has lower overhead than starting
.Nm
from
.Xr inetd 8
and is thus useful on busy servers to reduce load.
.It Fl d
Debugging information is written to the syslog using
.Dv LOG_FTP .
.It Fl l
Each successful and failed
FTP session is logged using syslog with a facility of
.Dv LOG_FTP .
If this option is specified twice, the retrieve (get), store (put), append,
delete, make directory, remove directory and rename operations and
their filename arguments are also logged.
.It Fl M
Enables multihomed mode.
Instead of simply using
.Pa ~ftp
for anonymous transfers, a directory matching the fully qualified name of
the IP number the client connected to, and located inside
.Pa ~ftp ,
is used instead.
.It Fl n
Do not permit anonymous FTP logins.
Normally they are permitted.
.It Fl P
Permit illegal port numbers or addresses for PORT command initiated connects.
By default
.Nm
violates the RFC and thus constrains the PORT command to non-reserved ports
and requires it use the same source address as the connection came from.
This prevents the "FTP bounce attack" against services on both the local
machine and other local machines.
.It Fl S
With this option set,
.Nm
logs all anonymous downloads to the file
.Pa /var/log/ftpd
when this file exists.
.It Fl T Ar maxtimeout
A client may also request a different timeout period;
the maximum period allowed may be set to
.Ar maxtimeout
seconds with the
.Fl T
option.
The default limit is 2 hours.
.It Fl t Ar timeout
The inactivity timeout period is set to
.Ar timeout
seconds (the default is 15 minutes).
.It Fl U
Each concurrent
FTP session is logged to the file
.Pa /var/run/utmp ,
making them visible to commands such as
.Xr who 1 .
.It Fl u Ar mask
Force the umask to
.Ar mask ,
instead of the default specified in
.Pa /etc/login.conf
(usually 022).
Also disallows chmod.
.El
.Pp
The file
.Pa /etc/nologin
can be used to disable FTP access.
If the file exists,
.Nm
displays it and exits.
Note: this method will disable
.Em all
non-root logins; see
.Xr login 1
for further details.
If the file
.Pa /etc/ftpwelcome
exists,
.Nm
prints it before issuing the
.Dq ready
message.
If the welcome file exists
.Pa ( /etc/motd
by default),
.Nm
prints it after a successful login.
If the file
.Pa .message
exists in a directory,
.Nm
prints it when that directory is entered.
.Pp
The FTP server currently supports the following FTP requests.
The case of the requests is ignored.
.Bl -column "Request" -offset indent
.It Sy Request Ta Sy Description
.It ABOR Ta "abort previous command"
.It ACCT Ta "specify account (not implemented)"
.It ALLO Ta "allocate storage (vacuously)"
.It APPE Ta "append to a file"
.It CDUP Ta "change to parent of current working directory"
.It CWD Ta "change working directory"
.It DELE Ta "delete a file"
.It EPRT Ta "specify data connection port"
.It EPSV Ta "prepare for server-to-server transfer"
.It HELP Ta "give help information"
.It LIST Ta "give list of files in a directory" Pq Li "ls -lgA"
.It LPRT Ta "specify data connection port"
.It LPSV Ta "prepare for server-to-server transfer"
.It MDTM Ta "show last modification time of file"
.It MKD Ta "make a directory"
.It MODE Ta "specify data transfer" Em mode
.It NLST Ta "give name list of files in directory"
.It NOOP Ta "do nothing"
.It PASS Ta "specify password"
.It PASV Ta "prepare for server-to-server transfer"
.It PORT Ta "specify data connection port"
.It PWD Ta "print the current working directory"
.It QUIT Ta "terminate session"
.It REIN Ta "reinitialize (not implemented)"
.It REST Ta "restart incomplete transfer"
.It RETR Ta "retrieve a file"
.It RMD Ta "remove a directory"
.It RNFR Ta "specify rename-from file name"
.It RNTO Ta "specify rename-to file name"
.It SITE Ta "non-standard commands (see next section)"
.It SIZE Ta "return size of file"
.It SMNT Ta "structure mount (not implemented)"
.It STAT Ta "return status of server"
.It STOR Ta "store a file"
.It STOU Ta "store a file with a unique name"
.It STRU Ta "specify data transfer" Em structure
.It SYST Ta "show operating system type of server system"
.It TYPE Ta "specify data transfer" Em type
.It USER Ta "specify user name; not valid after login"
.It XCUP Ta "change to parent of current working directory (deprec.)"
.It XCWD Ta "change working directory (deprecated)"
.It XMKD Ta "make a directory (deprecated)"
.It XPWD Ta "print the current working directory (deprecated)"
.It XRMD Ta "remove a directory (deprecated)"
.El
.Pp
The following non-standard or
.Tn UNIX
specific commands are supported
by the
SITE request:
.Bl -column Request -offset indent
.It Sy Request Ta Sy Description
.It CHMOD Ta "change mode of a file, e.g., SITE CHMOD 755 filename"
.It HELP Ta "give help information"
.It IDLE Ta "set idle-timer, e.g., SITE IDLE 60"
.It UMASK Ta "change umask, e.g., SITE UMASK 002"
.El
.Pp
The remaining FTP requests specified in Internet RFC 959 are recognized,
but not implemented.
MDTM and SIZE are not specified in RFC 959,
but will appear in the next updated FTP RFC.
.Pp
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.
If a
STAT
command is received during a data transfer, preceded by a Telnet IP
and Synch, transfer status will be returned.
.Pp
.Nm
interprets file names according to the
.Dq globbing
conventions used by
.Xr csh 1 .
This allows users to utilize the metacharacters
.Dq Li \&*?[]{}~ .
.Pp
.Nm
authenticates users by using the service and type of
.Ar ftp ,
as defined in the
.Pa /etc/login.conf
file (see
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -