1) 安装vsftpd
[root@srv1 ~]# yum install vsftpd -y
2) 启动vsftpd
[root@srv1 ~]# systemctl enable --now vsftpd
3) 将文件放置到/var/ftp/目录下
[root@srv1 ~]# cp test.txt /var/ftp
[root@srv1 ~]# chmod ftp. /var/ftp/text.txt
4) 匿名账户ftp访问
[root@client ~]# yum install ftp -y
[root@client ~]# ftp srv1.1000cc.net
Connected to srv1.1000cc.net (192.168.10.11).
220 (vsFTPd 3.0.2)
Name (srv1.1000cc.net:root): ftp
331 Please specify the password.
Password: # 密码为ftp
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
227 Entering Passive Mode (192,168,10,11,111,189).
150 Here comes the directory listing.
drwxr-xr-x 2 0 0 6 Oct 30 2018 pub
-rw-r--r-- 1 14 50 0 Feb 22 10:50 text.txt
226 Directory send OK.
ftp> get text.txt # 下载text.txt
local: text.txt remote: text.txt
227 Entering Passive Mode (192,168,10,11,184,117).
150 Opening BINARY mode data connection for text.txt (0 bytes).
226 Transfer complete.
ftp> bye
221 Goodbye.
5) 本地账户ftp访问
[root@client ~]# ftp srv1.1000cc.net
Connected to srv1.1000cc.net (192.168.10.11).
220 (vsFTPd 3.0.2)
Name (srv1.1000cc.net:root): snow
331 Please specify the password.
Password: # 输入snow账户的密码
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/home/snow" # 本地账户默认登录自己的home目录
ftp> put text.txt # 上传text.txt
local: text.txt remote: text.txt
227 Entering Passive Mode (192,168,10,11,218,202).
150 Ok to send data.
226 Transfer complete.
ftp> bye
221 Goodbye.
|