Centos 7: Could not open kernel policy /etc/selinux/targeted/active/policy.kern for reading. (No such file or directory)
Posted: 2023 May 03, 20:08
The operating system is restarted and in the boot menu the E key is pressed (to edit the settings).
Add the parameter selinux=0 to the end of the line that begins with the following syntax: linux16.
Press Ctrl+x to save the settings.
After booting, run the reinstall command for selinux-policy-targeted
If selinux policy targeted is not installed, the command to install it is executed
After installing the selinux-policy-targeted package, run the command
Reboot the server
After rebooting the server, execute the command: sestatus, which will print the following output
NOTE: After executing the reboot command, it will take a longer time for the operating system to reinitialize
Add the parameter selinux=0 to the end of the line that begins with the following syntax: linux16.
Press Ctrl+x to save the settings.
After booting, run the reinstall command for selinux-policy-targeted
Code: Select all
[root @ CentOS ~]$ yum reinstall selinux-policy-targeted -y
Code: Select all
[root @ CentOS ~]$ yum install selinux-policy-targeted -y
Code: Select all
[root @ CentOS ~]$ touch /.autorelabel
Code: Select all
[root @ CentOS ~]$ reboot -h now
Code: Select all
[root @ CentOS ~]$ sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: enforcing
Mode from config file: enforcing
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31