原vsftpd服务器的系统从centos6.8升级到centos7.2。vsftpd使用yum方式安装,用户采用系统用户登录。由于系统升级到centos7,yum安装的vsftpd版本改变。因此按centos6的设置,登录时报错。配置文件未修改,主要是修改了ftp的主目录权限。

vsftpd:500 OOPS: vsftpd: refusing to run with writable root inside chroot ()错误的解决方法_主目录


这个问题发生在最新的这是由于下面的更新造成的:

  • Add stronger checks for the configuration error of running with a writeable root directory inside a chroot(). This may bite people who carelessly turned on chroot_local_user but such is life.

从2.3.5之后,vsftpd增强了安全检查,如果用户被限定在了其主目录下,则该用户的主目录不能再具有写权限了!如果检查发现还有写权限,就会报该错误。

要修复这个错误,可以用命令chmod a-w /home/user01去除用户主目录的写权限(采用该方式,将用户主目录文件熟悉修改为#chmod 555)。

推荐解决方案

可以在vsftpd的配置文件中增加下列两项中的一项:
放到最后即可

allow_writeable_chroot=YES