vsftpd出现“Response: 500 OOPS: cannot change directory”解决方法
 
笔者用的Linux发行版本为centos当用FTP客户端连接时,出现如下错误提示:
 
Response: 500 OOPS: cannot change directory:/home/bhtest
 
输入命令查看

[root@XXXX]# sestatus -b| grep ftp
allow_ftpd_anon_write off
allow_ftpd_full_access off
allow_ftpd_use_cifs off
allow_ftpd_use_nfs off
ftp_home_dir off
ftpd_connect_db off
ftpd_use_fusefs off
ftpd_use_passive_mode off
httpd_enable_ftp_server off
tftp_anon_write off
tftp_use_cifs off
tftp_use_nfs off

注意以上ftp_home_dir 是处于off的状态,也就是说当前是不允许用户通过FTP登录到/home/*(*代表对应的用户)的目录下的,为此,我们可以用以下方法解决:

[root@XXX]# setsebool ftp_home_dir on
[root@XXX]# sestatus -b| grep ftp
allow_ftpd_anon_write off
allow_ftpd_full_access off
allow_ftpd_use_cifs off
allow_ftpd_use_nfs off
ftp_home_dir on
ftpd_connect_db off
ftpd_use_fusefs off
ftpd_use_passive_mode off
httpd_enable_ftp_server off
tftp_anon_write off
tftp_use_cifs off
tftp_use_nfs off

测试登录正常。

04-20 00:07