FTP protocol commands and response code

㈠FTP main function

⑴ provide shared (computer program / data) file;

⑵ indirect support using a remote computer;

⑶ so that users are not due to differences in various types of host memory file system affected;

⑷ reliable and efficient data transmission.

 

㈡FTP control frame

FTP TELNET control frame refers to exchange of information, including TELNET commands and options.

However, most FTP control frames are simple ASCII text, it can be divided into FTP commands or FTP messages.

FTP FTP command message is a response, which is composed of a response code with explanatory text.

 

㈢FTP command table

command description
ABOR Interrupt Data Connector
ACCT <account> System privilege account
ALLO <bytes> Bytes of memory allocated on the file server
APPE <filename> Add files to the file server with the same name
CDUP <dir path> Parent directory on the server change
CWD <dir path> Change the working directory on the server
DELE <filename> Delete the specified file on the server
HELP <command> Returns the specified command information
LIST <name> If the file name is listed in the file information, if it is listed in the directory file list
MODE <mode> Transmission mode (S = streaming mode, B = block mode, C = compressed mode)
MKD <directory> Establish specified directory on the server
NLST <directory> Lists the contents of the specified directory
NOOP No action, in addition to recognition from the server
PASS <password> System password
PASV Requests the server waits for a data connection
PORT <address> IP address and port ID of two bytes
PWD Displays the current working directory
QUIT Log out from the FTP server
REIN Log in to re-initialize the connection status
REST <offset> Restart the specific offset file delivery
RETR <filename> Retrieve (copy) files from the server
RMD <directory> Deletes the specified directory on the server
RNFR <old path> 对旧路径重命名
RNTO <new path> 对新路径重命名
SITE <params> 由服务器提供的站点特殊参数
SMNT <pathname> 挂载指定文件结构
STAT <directory> 在当前程序或目录上返回信息
STOR <filename> 储存(复制)文件到服务器上
STOU <filename> 储存文件到服务器名称上
STRU <type> 数据结构(F=文件,R=记录,P=页面)
SYST 返回服务器使用的操作系统
TYPE <data type> 数据类型(A=ASCII,E=EBCDIC,I=binary)
USER <username>> 系统登录的用户名

 

 ㈣FTP响应码

响应代码 解释说明
110 新文件指示器上的重启标记
120 服务器准备就绪的时间(分钟数)
125 打开数据连接,开始传输
150 打开连接
200 成功
202 命令没有执行
211 系统状态回复
212 目录状态回复
213 文件状态回复
214 帮助信息回复
215 系统类型回复
220 服务就绪
221 退出网络
225 打开数据连接
226 结束数据连接
227 进入被动模式(IP 地址、ID 端口)
230 登录因特网
250 文件行为完成
257 路径名建立
331 要求密码
332 要求帐号
350 文件行为暂停
421 服务关闭
425 无法打开数据连接
426 结束连接
450 文件不可用
451 遇到本地错误
452 磁盘空间不足
500 无效命令
501 错误参数
502 命令没有执行
503 错误指令序列
504 无效命令参数
530 未登录网络
532 存储文件需要帐号
550 文件不可用
551 不知道的页类型
552 超过存储分配
553 文件名不允许

 

参考:https://blog.csdn.net/unsv29/article/details/79468101

 

Guess you like

Origin www.cnblogs.com/shihaiying/p/12127785.html