修改ftp的根目录只要修改/etc/vsftpd/vsftpd.conf文件便可: html
加入以下几行:linux
local_root=/var/www/html chroot_local_user=YES anon_root=/var/www/html
注:local_root 针对系统用户;anon_root 针对匿名用户。 bash
从新启动服务:服务器
service vsftpd restart
任何一个用户ftp登陆到这个服务器上都会chroot到/var/www/html目录下。 rest
使用root用户链接redhat ftp时,报以下错误code
500 OOPS:cannot change directory:/root
解决方法: htm
关闭selinux,修改/etc/selinux/config文件或/etc/syscofnig/selinux设置blog
SELINUX= disabled
而后重启系统 get
重启后登录ftp到这个服务器就会在修改后的目录it