【转】vsftp 遇到错误 500 OOPS: vsftpd: refusing to run with writable root inside chroot()--不错

原文网址:http://linux.it.net.cn/e/server/ftp/2015/0227/13554.html

当我们限定了用户不能跳出其主目录之后,使用该用户登录FTP时往往会遇到这个错误:

500 OOPS: vsftpd: refusing to run with writable root inside chroot ()  

这个问题发生在最新的这是由于下面的更新造成的:  IT网,http://www.it.net.cn

  1. - 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/user去除用户主目录的写权限,注意把目录替换成你自己的。或者你可以在vsftpd的配置文件中增加下列两项中的一项: 

allow_writeable_chroot=YES

 

原文网址:https://www.centos.bz/2011/12/500-oops-vsftpd-refusing-to-run-with-writable-root-inside-chroot/

今天把vsftpd升级到了v2.3.5,配置文件还是使用原来的.允许本地用户登录ftp,并且使用chroot限制ftp根目录.启动登录之后发现如下错误:

  1. 500 OOPS: vsftpd: refusing to run with writable root inside chroot()

意思是不能使用chroot限制可写的根目录,看了下vsftpd的更新日志:

  1. 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.

原文网址:http://www.zhukun.net/archives/7654

Ubuntu 12.04 64bit系统下安装的vsftpd,在登陆时提示500 OOPS: vsftpd: refusing to run with writable root inside chroot()。根本原因在于,从vsftpd_2.3.5版开始,取消了根目录的可写权限。因此,网上的普遍解决方案是以下两种:

方案一
$ chmod a-w /vaf/ftp
 
方案二
$ vim /etc/vsftpd.conf add the following
  allow_writeable_chroot=YES

看起来,貌似第二种方式是更完美,但当我把allow_writeable_chroot=YES配置项加入的时候,重启vsftpd服务的时候发现不能正常工作了(21端口无程序在监听),于是上网查找解决方案,发现说法五花八门的,有人说配置项是allow_writable_chroot(少了个e),还有说配置项是allow_writable_root(少了ch)等的,经过我测试,发现全都不行。后来总算找到一个可行的方法。

或者chmod 500 /raf/ftp

Ubuntu 12.04 64bit的完整解决方案

$ apt-get install python-software-properties
$ sudo add-apt-repository ppa:thefrontiergroup/vsftpd
$ sudo apt-get update
$ sudo apt-get install vsftpd
$ vim /etc/vsftpd.conf and add the following
  chroot_local_user=YES
  allow_writeable_chroot=YES
$ sudo service vsftpd restart

posted on 2015-05-31 22:16  wi100sh  阅读(16262)  评论(0编辑  收藏  举报

导航