1. 程式人生 > >CentOS7.2升級openSSH為7.5P1無法登錄的處理過程

CentOS7.2升級openSSH為7.5P1無法登錄的處理過程

sshd all bug rmi enforce repo his centos7.2 mis

1.開始安裝高版本的的openSSH的時候,系統自帶的沒有卸載,重啟sshd進程,sshd -h查看也是後面安裝的高版本,但是telnet 127.0.0.1 22發現仍然還是老版本的信息,這時才發現應該時沒有安裝成功
2.於是,卸載重新安裝,再次重啟,這次telnet 127.0.0.1 22發現版本已經變成7.5的了
3.但是這時,ssh無法登陸,告訴/etc/bash: Permission denied
4.這時setenforce 0,倒是能正常ssh登陸,不相信必須得關閉selinux
5.於是setenforce 1,ssh登陸,查看/var/log/message,發現有如下信息:
Feb 1 22:28:57 localhost setroubleshoot: SELinux is preventing /usr/local/sbin/sshd from using the transition access on a process. For complete SELinux messages. run sealert -l 6ca7e4db-d52f-41a3-8199-505f7a77a6c9
Feb 1 22:28:57 localhost python: SELinux is preventing /usr/local/sbin/sshd from using the transition access on a process.#012#012* Plugin catchall (100. confidence) suggests **#012#012If you believe that sshd should be allowed transition access on processes labeled unconfined_t by default.#012Then you should report this as a bug.#012You can generate a local policy module to allow this access.#012Do#012allow this access for now by executing:#012# ausearch -c ‘sshd‘ --raw | audit2allow -M my-sshd#012# semodule -i my-sshd.pp#012

6.裏面已經說解決方法,於是運行下面兩個命令:
ausearch -c ‘sshd‘ --raw | audit2allow -M my-sshd
semodule -i my-sshd.pp
搞定

CentOS7.2升級openSSH為7.5P1無法登錄的處理過程