RHCSA Rapid Track
Bookmark this page
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
rootonserverX. Display the current SELinux mode.[root@serverX ~]#getenforceEnforcingChange 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 ~]#rebootWhen
serverXcomes back up, log in asrootand display the current SELinux mode.[root@serverX ~]#getenforcePermissiveChange the default SELinux mode to enforcing.
[root@serverX ~]#vi /etc/selinux/config[root@serverX ~]#grep '^SELINUX' /etc/selinux/configSELINUX=enforcing SELINUXTYPE=targetedSet the current SELinux mode to enforcing.
[root@serverX ~]#setenforce 1[root@serverX ~]#getenforceEnforcing