我在CentOS 7.1上安装了dovecot。过去,我经常只是禁用了SELinux,但现在我想要一台SELinux服务器,它可以为我工作。无论如何,我的邮件存储在/home/USER/Maildir中,由于不理解的原因,我得到了以下错误:
Jul 25 22:32:03 server dovecot: imap(dean): Error: open(/home/dean/Maildir/dovecot.index.log) failed: Permission denied (euid=1000(dean) egid=1000(dean) missing +r perm: /home/dean/Maildir/dovecot.index.log stat(/home/dean/Maildir/dovecot.index.log) failed: Permission denied)
Jul 25 22:32:03 server dovecot: imap(dean): Error: file_dotlock_create(/home/dean/Maildir/dovecot-uidlist) failed: Permission denied (euid=1000(dean) egid=1000(dean) missing +w perm: /home/dean/Maildir, UNIX perms appear ok (ACL/MAC wrong?))我使用以下方法检查了SELinux:
grep -i AVC /var/log/audit/audit.log并发现:
avc: denied { read write } for pid=13443 comm="imap" name="dovecot-uidlist" dev="dm-2" ino=1051352 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:fusefs_t:s0 tclass=file
type=AVC msg=audit(1437859923.579:147270): avc: denied { read } for pid=13443 comm="imap" name="dovecot-uidlist" dev="dm-2" ino=1051352 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:fusefs_t:s0 tclass=file
type=AVC msg=audit(1437860132.705:147592): avc: denied { read append } for pid=13630 comm="imap" name="dovecot.index.log" dev="dm-2" ino=1051357 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:fusefs_t:s0 tclass=file
type=AVC msg=audit(1437860132.705:147593): avc: denied { read } for pid=13630 comm="imap" name="dovecot.index.log" dev="dm-2" ino=1051357 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:fusefs_t:s0 tclass=file
type=AVC msg=audit(1437860132.706:147594): avc: denied { read } for pid=13630 comm="imap" name="dovecot.index.log" dev="dm-2" ino=1051357 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:fusefs_t:s0 tclass=file
type=AVC msg=audit(1437860132.706:147595): avc: denied { getattr } for pid=13630 comm="imap" path="/home/dean/Maildir/dovecot.index.log" dev="dm-2" ino=1051357 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:fusefs_t:s0 tclass=file
type=AVC msg=audit(1437860132.707:147596): avc: denied { write } for pid=13630 comm="imap" name="Maildir" dev="dm-2" ino=1048660 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:fusefs_t:s0 tclass=dir
type=AVC msg=audit(1437860132.707:147597): avc: denied { write } for pid=13630 comm="imap" name="Maildir" dev="dm-2" ino=1048660 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:fusefs_t:s0 tclass=dir
type=AVC msg=audit(1437860132.707:147598): avc: denied { read write } for pid=13630 comm="imap" name="dovecot-uidlist" dev="dm-2" ino=1051352 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:fusefs_t:s0 tclass=file
type=AVC msg=audit(1437860132.707:147599): avc: denied { read } for pid=13630 comm="imap" name="dovecot-uidlist" dev="dm-2" ino=1051352 scontext=system_u:system_r:dovecot_t:s0 tcontext=system_u:object_r:fusefs_t:s0 tclass=file我真的不知道如何处理这件事。我确实想要SELinux,但我还没有找到解决方案。有人能帮忙吗?
发布于 2015-07-26 08:44:46
首先要指出的是,解决方案不是禁用SELinux,而是使用它。
您可以使用一些工具来确定您需要做的工作,好消息是,与早期版本相比,它们在CentOS 7.1中有了很大的改进。
首先在您收集的AVC消息上运行audit2why
audit2why <FileContainingMessages如果一切顺利,它将为您提供一个拒绝消息的列表,以及您需要做些什么来解决这些消息。
如果这不能给你一个直接的答案,它可能会指向你的audit2allow。
在您的特殊情况下,我相当肯定audir2why会为您提供一个合适的答案。
https://serverfault.com/questions/708568
复制相似问题