Centos:如果selinux处于活动状态,则rsyslog会阻止sshd以及本地login

我在一个centos 6.5(现在6.6)的机器上有一个非常好奇的问题。 在6月11日和10月21日之间的更新之后,麻烦开始了(包: http : //pastebin.com/gXvaycLL )。 十月份重新启动后,无法使用ssh在服务器上login。 客户端总是停止以下消息:

ssh_exchange_identification:读取:通过对等方重置连接

我试图直接在服务器上login。 首先,我尝试使用控制台login。 input密码后,服务器通过说“密码不正确”拒绝。 在graphics模式下也是一样的。 但密码是正确的。 现在我find了一个解决办法:通过在bootmanager中追加selinux = 0来closuresselinux。 现在我能够login到服务器上的控制台。 此外,我无法login使用SSH(也使用本地主机)。 在此之后,我编辑/ etc / selinux / config并将SELINUX值从强制设置为允许以后禁用。 重新启动后,我无法login,即使我设置禁用。 login的唯一方法是设置selinux = 0。 现在我find了这个男的:rsyslog。 如果我禁用启动日志,一切都很好接受日志logging。

好奇的是:如果rsyslogd启动,所有其他服务,如Apache和MySQL工作正常。

这里是使用debug3的sshd日志的下半部分:

[...] debug1: Bind to port 22 on 0.0.0.0. Server listening on 0.0.0.0 port 22. debug2: fd 4 setting O_NONBLOCK debug1: Bind to port 22 on ::. Server listening on :: port 22. debug3: fd 5 is not O_NONBLOCK debug1: Server will not fork when running in debugging mode. debug3: send_rexec_state: entering fd = 8 config len 599 debug3: ssh_msg_send: type 0 debug3: send_rexec_state: done debug1: rexec start in 5 out 5 newsock 5 pipe -1 sock 8 debug1: inetd sockets after dupping: -1, -1 setsockopt SO_KEEPALIVE: Bad file descriptor debug1: getpeername failed: Bad file descriptor debug1: get_remote_port failed 

正如你所看到的,两个inetd套接字都是无效的。 如果rsyslog没有启动,有正面的套接字,一切都很好。

我试图通过重新安装rsyslog(与新鲜/未经编辑的configuration),并重新安装selinux库来解决它。 我也从centos6.5更新到实际版本6.6有没有人知道我该如何解决这个问题?

我在OEL 6上遇到同样的问题,发现下面的补丁是根本原因:

NSS-softokn-freebl-3.14.3-17.el6.x86_64.rpm

更新后,我无法通过SSHlogin。

感谢您的文章,这是有帮助的。

感谢MarlonRégisSchmitz提供的centos.org上的提示: bugs.centos.org/view.php?id=7812

在这里我find了解决scheme。 我删除了包prelink 。 重新激活rsyslog并重新启动系统后,ssh和login正在工作正常。

预链接包包括一个程序,预处理可执行文件和库,以减lessCPU的消耗和加速程序的加载。 也可以为一些可执行文件和库创build一个黑名单,但是我还没有尝试过。