用FileZilla连接ftp出现错误,500 OOPS: cannot change directory:/home/ftp
原因是CentOS系统安装了SELinux,因为默认下是没有开启FTP的支持,所以访问时都被阻止了。
##查看SELinux设置
[root@bgsl-001 vsftpd]# getsebool -a|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
##使用setsebool命令开启目录 [root@bgsl-001 vsftpd]# setsebool -P ftp_home_dir 1 [root@bgsl-001 vsftpd]# getsebool -a|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
##重启vsftp [root@bgsl-001 vsftpd]# service vsftpd restart Shutting down vsftpd: [ OK ] Starting vsftpd for vsftpd: [ OK ]