一、vsftpd:500 OOPS: vsftpd: refusing to run with writable root inside chroot ()錯誤的解決方法
當我們限定了用戶不能跳出其主目錄之后,使用該用戶登錄FTP時往往會遇到這個錯誤:500 OOPS: vsftpd: refusing to run with writable root inside chroot ()?
這個問題發(fā)生在最新的這是由于下面的更新造成的:
- 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增強了安全檢查,如果用戶被限定在了其主目錄下,則該用戶的主目錄不能再具有寫權限了!如果檢查發(fā)現(xiàn)還有寫權限,就會報該錯誤。
1、 要修復這個錯誤
可以用命令chmod a-w /home/user去除用戶主目錄的寫權限,注意把目錄替換成你自己的?;蛘吣憧梢栽趘sftpd的配置文件中增加下列兩項中的一項:
allow_writeable_chroot=YES
2、在主目錄上新建目錄,這個二級目錄有寫的權限
主目錄權限設置成755 chmod 755 /home/wwwroot
二級目錄 chmod 777 -R /home/wwwroot/ftp
二、檢查服務器防火墻和阿里云安全組(放開端口)
ftp的端口號是20和21
查看: iptables -L
刪除: iptables -D
阿里云進入控制臺--->云服務器ECS--->本實例安全組--->配置規(guī)則--->如規(guī)則添加20/21端口
