FTP协议

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 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 information
400 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 password
434Requested 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 integrity
631Integrity protected reply.
632Confidentiality and integrity protected reply.
633Confidentiality protected reply.
10000 SeriesCommon Winsock Error Codes
10054Connection 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.

Command RFC Description
ABOR Abort an active file transfer.
ACCT Account information.
ADATRFC 2228Authentication/Security Data
ALLO Allocate sufficient disk space to receive a file.
APPE Append.
AUTHRFC 2228Authentication/Security Mechanism
CCCRFC 2228Clear Command Channel
CDUP Change to Parent Directory.
CONFRFC 2228Confidentiality Protection Command
CWD Change working directory.
DELE Delete file.
ENCRFC 2228Privacy Protected Channel
EPRTRFC 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 Negotiation
LIST 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 Command
MKD 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 Size
PORT 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 file
RMD 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 site
STOU 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 directory
XMKDRFC 775Make a directory
XPWDRFC 775Print the current working directory
XRCPRFC 743 
XRMDRFC 775Remove the directory
XRSQRFC 743 
XSEMRFC 737Send, mail if cannot
XSENRFC 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 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


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值