【轉】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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM