In this lab, you will manage SELinux modes, both temporarily and persistently.
| Resources | |
|---|---|
| Machines: | serverX |
Outcomes:
You will get practice viewing and setting the current SELinux mode.
Log in as root on serverX. Display
the current SELinux mode.
[root@serverX ~]#getenforceEnforcing
Change the default SELinux mode to permissive and reboot.
[root@serverX ~]#vi /etc/selinux/config[root@serverX ~]#grep '^SELINUX' /etc/selinux/configSELINUX=permissive SELINUXTYPE=targeted[root@serverX ~]#reboot
When serverX comes back up, log in as
root and display the current SELinux mode.
[root@serverX ~]#getenforcePermissive
Change the default SELinux mode to enforcing.
[root@serverX ~]#vi /etc/selinux/config[root@serverX ~]#grep '^SELINUX' /etc/selinux/configSELINUX=enforcing SELINUXTYPE=targeted
Set the current SELinux mode to enforcing.
[root@serverX ~]#setenforce 1[root@serverX ~]#getenforceEnforcing