【前言】首先介绍一下华为VRP系统中的用户等级
命令行视图
用户级别
FTP是用来传送文件的协议。使用FTP实现远程文件传输的同时,还可以保证数据传输的可靠性和高效性。
FTP
应用
FTP 提供了一种在服务器和客户机之间上传和下载文件的有效方式(使用的是TCP协议)。
传输过程
使用FTP传输数据时,需要在服务器和客户机之间建立控制连接和数据连接。
控制端口号:21(服务器端)
数据端口号:20(服务器端)
控制连接用于在服务器和客户端之间传输控制命令,通常情况下,服务器主动建立或者中断数据连接。
传输模式
传输模式定义了数据在客户端和服务器之间传输时的格式。
ASCII模式用于传输文本:
字符–》ASCII–》字符
二进制模式用于发送图片文件或程序文件
无需转换格式
配置
服务器端配置:
[V200R003C00]
#
sysname R2
ftp server enable //开启ftp服务
set default ftp-directory flash: //设置目录文件
#
aaa
local-user huawei password cipher %$%$gf6]!8j#=(8I=JGPU]{=%]+:%$%$ //创建新用户并设置密码(此时设置的密码为密文,所以显示乱码)
local-user huawei access-limit 200 // 设置传输速率
local-user huawei idle-timeout 0 0 //设置超时时间
local-user huawei privilege level 3 //设置访问等级(可选1--15)
local-user huawei ftp-directory flash: //设置访问目录
local-user huawei service-type ftp /选择类型
客户端配置:
<R3>ftp 172.1.1.2 //通过服务器端地址访问
Trying 172.1.1.2 ...
Press CTRL+K to abort
Connected to 172.1.1.2.
220 FTP service ready.
User(172.1.1.2:(none)):huawei //输入用户名
331 Password required for huawei.
Enter password: //输入密码,输入密码时不会显示密码
230 User logged in.
[R3-ftp] //出现此标志时为登入成功
登入成功以后可选问号来查看能够使用的命令:
[R3-ftp]?
FTP Client view commands:
ascii Set the file transfer type to ASCII, and it is the default type
binary Set the file transfer type to support the binary image
bye Terminate the FTP connection to the remote server, and exit FTP
cd Change the remote working directory
cdup Change the remote directory to parent directory
close Terminate the FTP connection to the remote server, and return to
the FTP command mode
debugging Enable system debugging functions
delete Delete a file on the remote machine
dir List the contents of the current or remote directory, and
optionally output the contents to a local file
disconnect Terminate the FTP connection to the remote server, and return to
the FTP command mode
get Download the remote file to the local host
lcd Display the current working directory
ls List the contents of the current or remote directory, and
optionally output the contents that vary with the remote host
system to a local file
mkdir Create a directory on the remote host
open Establish an FTP connection
passive Set the toggle passive mode, the default is on
put Upload a local file to the remote host
pwd Print the name of the current working directory on the remote host
quit Terminate the FTP connection to the remote server, and exit FTP
remotehelp Print an informative message about the meaning of commands
rmdir Delete a directory from the remote host
undo Negate a command or set its defaults
user Identify the remote FTP user
verbose Set the toggle verbose mode, the default is on
get+文件名为下载
put+文件名为上传