FTP协议

来源:互联网 发布:知乎 粮食 编辑:程序博客网 时间:2024/05/01 19:52

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.

CodeExplanation100 SeriesThe requested action is being initiated, expect another reply before proceeding with a new command.110Restart 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 "=").120Service ready in nnn minutes.125Data connection already open; transfer starting.150File status okay; about to open data connection.200 SeriesThe requested action has been successfully completed.202Command not implemented, superfluous at this site.211System status, or system help reply.212Directory status.213File status.214Help 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.215NAME system type. Where NAME is an official system name from the registry kept by IANA.220Service ready for new user.221Service closing control connection.225Data connection open; no transfer in progress.226Closing data connection. Requested file action successful (for example, file transfer or file abort).227Entering Passive Mode (h1,h2,h3,h4,p1,p2).228Entering Long Passive Mode (long address, port).229Entering Extended Passive Mode (|||port|).230User logged in, proceed. Logged out if appropriate.231User logged out; service terminated.232Logout command noted, will complete when transfer done.250Requested file action okay, completed.257"PATHNAME" created.300 SeriesThe command has been accepted, but the requested action is on hold, pending receipt of further information.331User name okay, need password.332Need account for login.350Requested file action pending further information400 SeriesThe 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.421Service not available, closing control connection. This may be a reply to any command if the service knows it must shut down.425Can't open data connection.426Connection closed; transfer aborted.430Invalid username or password434Requested host unavailable.450Requested file action not taken.451Requested action aborted. Local error in processing.452Requested action not taken. Insufficient storage space in system.File unavailable (e.g., file busy).500 SeriesSyntax error, command unrecognized and the requested action did not take place. This may include errors such as command line too long.501Syntax error in parameters or arguments.502Command not implemented.503Bad sequence of commands.504Command not implemented for that parameter.530Not logged in.532Need account for storing files.550Requested action not taken. File unavailable (e.g., file not found, no access).551Requested action aborted. Page type unknown.552Requested file action aborted. Exceeded storage allocation (for current directory or dataset).553Requested action not taken. File name not allowed.600 SeriesReplies regarding confidentiality and integrity631Integrity protected reply.632Confidentiality and integrity protected reply.633Confidentiality protected reply.10000 SeriesCommon Winsock Error Codes10054Connection reset by peer. The connection was forcibly closed by the remote host.10060Cannot connect to remote server.10061Cannot connect to remote server. The connection is actively refused by the server.10066Directory not empty.10068Too 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.

CommandRFCDescriptionABOR Abort an active file transfer.ACCT Account information.ADATRFC 2228Authentication/Security DataALLO Allocate sufficient disk space to receive a file.APPE Append.AUTHRFC 2228Authentication/Security MechanismCCCRFC 2228Clear Command ChannelCDUP Change to Parent Directory.CONFRFC 2228Confidentiality Protection CommandCWD Change working directory.DELE Delete file.ENCRFC 2228Privacy Protected ChannelEPRTRFC 2428Specifies an extended address and port to which the server should connect.EPSVRFC 2428Enter extended passive mode.FEATRFC 2389Get the feature list implemented by the server.HELP Returns usage documentation on a command if specified, else a general help document is returned.LANGRFC 2640Language NegotiationLIST Returns information of a file or directory if specified, else information of the current working directory is returned.LPRTRFC 1639Specifies a long address and port to which the server should connect.LPSVRFC 1639Enter long passive mode.MDTMRFC 3659Return the last-modified time of a specified file.MICRFC 2228Integrity Protected CommandMKD Make directory.MLSDRFC 3659Lists the contents of a directory if a directory is named.MLSTRFC 3659Provides 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).OPTSRFC 2389Select options for a feature.PASS Authentication password.PASV Enter passive mode.PBSZRFC 2228Protection Buffer SizePORT Specifies an address and port to which the server should connect.PROTRFC 2228Data 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 fileRMD Remove a directory.RNFR Rename from.RNTO Rename to.SITE Sends site specific commands to remote server.SIZERFC 3659Return 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 siteSTOU Store file uniquely.STRU Set file transfer structure.SYST Return system type.TYPE Sets the transfer mode (ASCII/Binary).USER Authentication username.XCUPRFC 775Change to the parent of the current working directoryXMKDRFC 775Make a directoryXPWDRFC 775Print the current working directoryXRCPRFC 743 XRMDRFC 775Remove the directoryXRSQRFC 743 XSEMRFC 737Send, mail if cannotXSENRFC 737Send 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 betaResponse:220-written by Tim Kosse (Tim.Kosse@gmx.de)Response:220 Please visit http://sourceforge.net/projects/filezilla/Command:USER yangResponse:331 Password required for yangCommand:PASS Response:230 Logged onCommand:SYSTResponse:215 UNIX emulated by FileZillaCommand:FEATResponse:211-Features:Response: MDTMResponse: REST STREAMResponse: SIZEResponse: MLST type*;size*;modify*;Response: MLSDResponse: UTF8Response: CLNTResponse: MFMTResponse:211 EndStatus:ConnectedStatus:Retrieving directory listing...Command:PWDResponse:257 "/" is current directory.Command:TYPE IResponse:200 Type set to ICommand:PASVResponse:227 Entering Passive Mode (192,168,1,142,4,74)Command:MLSDResponse:150 Connection acceptedResponse:226 Transfer OKStatus: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


原创粉丝点击