500 OOPS: cannot change directory:/home/user
Login failed.
在系统日志中也可以看到如下信息:
[root@web ~]# tail /var/log/messages
Sep 5 08:30:59 web setroubleshoot: SELinux is preventing the ftp daemon from reading users home directories (./home). For complete SELinux messages. run sealert -l 81cf3268-4d97-449a-9949-3a08ceef49b6
按照其中所述,运行
[root@web ~]# sealert -l 81cf3268-4d97-449a-9949-3a08ceef49b6
Summary:
SELinux is preventing the ftp daemon from reading users home directories (./home).
Detailed Description:
SELinux has denied the ftp daemon access to users home directories (./home). Someone is attempting to login via your ftp daemon to a user account. If you only setup ftp to allow anonymous ftp, this could signal a intrusion attempt.
Allowing Access:
If you want ftp to allow users access to their home directories you need to turn on the ftp_home_dir boolean: "setsebool -P ftp_home_dir=1"
The following command will allow this access:
setsebool -P ftp_home_dir=1
按照其中描述,执行该命令:
[root@web ~]# setsebool -P ftp_home_dir=1
Login failed.
在系统日志中也可以看到如下信息:
[root@web ~]# tail /var/log/messages
Sep 5 08:30:59 web setroubleshoot: SELinux is preventing the ftp daemon from reading users home directories (./home). For complete SELinux messages. run sealert -l 81cf3268-4d97-449a-9949-3a08ceef49b6
按照其中所述,运行
[root@web ~]# sealert -l 81cf3268-4d97-449a-9949-3a08ceef49b6
Summary:
SELinux is preventing the ftp daemon from reading users home directories (./home).
Detailed Description:
SELinux has denied the ftp daemon access to users home directories (./home). Someone is attempting to login via your ftp daemon to a user account. If you only setup ftp to allow anonymous ftp, this could signal a intrusion attempt.
Allowing Access:
If you want ftp to allow users access to their home directories you need to turn on the ftp_home_dir boolean: "setsebool -P ftp_home_dir=1"
The following command will allow this access:
setsebool -P ftp_home_dir=1
按照其中描述,执行该命令:
[root@web ~]# setsebool -P ftp_home_dir=1
之后本地用户就可以用FTP登录该服务器了
-----------------------
===ftp===
//If you want to share files anonymously
chcon -R -t public_content_t /var/ftp
//If you want to setup a directory where you can upload files
chcon -t public_content_rw_t /var/ftp/pub
You must also turn on the boolean allow_ftpd_anon_write
setsebool -P allow_ftpd_anon_write=1
//If you are setting up this machine as a ftpd server and wish to allow users to access their home directorories
setsebool -P ftp_home_dir 1
//If you want to run ftpd as a daemon
setsebool -P ftpd_is_daemon 1
//You can disable SELinux protection for the ftpd daemon
setsebool -P ftpd_disable_trans 1