FTP 应答
IV.B FTP 应答
服务器针对 FTP 命令,经由 TELNET 连接向用户发送 FTP 应答。FTP 应答构成确认或完成码(包括错误)。FTP 服务器应答的格式便于人或程序解释。应答由开头的三位数字代码、一个空格以及对该代码的文字说明组成。数字代码按组分配,便于程序解释,其方式与 RJE 协议等其他协议一致。代码的三位数字解释如下:
a) 第一位数字指定响应的类型,如下所示:
000 These replies are purely informative and constitute
neither a positive nor a negative acknowledgement.
1xx informative replies to status inrequiries. These constitute
a positive acknowledgment to the status command.
2xx Positive acknowledgment of previous command or other
successful action.
3xx Incomplete information. Activity cannot proceed without
further specification and input.
4xx Unsuccessful reply. The request is correctly specified
but the server is unsuccessful in corretly fulfilling
it.
5xx Incorrect or illegal command. The command or its
parameters were invalid or incomplete from a syntactic
viewpoint, or the command its inconsistent with a previous
command. The command in question has been completely
ignored.
6xx - 9xx Reserved for future expansion.
b) 第二位数字指定响应所涉及的一般类别:
x00-x29 General purpose replies, not assignable to other
categories.
x30 Primary access. Informative replies to the "log-on"
attempt.
x40 Secondary access. The primary server is commenting on its
ability to access a secondary service.
x5x FTP results.
x6x RJE resutls.
x7x-x9x Reserved for future expansion.
c) 最后一位数字指定具体的消息类型。由于代码是为自动处理进程解释而设计的,因此并不需要为应答的每种变体都分配唯一的编号,只有应答的基本含义才需要唯一编号。应答的文本可以向人类用户说明该应答的具体原因。
服务器发出的每一行 TELNET 行(以 CRLF 结尾)都应是一条完整的应答消息。如果有必要将应答文本延续到后续行,则这些延续应答包含由三个空格构成的特殊应答码。应注意,应答的文本是供人类用户阅读的。只有应答码,以及在某些情况下的第一行文本,是供程序使用的。
已分配的与 FTP 相关的应答码如下:
000 General information message (site, time of day, etc.)
030 Server availibility information.
050 FTP commentary or user information.
100 System status reply.
150 File status reply.
151 Directory listing reply.
200 Last command received correctly.
201 An ABORT has terminated activity, as requested.
202 Abort request ignored, no activity in progress.
230 User is "logged in". may proceed.
231 User is "logged out". Service terminated.
232 Logout command noted, will complete when transfer done.
250 FTP file transfer started correctly.
251 FTP Restart-marker reply
Text is: MARK yyyy = mmmm
where yyyy is user's data stream marker (yours)
and mmmm is server's equivalent marker (mine)
(Note the spaces between the markers and '=').
252 FTP transfer completed correctly.
253 Rename completed.
254 Delete completed.
255 FTP server data socket reply
Text is: SOCK nnnn
where nnnn is decimal integer representing
the server socket for data connection.
300 Connection greeting message, awaiting input.
301 Current command incomplete (no CRLF for long time).
330 Enter password (may be sent with hide-your-input).
400 This service not implemented.
401 This service not accepting users now, goodbye.
430 Log-on time or tries exceeded, goodbye.
431 Log-on unsuccessful. User and/or password invalid.
432 User not valid for this service.
434 Log-out forced by operator action. Phone site.
435 Log-out forced by system problem.
436 Service shutting down, goodbye.
450 FTP: File not found.
451 FTP: File access denied to you.
452 FTP: File transfer incomplete, data connection closed.
453 FTP: File transfer incomplete, insufficient storage space.
500 Last command line completely unrecognized.
501 Syntax of last command in incorrect.
502 Last command incomplete, parameters missing.
503 Last command invalid (ignored), illegal parameter combination.
504 Last command invalid, action not possible at this time.
505 Last command conflicts illegally with previous command(s).
506 Requested action not implemented by the server.