http://en.wikipedia.org/wiki/List_of_FTP_server_return_codes
Below is a list of all known return codes that may be issued by an FTP server.
Code | Explanation |
---|---|
100 Series | The requested action is being initiated, expect another reply before proceeding with a new command. |
110 | Restart marker replay . In this case, the text is exact and not left to the particular implementation; it must read: MARK yyyy = mmmm where yyyy is User-process data stream marker, and mmmm server's equivalent marker (note the spaces between markers and "="). |
120 | Service ready in nnn minutes. |
125 | Data connection already open; transfer starting. |
150 | File status okay; about to open data connection. |
200 Series | The requested action has been successfully completed. |
202 | Command not implemented, superfluous at this site. |
211 | System status, or system help reply. |
212 | Directory status. |
213 | File status. |
214 | Help message.On how to use the server or the meaning of a particular non-standard command. This reply is useful only to the human user. |
215 | NAME system type. Where NAME is an official system name from the registry kept by IANA. |
220 | Service ready for new user. |
221 | Service closing control connection. |
225 | Data connection open; no transfer in progress. |
226 | Closing data connection. Requested file action successful (for example, file transfer or file abort). |
227 | Entering Passive Mode (h1,h2,h3,h4,p1,p2). |
228 | Entering Long Passive Mode (long address, port). |
229 | Entering Extended Passive Mode (|||port|). |
230 | User logged in, proceed. Logged out if appropriate. |
231 | User logged out; service terminated. |
232 | Logout command noted, will complete when transfer done. |
250 | Requested file action okay, completed. |
257 | "PATHNAME" created. |
300 Series | The command has been accepted, but the requested action is on hold, pending receipt of further information. |
331 | User name okay, need password. |
332 | Need account for login. |
350 | Requested file action pending further information |
400 Series | The command was not accepted and the requested action did not take place, but the error condition is temporary and the action may be requested again. |
421 | Service not available, closing control connection. This may be a reply to any command if the service knows it must shut down. |
425 | Can't open data connection. |
426 | Connection closed; transfer aborted. |
430 | Invalid username or password |
434 | Requested host unavailable. |
450 | Requested file action not taken. |
451 | Requested action aborted. Local error in processing. |
452 | Requested action not taken. Insufficient storage space in system.File unavailable (e.g., file busy). |
500 Series | Syntax error, command unrecognized and the requested action did not take place. This may include errors such as command line too long. |
501 | Syntax error in parameters or arguments. |
502 | Command not implemented. |
503 | Bad sequence of commands. |
504 | Command not implemented for that parameter. |
530 | Not logged in. |
532 | Need account for storing files. |
550 | Requested action not taken. File unavailable (e.g., file not found, no access). |
551 | Requested action aborted. Page type unknown. |
552 | Requested file action aborted. Exceeded storage allocation (for current directory or dataset). |
553 | Requested action not taken. File name not allowed. |
600 Series | Replies regarding confidentiality and integrity |
631 | Integrity protected reply. |
632 | Confidentiality and integrity protected reply. |
633 | Confidentiality protected reply. |
10000 Series | Common Winsock Error Codes |
10054 | Connection reset by peer. The connection was forcibly closed by the remote host. |
10060 | Cannot connect to remote server. |
10061 | Cannot connect to remote server. The connection is actively refused by the server. |
10066 | Directory not empty. |
10068 | Too many users, server is full. |
http://en.wikipedia.org/wiki/List_of_FTP_commands
List of FTP commands
From Wikipedia, the free encyclopedia
Below is a list of FTP commands that may be sent to an FTP server, including all commands that are standardized in RFC 959 by the IETF. All commands below are RFC 959 based unless stated otherwise. Note that most command-line FTP clients present their own set of commands to users. For example, GET is the common user command to download a file instead of the raw command RETR.
Command | RFC | Description |
---|---|---|
ABOR | Abort an active file transfer. | |
ACCT | Account information. | |
ADAT | RFC 2228 | Authentication/Security Data |
ALLO | Allocate sufficient disk space to receive a file. | |
APPE | Append. | |
AUTH | RFC 2228 | Authentication/Security Mechanism |
CCC | RFC 2228 | Clear Command Channel |
CDUP | Change to Parent Directory. | |
CONF | RFC 2228 | Confidentiality Protection Command |
CWD | Change working directory. | |
DELE | Delete file. | |
ENC | RFC 2228 | Privacy Protected Channel |
EPRT | RFC 2428 | Specifies an extended address and port to which the server should connect. |
EPSV | RFC 2428 | Enter extended passive mode. |
FEAT | RFC 2389 | Get the feature list implemented by the server. |
HELP | Returns usage documentation on a command if specified, else a general help document is returned. | |
LANG | RFC 2640 | Language Negotiation |
LIST | Returns information of a file or directory if specified, else information of the current working directory is returned. | |
LPRT | RFC 1639 | Specifies a long address and port to which the server should connect. |
LPSV | RFC 1639 | Enter long passive mode. |
MDTM | RFC 3659 | Return the last-modified time of a specified file. |
MIC | RFC 2228 | Integrity Protected Command |
MKD | Make directory. | |
MLSD | RFC 3659 | Lists the contents of a directory if a directory is named. |
MLST | RFC 3659 | Provides data about exactly the object named on its command line, and no others. |
MODE | Sets the transfer mode (Stream, Block, or Compressed). | |
NLST | Returns a list of file names in a specified directory. | |
NOOP | No operation (dummy packet; used mostly on keepalives). | |
OPTS | RFC 2389 | Select options for a feature. |
PASS | Authentication password. | |
PASV | Enter passive mode. | |
PBSZ | RFC 2228 | Protection Buffer Size |
PORT | Specifies an address and port to which the server should connect. | |
PROT | RFC 2228 | Data Channel Protection Level. |
PWD | Print working directory. Returns the current directory of the host. | |
QUIT | Disconnect. | |
REIN | Re initializes the connection. | |
REST | Restart transfer from the specified point. | |
RETR | Transfer a copy of the file | |
RMD | Remove a directory. | |
RNFR | Rename from. | |
RNTO | Rename to. | |
SITE | Sends site specific commands to remote server. | |
SIZE | RFC 3659 | Return the size of a file. |
SMNT | Mount file structure. | |
STAT | Returns the current status. | |
STOR | Accept the data and to store the data as a file at the server site | |
STOU | Store file uniquely. | |
STRU | Set file transfer structure. | |
SYST | Return system type. | |
TYPE | Sets the transfer mode (ASCII/Binary). | |
USER | Authentication username. | |
XCUP | RFC 775 | Change to the parent of the current working directory |
XMKD | RFC 775 | Make a directory |
XPWD | RFC 775 | Print the current working directory |
XRCP | RFC 743 | |
XRMD | RFC 775 | Remove the directory |
XRSQ | RFC 743 | |
XSEM | RFC 737 | Send, mail if cannot |
XSEN | RFC 737 | Send to terminal |
FileZilla客户端连接FileZilla服务端,用Wireshark抓包:
接下来是一些命令:
客户端:
Status: Connecting to 192.168.1.142:21...
Status: Connection established, waiting for welcome message...
Response: 220-FileZilla Server version 0.9.41 beta
Response: 220-written by Tim Kosse (Tim.Kosse@gmx.de)
Response: 220 Please visit http://sourceforge.net/projects/filezilla/
Command: USER yang
Response: 331 Password required for yang
Command: PASS
Response: 230 Logged on
Command: SYST
Response: 215 UNIX emulated by FileZilla
Command: FEAT
Response: 211-Features:
Response: MDTM
Response: REST STREAM
Response: SIZE
Response: MLST type*;size*;modify*;
Response: MLSD
Response: UTF8
Response: CLNT
Response: MFMT
Response: 211 End
Status: Connected
Status: Retrieving directory listing...
Command: PWD
Response: 257 "/" is current directory.
Command: TYPE I
Response: 200 Type set to I
Command: PASV
Response: 227 Entering Passive Mode (192,168,1,142,4,74)
Command: MLSD
Response: 150 Connection accepted
Response: 226 Transfer OK
Status: Directory listing successful
服务端:
(000008)2013-5-26 13:45:10 - (not logged in) (192.168.1.143)> Connected, sending welcome message...
(000008)2013-5-26 13:45:10 - (not logged in) (192.168.1.143)> 220-FileZilla Server version 0.9.41 beta
(000008)2013-5-26 13:45:10 - (not logged in) (192.168.1.143)> 220-written by Tim Kosse (Tim.Kosse@gmx.de)
(000008)2013-5-26 13:45:10 - (not logged in) (192.168.1.143)> 220 Please visit http://sourceforge.net/projects/filezilla/
(000008)2013-5-26 13:45:10 - (not logged in) (192.168.1.143)> USER yang
(000008)2013-5-26 13:45:10 - (not logged in) (192.168.1.143)> 331 Password required for yang
(000008)2013-5-26 13:45:10 - (not logged in) (192.168.1.143)> PASS
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> 230 Logged on
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> SYST
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> 215 UNIX emulated by FileZilla
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> FEAT
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> 211-Features:
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> MDTM
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> REST STREAM
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> SIZE
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> MLST type*;size*;modify*;
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> MLSD
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> UTF8
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> CLNT
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> MFMT
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> 211 End
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> PWD
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> 257 "/" is current directory.
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> TYPE I
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> 200 Type set to I
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> PASV
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> 227 Entering Passive Mode (192,168,1,142,4,74)
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> MLSD
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> 150 Connection accepted
(000008)2013-5-26 13:45:10 - yang (192.168.1.143)> 226 Transfer OK