vsftpd:500 OOPS: vsftpd: refusing to run with writable root inside chroot ()錯誤的解決方法


參考:

https://blog.csdn.net/bluishglc/article/details/42399439

原vsftpd服務器的系統從centos6.8升級到centos7.2。vsftpd使用yum方式安裝,用戶采用系統用戶登錄。由於系統升級到centos7,yum安裝的vsftpd版本改變。因此按centos6的設置,登錄時報錯。配置文件未修改,主要是修改了ftp的主目錄權限。

這個問題發生在最新的這是由於下面的更新造成的:
- 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去除用戶主目錄的寫權限(采用該方式,將用戶主目錄文件熟悉修改為#chmod 555)。      
或者你可以在vsftpd的配置文件中增加下列兩項中的一項:
 
allow_writeable_chroot=YES      ##驗證在vsftpd.conf中增加該項配置,vsftpd服務無法正常啟動。
 

登錄驗證:

 

配置:
[root@mail vsftpd]# egrep -v "^#|^$" vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
tcp_wrappers=YES
port_enable=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
xferlog_file=/var/log/xferlog
dual_log_enable=yes
log_ftp_protocol=yes
vsftpd_log_file=/var/log/vsftpdlogfile

 


免責聲明!

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



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