I enabled selinux to make some tests (with enforcing
) and now my AWS instance is unable to boot.
From the instance screenshot I see that it can't start some services like login
How can I recover the instance?
I enabled selinux to make some tests (with enforcing
) and now my AWS instance is unable to boot.
From the instance screenshot I see that it can't start some services like login
How can I recover the instance?
It looks like none of your files have SELinux labels.
You should first set SELinux to permissive
. You will need to start a new instance and attach your existing instance's EBS volume to it to make this change and allow you to boot it again.
After you boot the system with SELinux in permissive mode, you can relabel all your files with restorecon -rv /
, then finally you can reboot in enforcing
mode.
For future reference you should never set SELinux to disabled. If you must "disable" it for something, you should either set SELinux to permissive, or set a single SELinux domain to permissive (for a single service).