[root@linux2 ~]# ftp 192.168.123.102 Connected to192.168.123.102 (192.168.123.102). 220 (vsFTPd 3.0.2) Name (192.168.123.102:root): ftp 331 Please specify the password. Password: 230 Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> ftp> ls
[root@linux2 ~]# ftp 192.168.123.101 Connected to 192.168.123.101 (192.168.123.101). 220 (vsFTPd 3.0.2) Name (192.168.123.101:root): ftp 331Please specify the password. Password: 230Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> ftp> ls 227EnteringPassiveMode (192,168,123,101,101,29). 150Here comes the directory listing. drwxr-xr-x 2006Oct132020 pub 226Directory send OK.
登录成功,使用ls命令浏览默认的FTP目录 (/var/ftp)
1、首先在FTP默认目录/var/pub中创建两个文本文件1.txt和2.txt
[root\@ayaka ~]# cd /var/ftp/pub/
[root\@ayaka pub]# touch 1.txt
[root\@ayaka pub]# touch 2.txt
[root\@ayaka pub]# ls 1.txt 2.txt
2、在客户端上进入/pub目录
ftp> ls 227 Entering Passive Mode (192,168,123,101,75,103). 150 Here comes the directory listing. -rw-r—r— 1 0 0 0 May 09 10:37 1.txt -rw-r—r— 1 0 0 0 May 09 10:37 2.txt
将Vsftpd服务器上文件下载到客户端
进入pub目录 使用get命令将文件1.txt与2.txt下载到当前目录下,下载成功的过程如下
220 (vsFTPd 3.0.2) Name (192.168.123.101:root): ftp 331Please specify the password. Password: 230Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> cd pub 250Directory successfully changed. ftp> ls 227EnteringPassiveMode (192,168,123,101,25,132). 150Here comes the directory listing. -rw-r--r-- 10050May0910:541.txt -rw-r--r-- 1000May0910:372.txt 226Directory send OK. ftp> !pwd /root ftp> get 1.txt local: 1.txt remote: 1.txt 227EnteringPassiveMode (192,168,123,101,145,74). 150OpeningBINARY mode data connection for1.txt (50 bytes). 226Transfer complete. 50 bytes received in0.000134 secs (373.13Kbytes/sec) ftp> !ls 11.txt anaconda-ks.cfg ftp>
[root@linux2 ~]# ftp 192.168.123.101 Connected to 192.168.123.101 (192.168.123.101). 220 (vsFTPd 3.0.2) Name (192.168.123.101:root): ftp 331Please specify the password. Password: 230Login successful. Remote system type is UNIX. Using binary mode to transfer files. ftp> cd hub //进入目录hub 250Directory successfully changed. ftp> !ls //执行本机Shell命令,显示当前内容 11.txt anaconda-ks.cfg file1.txt ftp> put 1//上传文件1 local: 1remote: 1 227EnteringPassiveMode (192,168,123,101,176,227). 150Ok to send data. 226Transfer complete. 1664 bytes sent in0.000814 secs (2044.23Kbytes/sec) ftp> ls -l //查看hub目录中的文件列表 227EnteringPassiveMode (192,168,123,101,85,50). 150Here comes the directory listing. -rw------- 114501664May0911:261 226Directory send OK. ftp> mkdir tomato //创建目录 257"/hub/tomato" created //创建目录成功 ftp> ls 227EnteringPassiveMode (192,168,123,101,99,18). 150Here comes the directory listing. -rw------- 114501664May0911:261 drwx------ 214506May0911:35 tomato 226Directory send OK. ftp>