Enable-selinux-on-ubuntu-20-04 SSH connection not working

/how-to-disable-enable-selinux-on-ubuntu-20-04-focal-fossa-linux

I tried to enable selinux with your document

After Reboot, SSH connection not working

When SELinux is enabled and SSH stops working, it’s often due to SELinux contexts or boolean settings that are not correctly configured. Start by checking the SELinux status with sestatus to confirm it’s enforcing rules. Review the audit logs for denied actions related to SSH using ausearch -m avc -ts recent | audit2why to understand what’s being blocked. You might need to restore the default SELinux contexts on SSH files (restorecon -Rv /etc/ssh /var/lib/ssh ~/.ssh), adjust SELinux booleans (setsebool -P [boolean_name] on), or temporarily switch SELinux to permissive mode with setenforce 0 to identify the specific rule causing the issue. Ensure SSH configurations in /etc/ssh/sshd_config are correct and restart the SSH service (systemctl restart sshd). This approach should help in pinpointing and resolving the SELinux policy conflicts preventing SSH connections.