メインコンテンツまでスキップ

FTP 応答

IV.B FTP 応答​

サーバは、FTP コマンドに対する FTP 応答を TELNET 接続を介してユーザへ送る。FTP 応答は、確認応答または完了コード(エラーを含む)を構成する。FTP サーバの応答は、人間またはプログラムが解釈できるように書式化される。応答は、先頭の 3 桁の数字コード、空白、そしてそのコードの文章による説明からなる。数字コードはグループごとに割り当てられ、プログラムによる解釈を容易にするため、RJE プロトコルなど他のプロトコルと整合する形で付与される。コードの 3 桁は次のように解釈される。

a) 1 桁目は、以下に示す応答の種類を指定する。

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) 2 桁目は、応答が属する一般的なカテゴリを指定する。

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 で終わる)は、完全な応答メッセージであることを意図している。応答のテキストを次の行に続ける必要がある場合、それらの継続応答は 3 つの空白という特別な応答コードを含む。応答のテキストは人間のユーザ向けであることに注意されたい。プログラム向けなのは、応答コードと、場合によってはテキストの最初の行のみである。

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.