help:selinux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
help:selinux [2020/07/19 20:09] – old revision restored (2016/07/11 11:54) 192.99.4.140 | help:selinux [2020/07/19 20:09] (current) – old revision restored (2016/07/11 11:59) 192.99.4.140 | ||
---|---|---|---|
Line 13: | Line 13: | ||
* disabled – SELinux is fully disabled. | * disabled – SELinux is fully disabled. | ||
+ | [[SELinux: | ||
[[SELinux: | [[SELinux: | ||
Line 21: | Line 22: | ||
[[SELinux: | [[SELinux: | ||
+ | |||
+ | [[SELinux: | ||
[[SELinux: | [[SELinux: | ||
Line 33: | Line 36: | ||
[[SELinux: | [[SELinux: | ||
+ | |||
+ | [[SELinux: | ||
[[SELinux: | [[SELinux: | ||
+ | |||
+ | [[SELinux: | ||
[[SELinux: | [[SELinux: | ||
Line 43: | Line 50: | ||
- | |||
- | ===== Allow Lighttpd / Apache / Nginx At Port 8181 ===== | ||
- | |||
- | By default SELinux will block access to many ports including 8181. You need to allow access to a port # 8181 so that it can bind and listen for incoming requests on non privileged ports. | ||
- | |||
- | <code bash> | ||
- | semanage port -a -t http_port_t -p tcp 8181 | ||
- | </ | ||
Line 91: | Line 90: | ||
- | ===== Temporarily switch on SELinux enforcement ===== | ||
- | Type the following command as root user: | ||
- | <code bash> | ||
- | echo 1 >/ | ||
- | </ | ||
- | Type the following command to see current status, enter: | ||
- | <code bash> | ||
- | sestatus | ||
- | </ | ||
- | Sample outputs: | ||
- | <code bash> | ||
- | SELinux status: | ||
- | SELinuxfs mount: | ||
- | Current mode: | ||
- | Mode from config file: enforcing | ||
- | Policy version: | ||
- | Policy from config file: targeted | ||
- | </ | ||
- | |||
- | |||
- | |||
- | ===== Turn off SELinux ===== | ||
- | |||
- | Type the following command: | ||
- | |||
- | <code bash> | ||
- | echo 0 >/ | ||
- | </ | ||
- | |||
- | You can also use the setenforce command to effectively disable it, enter: | ||
- | |||
- | <code bash> | ||
- | setenforce Permissive | ||
- | </ | ||
- | |||
- | OR | ||
- | |||
- | <code bash> | ||
- | setenforce 0 | ||
- | </ | ||
- | |||
- | The above commands will switch off SELinux enforcement temporarily until the machine is rebooted. | ||
- | |||
- | <code bash> | ||
- | vi / | ||
- | </ | ||
- | |||
- | And set / update it as follows: | ||
- | |||
- | <file bash / | ||
- | SELINUX=disabled | ||
- | </ | ||
- | |||
- | Save and close the file. The above will only work in CentOS, Fedora and RedHat Enterprise Linux systems. | ||
- | |||
- | <file / | ||
- | title Red Hat Enterprise Linux Server (2.6.18-194.26.1.el5) | ||
- | root (hd0,0) | ||
- | kernel / | ||
- | initrd / | ||
- | </ | ||
- | |||
- | Finally, reboot the system: | ||
- | |||
- | <code bash> | ||
- | reboot | ||
- | </ | ||
- | |||
- | |||
- | |||
- | [[SELinux: |
help/selinux.1595189340.txt.gz · Last modified: 2020/07/19 20:09 by 192.99.4.140