第五步:测试
ftp localhost
Trying 127.0.0.1:21 ...
Connected to localhost.
220 Welcome to MY FTP service.
Name (localhost:icedot): test
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls -a
229 Entering Extended Passive Mode (|||6068|).
150 Here comes the directory listing.
drwxr-xr-x 2 0 0 512 May 27 21:38 .
drwxr-xr-x 4 0 0 512 May 27 21:38 ..
226 Directory send OK.
ftp>
第六步:权限设置
用户登录成功,并不表示可以上传下载,此时用户只是可以ls的出目录
chown -R test /home/test
这时就可以上传、下载并且建立目录
第七步:将用户锁定在家目录
为了安全我们要将用户锁定在家目录里。
编辑/usr/local/etc/vsftpd.conf
ee /usr/local/etc/vsftpd.conf
去掉下面这句的注释
chroot_local_user=YES //是否将所有用户锁定在主目录,YES为启用 NO禁用.(包括注释掉也为禁用)
重启vsftpd
/usr/local/etc/rc.d/vsftpd onerestart
第八步:让vsftpd随系统启动
让vsftp服务随系统启动得修改/etc/rc.conf文件
echo 'vsftpd_enable="YES"' >> /etc/rc.conf
