VsFTP出現500 OOPS: cannot change directory的解決辦法

VsFTP出現500 OOPS: cannot change directory的解決辦法

VsFTP出現500 OOPS: cannot change directory的解決辦法
cannot change directory:/home/***
ftp服務器連接失敗,錯誤提示:
500 OOPS: cannot change directory:/home/*******
500 OOPS: child died

解決方法:
在終端輸入命令:
setsebool ftpd_disable_trans 1
service vsftpd restart
就OK了!

在 安裝完vsftp服務後登陸時可能遇到cannot change directory後面是登陸者的目錄的錯誤。這是因爲SE設置的關閉了ftp的原因。 使用命令 getsebool ftpd_disable_trans 可以查看當前的狀態如果不是on 那麼是輸入命令 setsebool ftpd_disable_trans 1 當然也可以加入-P參數 以便不需要每次開機都輸入這個命令 setsebool -P ftpd_disable_trans 1 同理如果smb服務也遇到相同的問題

在安裝完vsftp服務後登陸時可能遇到cannot change directory後面是登陸者的目錄的錯誤。這是因爲SE設置的關閉了ftp的原因。

使用命令

getsebool ftpd_disable_trans

可以查看當前的狀態如果不是on

那麼是輸入命令

setsebool ftpd_disable_trans 1

當然也可以加入-P參數 以便不需要每次開機都輸入這個命令

setsebool -P ftpd_disable_trans 1

service vsftpd restart

同理 如果smb服務也遇到相同的問題 ,也可以這麼做。

setsebool -P samba_enable_home_dirs=1

selinux的問題也可以使用 管理工具中的 selinux management 來調整相關設置。

FTP登錄時錯誤信息:
500 OOPS: cannot change directory:/home/xxxxLogin failed.
421 Service not available, remote server has closed connection
開始以爲是權限問題,將home/xxxx chmod爲777,vsftpd配置文件全開依然不行。
百度一下查處原因:
==================================
I found information at the NSA that indicates you can disable SELinux protection of the ftp daemon.
setsebool -P ftpd_disable_trans 1
This seems a bit drastic. It certainly works for now though.
==================================
原來是新裝系統RHEL5 增強的系統安全SELinux在作怪,關掉SELinux對FTP Daemon的保護就OK了:
# setsebool ftpd_disable_trans 1


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章