I enabled the SELINUX again on my CentOS 8.2 installation. And now the logins wont work, neither by ssh or direct. To login i have to make the mode to permissive. the secure log shows as below.
#login with ssh
Sep 14 02:26:57 lcl sshd[4407]: Accepted password for <MY USERNAME> from <My local ip> port 52410 ssh2
Sep 14 02:26:57 lcl systemd[4412]: pam_unix(systemd-user:session): session opened for user <MY USERNAME> by (uid=0)
Sep 14 02:26:57 lcl sshd[4407]: pam_systemd(sshd:session): Failed to create session: Start job for unit user@1000.service failed with 'failed'
Sep 14 02:26:57 lcl sshd[4407]: pam_unix(sshd:session): session opened for user <MY USERNAME> by (uid=0)
Sep 14 02:26:57 lcl sshd[4421]: fatal: sshd_selinux_copy_context: setcon failed with Permission denied
Sep 14 02:26:57 lcl sshd[4407]: pam_unix(sshd:session): session closed for user <MY USERNAME>
#this is when i tried to login directly without ssh.
Sep 14 02:29:13 lcl systemd[3716]: pam_unix(systemd-user:session): session opened for user <MY USERNAME> by (uid=0)
Sep 14 02:29:13 lcl systemd[3721]: pam_unix(systemd-user:session): session closed for user <MY USERNAME>
Sep 14 02:29:13 lcl login[1225]: pam_systemd(login:session): Failed to create session: Start job for unit user@1000.service failed with 'failed'
Sep 14 02:29:13 lcl login[1225]: pam_unix(login:session): session opened for user <MY USERNAME> by LOGIN(uid=0)
Sep 14 02:29:14 lcl login[1225]: LOGIN ON tty1 BY <MY USERNAME>
Sep 14 02:29:14 lcl login[1225]: pam_unix(login:session): session closed for user <MY USERNAME>
I am not a hardcore server admin please help me fix this issue.
tail -10 /var/log/audit.log | audit2allow
. Theaudit2allow
command will convert the entries its sees to plain english explanations. Try the login attempt as per @MichaelHampton suggestion. @zorry's autorelabel suggestion also seems sound advice. – davey Oct 31 '20 at 15:21