selinux avc:被拒绝的问题

usa*_*ims 4 security linux selinux

我只是在许可模式下使用 selinux 设置了一个网络托管服务器,这意味着它不安全,但会将问题写入消息日志文件。一旦我修复了所有 avc: denied 错误,我会将服务器置于“强制”模式。但问题来了。在 /var/log/messages 中,我有以下错误:

Apr  3 14:32:30 narf kernel: type=1400 audit(1365013105.731:3): avc:  denied  { search }      for  pid=1319 comm="vsftpd" name="/" dev=dm-2 ino=2 scontext=system_u:system_r:ftpd_t:s0-   s0:c0.c1023 tcontext=system_u:object_r:home_root_t:s0 tclass=dir
Run Code Online (Sandbox Code Playgroud)

现在,我如何从逻辑上解决这个问题,有人有任何交易技巧吗?

Mat*_*Ife 6

看起来好像您希望 FTP 能够用于普通用户(在 /home 中有内容)。

存在一个布尔值来解决这个问题。您可以执行以下操作来解决此问题..

cat your_avc_txt.txt | audit2why

其中产生:

Apr  3 14:32:30 narf kernel: type=1400 audit(1365013105.731:3): avc:  denied  { search } for  pid=1319 comm="vsftpd" name="/" dev=dm-2 ino=2 scontext=system_u:system_r:ftpd_t:s0-s0:c0.c1023 tcontext=system_u:object_r:home_root_t:s0 tclass=dir

Was caused by:
One of the following booleans was set incorrectly.
Description:
Allow ftp to read and write files in the user home directories

Allow access by executing:
# setsebool -P ftp_home_dir 1
Description:
Allow ftp servers to login to local users and read/write all files on the system, governed by DAC.

Allow access by executing:
# setsebool -P ftpd_full_access 1
Run Code Online (Sandbox Code Playgroud)

这会告诉您哪些布尔值控制此行为以及它们的作用,您应该启用两者中限制最大的布尔值。所以在你的情况下ftp_home_dir