Centos Selinux-文件上下文看起来不错,但Selinux赢了';不允许写

Centos Selinux-文件上下文看起来不错,但Selinux赢了';不允许写,centos,rhel,selinux,security-context,Centos,Rhel,Selinux,Security Context,我正在努力学习Selinux。通过一个沙箱并使用VSFTPD进行试验,我在Centos中运行了一台vsfptd服务器。我有很多用户可以在/var/ftp/incoming中放置文件。在远程计算机上,我可以让用户成功登录,但无法将文件放在remove-vsftpd服务器上: $ftp mysql_server Connected to mysql_server (192.168.1.31). 220 Welcome to blah FTP service. Name (mysql_server:r

我正在努力学习Selinux。通过一个沙箱并使用VSFTPD进行试验,我在Centos中运行了一台vsfptd服务器。我有很多用户可以在/var/ftp/incoming中放置文件。在远程计算机上,我可以让用户成功登录,但无法将文件放在remove-vsftpd服务器上:

$ftp mysql_server
Connected to mysql_server (192.168.1.31).
220 Welcome to blah FTP service.
Name (mysql_server:root): anonymous
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer ftp> put atd 
local: atd remote: atd
227 Entering Passive Mode (192,168,1,31,19,161).
553 Could not create file.
ftp> 
在VSFTPD服务器上,aureport-报告显示:

[root@mysql_server ftp]# aureport -a

AVC Report
========================================================
# date time comm subj syscall class permission obj event
========================================================
4. 04/08/2013 13:30:36 vsftpd unconfined_u:system_r:ftpd_t:s0-s0:c0.c1023 21 dir write system_u:object_r:public_content_t:s0 denied 28
5. 04/08/2013 13:34:57 vsftpd unconfined_u:system_r:ftpd_t:s0-s0:c0.c1023 2 dir write system_u:object_r:public_content_t:s0 denied 47
我检查了目录,文件上下文看起来不错,所以我不明白为什么Selinux不允许vsftpd写入传入目录:

[root@mysql_server ftp]# ls -Z
drwx-wx---. root ftp  system_u:object_r:public_content_t:s0 incoming
drwxr-xr-x. root root system_u:object_r:public_content_t:s0 pub
[root@mysql_server ftp]#

您的SELinux类型不正确。使用“公共内容”而不是“公共内容”。阅读有关您的SELinux类型不正确的详细信息。使用“公共内容”而不是“公共内容”。阅读有关

的详细信息您需要运行以下命令以允许在SELinux中上载和编辑文件:

setsebool -P allow_ftpd_full_access on
setsebool -P ftp_home_dir on

您需要运行以下命令以允许在SELinux中上载和编辑文件:

setsebool -P allow_ftpd_full_access on
setsebool -P ftp_home_dir on