我有一个带有 SELinux 的 Red Hat 5 处于强制模式:
SELinux status: enabled
SELinuxfs mount: /selinux
Current mode: enforcing
Mode from config file: enforcing
Policy version: 21
Policy from config file: targeted
即使 crond_disable_trans 被禁用:
[root@rhel5_1 sf_personal]# getsebool -a|grep crond
crond_disable_trans --> off
fcron_crond --> off
但 crond 适用于任何用户。
[root@rhel5_1 sf_personal]# crontab -u user01 -l
* * * * * /usr/bin/wall Ciao
这是审核日志文件
type=USER_ACCT msg=audit(1346167741.137:35): user pid=2653 uid=0 auid=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: accounting acct="root" : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)'
type=CRED_ACQ msg=audit(1346167741.142:36): user pid=2653 uid=0 auid=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: setcred acct="root" : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)'
type=USER_ACCT msg=audit(1346167741.144:37): user pid=2654 uid=0 auid=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: accounting acct="user01" : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)'
type=CRED_ACQ msg=audit(1346167741.144:38): user pid=2654 uid=0 auid=4294967295 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: setcred acct="user01" : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)'
type=LOGIN msg=audit(1346167741.144:39): login pid=2653 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=6
type=LOGIN msg=audit(1346167741.146:40): login pid=2654 uid=0 old auid=4294967295 new auid=502 old ses=4294967295 new ses=7
type=USER_START msg=audit(1346167741.150:41): user pid=2653 uid=0 auid=0 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: session open acct="root" : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)'
type=CRED_DISP msg=audit(1346167741.153:42): user pid=2653 uid=0 auid=0 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: setcred acct="root" : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)'
type=USER_END msg=audit(1346167741.153:43): user pid=2653 uid=0 auid=0 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: session close acct="root" : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)'
type=USER_START msg=audit(1346167741.154:44): user pid=2654 uid=0 auid=502 subj=system_u:system_r:crond_t:s0-s0:c0.c1023 msg='PAM: session open acct="user01" : exe="/usr/sbin/crond" (hostname=?, addr=?, terminal=cron res=success)'
我不明白为什么?