VSFTP中VS的意思是“Very Secure”。从名称可以看出,从一开始,软件的编写者就非常注重其安全性。除与生俱来的安全性外,VSFTP还具有高速、稳定的性能特点。在稳定性方面,VSFTP可以在单机(非集群)上支持4000个以上的并发用户同时连接。据ftp.redhat.com的数据,VSFTP最多可以支持15000个并发用户。
一、快速构建FTP服务器
vsftp不像squid等软件需要做相应的配置才可以启动,安装好以后直接输入
/etc/init.d/vsftpd start
就启动了vsftp。
二、测试FTP服务器(测试环境为windows xp cmd)
首先添加测试文件
cd /var/ftp/pub
vi test.txt 添加内容“This is a test file”保存退出。
使用客户端登录到服务器,然后以匿名(anonymous)身份登录
#ftp 10.0.0.15 #(根据你的服务器地址判断,我的服务器ip address是10.0.0.15)
Connected to 10.0.0.15.
220 (vsFTPd 2.0.1)
User (10.0.0.15none)): anonymous
331 Please specify the password.
Password:
230 Login successful.
ftp>
成功登陆服务器后可以显示一下文件列表
ftp> dir
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
drwxr-xr-x 2 0 0 4096 Jul 30 22:31 pub
226 Directory send OK.
ftp: 收到 61 字节,用时 0.00Seconds 61000.00Kbytes/sec.
进入pub目录,并显示目录内容,可以看到刚才的test.txt文件
ftp> cd pub
250 Directory successfully changed.
ftp> dir
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
-rw-r--r-- 1 0 0 13 Jul 30 22:31 test.txt
226 Directory send OK.
ftp: 收到 66 字节,用时 0.00Seconds 66000.00Kbytes/sec.
测试下载test.txt文件
ftp> get test.txt
200 PORT command successful. Consider using PASV.
150 Opening BINARY mode data connection for test.txt (13 bytes).
226 File send OK.
ftp: 收到 13 字节,用时 0.00Seconds 13000.00Kbytes/sec.
ok可以下载,我们来试试看上传。
ftp> put "C:\Documents and Settings\fish\桌面\vsftp.txt"
200 PORT command successful. Consider using PASV.
550 Permission denied.
尝试上传vsftp.txt请求被拒绝了。
# ftp 127.0.0.1
Connected to 127.0.0.1 (127.0.0.1).
220 Welcom to my FTP server.
Name (127.0.0.1:root): oz
331 Please specify the password.
Password:
230 Login successful. Have fun.
Remote system type is UNIX.
Using binary mode to transfer files.
测试下载服务器目录中的一个文件mytest:
ftp> get mytest
local: mytest remote: mytest
227 Entering Passive Mode (127,0,0,1,159,19)
150 Opening BINARY mode data connection for mytest (21 bytes).
226 File send OK.
21 bytes received in 0.00038 secs (54 Kbytes/sec)
测试上传本机目录中的文件vsftpd.conf:
ftp> !ls
account.db chroot_list k mytest userconf vsftpd.conf
ftp> put vsftpd.conf
local: vsftpd.conf remote: vsftpd.conf
227 Entering Passive Mode (127,0,0,1,117,203)
150 Ok to send data.
226 File receive OK.
4229 bytes sent in 0.00195 secs (2.1e+03 Kbytes/sec)