禁用完整的 Selinux
首先编辑/etc/selinux/config
SELINUX=disabled
也尝试添加到grub.conf selinux=0
kernel /vmlinuz-2.6.32-642.3.1.el6.x86_64 ro root=/dev/mapper/vg-lv_root rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=es rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=auto LANG=es_ES.UTF-8 rd_LVM_LV=vg/lv_swap rd_NO_DM rd_LVM_LV=vg/lv_root selinux=0 rhgb quiet
initrd /initramfs-2.6.32-642.3.1.el6.x86_64.img
重启机器并验证
root@srv107 [~]# sestatus
SELinux status: disabled
哎呀
问题依然存在。尝试从其他主机访问时使用端口 24、10050、10051 的多个服务出现错误:
#telnet srv107.XXXXXXX.net 10051
Trying 5.XXX.XX.101...
telnet: connect to address 5.XXX.XX.101: No route to host
在主机上查看 selinux 登录操作
type=USER_START msg=audit(1470384283.115:17): user pid=2348 uid=0 auid=0 ses=1 msg='op=login id=0 exe="/usr/sbin/sshd" hostname=213.XXX.XX.35 addr=213.XXX.XX.35 terminal=/dev/pts/0 res=success'
type=CRYPTO_KEY_USER msg=audit(1470384283.116:18): user pid=2348 uid=0 auid=0 ses=1 msg='op=destroy kind=server fp=59:ff:74:ff:7f:4b:a8:5b:60:20:60:c7:a5:4b:c8:ae direction=? spid=2348 suid=0 exe="/usr/sbin/sshd" hostname=? addr=213.XXX.XX.35 terminal=pts/0 res=success'
type=CRYPTO_KEY_USER msg=audit(1470384283.116:19): user pid=2348 uid=0 auid=0 ses=1 msg='op=destroy kind=server fp=7b:0d:45:79:16:08:c4:3f:30:0f:3d:76:86:07:48:c5 direction=? spid=2348 suid=0 exe="/usr/sbin/sshd" hostname=? addr=213.XXX.XX.35 terminal=pts/0 res=success'
type=CRED_REFR msg=audit(1470384283.116:20): user pid=2348 uid=0 auid=0 ses=1 msg='op=PAM:setcred acct="root" exe="/usr/sbin/sshd" hostname=213.XXX.XX.35 addr=213.XXX.XX.35 terminal=ssh res=success'
type=USER_ACCT msg=audit(1470384301.929:21): user pid=2413 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:accounting acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
type=CRED_ACQ msg=audit(1470384301.929:22): user pid=2413 uid=0 auid=4294967295 ses=4294967295 msg='op=PAM:setcred acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
type=LOGIN msg=audit(1470384301.929:23): pid=2413 uid=0 old auid=4294967295 new auid=0 old ses=4294967295 new ses=2
type=USER_START msg=audit(1470384301.935:24): user pid=2413 uid=0 auid=0 ses=2 msg='op=PAM:session_open acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
type=CRED_DISP msg=audit(1470384305.615:25): user pid=2413 uid=0 auid=0 ses=2 msg='op=PAM:setcred acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
type=USER_END msg=audit(1470384305.615:26): user pid=2413 uid=0 auid=0 ses=2 msg='op=PAM:session_close acct="root" exe="/usr/sbin/crond" hostname=? addr=? terminal=cron res=success'
从您的审核日志中,您执行的操作没有任何内容。审核日志显示 SSH 连接和 cron 操作,但您正在尝试使用 telnet 连接。
首先,您必须检查您是否打开了端口,例如端口 10051:
然后你必须检查你是否被防火墙阻止:
如果找不到防火墙输出结果中列出的端口,则必须通过以下方式添加新规则:
对于永久规则,您必须重新加载防火墙服务以应用新设置: