Not able to SSH to CentOS 7.x /RHEL 7.x and showing following errors in /var/log/secure messages.
Nov 19 07:30:54 cent7-1 sshd[1944]: Accepted password for naveen from 192.168.1.8 port 53376 ssh2
Nov 19 07:30:54 cent7-1 sshd[1944]: pam_systemd(sshd:session): Failed to create session: Access denied
Nov 19 07:30:54 cent7-1 sshd[1944]: pam_unix(sshd:session): session opened for user naveen by (uid=0)
Nov 19 07:30:55 cent7-1 sshd[1976]: sshd_selinux_copy_context: setcon failed with Permission denied
Nov 19 07:30:55 cent7-1 sshd[1976]: Received disconnect from 192.168.1.8 port 53376:11: disconnected by user
Nov 19 07:30:55 cent7-1 sshd[1976]: Disconnected from 192.168.1.8 port 53376
Nov 19 07:30:55 cent7-1 sshd[1944]: pam_unix(sshd:session): session closed for user naveen
Nov 19 07:31:14 cent7-1 sshd[2059]: ssh_selinux_change_context: setcon system_u:system_r:sshd_net_t:s0 from system_u:system_r:kernel_t:s0 failed with Permission denied [preauth]
Nov 19 07:31:26 cent7-1 sshd[2100]: ssh_selinux_change_context: setcon system_u:system_r:sshd_net_t:s0 from system_u:system_r:kernel_t:s0 failed with Permission denied [preauth]
Nov 19 07:31:35 cent7-1 sshd[2100]: Accepted password for naveen from 192.168.1.10 port 50668 ssh2
Nov 19 07:31:36 cent7-1 sshd[2100]: pam_systemd(sshd:session): Failed to create session: Access denied
Nov 19 07:31:36 cent7-1 sshd[2100]: pam_unix(sshd:session): session opened for user naveen by (uid=0)
Nov 19 07:31:36 cent7-1 sshd[2138]: sshd_selinux_copy_context: setcon failed with Permission denied
Nov 19 07:31:36 cent7-1 sshd[2100]: pam_unix(sshd:session): session closed for user naveen
Nov 19 07:31:39 cent7-1 sshd[2156]: ssh_selinux_change_context: setcon system_u:system_r:sshd_net_t:s0 from system_u:system_r:kernel_t:s0 failed with Permission denied [preauth]
Nov 19 07:31:49 cent7-1 sshd[2156]: Accepted password for root from 192.168.1.10 port 50671 ssh2
Nov 19 07:31:49 cent7-1 sshd[2156]: pam_systemd(sshd:session): Failed to create session: Access denied
Nov 19 07:31:49 cent7-1 sshd[2156]: pam_unix(sshd:session): session opened for user root by (uid=0)
Nov 19 07:31:49 cent7-1 sshd[2156]: sshd_selinux_copy_context: setcon failed with Permission denied
Nov 19 07:31:50 cent7-1 sshd[2213]: sshd_selinux_copy_context: setcon failed with Permission denied
Nov 19 07:31:50 cent7-1 sshd[2156]: pam_unix(sshd:session): session closed for user root
Nov 19 07:31:52 cent7-1 sshd[2228]: ssh_selinux_change_context: setcon system_u:system_r:sshd_net_t:s0 from system_u:system_r:kernel_t:s0 failed with Permission denied [preauth]
Nov 19 07:32:00 cent7-1 sshd[2228]: Accepted password for kumar from 192.168.1.10 port 50673 ssh2
Nov 19 07:32:00 cent7-1 sshd[2228]: pam_systemd(sshd:session): Failed to create session: Access denied
Nov 19 07:32:00 cent7-1 sshd[2228]: pam_unix(sshd:session): session opened for user kumar by (uid=0)
Nov 19 07:32:00 cent7-1 sshd[2279]: sshd_selinux_copy_context: setcon failed with Permission denied
Nov 19 07:32:00 cent7-1 sshd[2228]: pam_unix(sshd:session): session closed for user kumar
Nov 19 07:32:14 cent7-1 sshd[2059]: Connection reset by 192.168.1.8 port 53377 [preauth]
Nov 19 07:34:35 cent7-1 sshd[2781]: ssh_selinux_change_context: setcon system_u:system_r:sshd_net_t:s0 from system_u:system_r:kernel_t:s0 failed with Permission denied [preauth]
Nov 19 07:34:42 cent7-1 sshd[2781]: Accepted password for naveen from 192.168.1.14 port 44776 ssh2
Nov 19 07:34:42 cent7-1 sshd[2781]: pam_systemd(sshd:session): Failed to create session: Access denied
Nov 19 07:34:42 cent7-1 sshd[2781]: pam_unix(sshd:session): session opened for user naveen by (uid=0)
Nov 19 07:34:42 cent7-1 sshd[2812]: sshd_selinux_copy_context: setcon failed with Permission denied
Nov 19 07:34:42 cent7-1 sshd[2812]: Received disconnect from 192.168.1.14 port 44776:11: disconnected by user
Nov 19 07:34:42 cent7-1 sshd[2812]: Disconnected from 192.168.1.14 port 44776
Nov 19 07:34:42 cent7-1 sshd[2781]: pam_unix(sshd:session): session closed for user naveen
I tried to chroot the problematic VM from another VM-cent8-1.
While checking the sestatus it was showing as disabled in chroot environment but actually it was set to enforcing
[root@cent8-1 log]# sestatus
SELinux status: disabled
[root@cent8-1 log]# cat /etc/sysconfig/selinux
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
Now change the SELINUX to disabled state.
[root@cent8-1 log]# vi /etc/sysconfig/selinux
Post a Comment