User Tools

Site Tools


help:selinux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
help:selinux [2020/07/19 20:09] – old revision restored (2016/07/11 11:54) 192.99.4.140help: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:Allow access to an HTTP network port|Allow access to an HTTP network port]]
  
 [[SELinux:Change the SELinux mode|Change the SELinux mode]] [[SELinux:Change the SELinux mode|Change the SELinux mode]]
Line 21: Line 22:
  
 [[SELinux:Check SELinux Status|Check SELinux Status]] [[SELinux:Check SELinux Status|Check SELinux Status]]
 +
 +[[SELinux:Confine users|Confine users]]
  
 [[SELinux:Find Unprotected Services|Find Unprotected Services]] [[SELinux:Find Unprotected Services|Find Unprotected Services]]
Line 33: Line 36:
  
 [[SELinux:Temporarily Switch Off SELinux Enforcement|Temporarily Switch Off SELinux Enforcement]] [[SELinux:Temporarily Switch Off SELinux Enforcement|Temporarily Switch Off SELinux Enforcement]]
 +
 +[[SELinux:Temporarily Switch On SELinux Enforcement|Temporarily Switch On SELinux Enforcement]]
  
 [[SELinux:Troubleshooting SELinux Policy Errors|Troubleshooting SELinux Policy Errors]] [[SELinux:Troubleshooting SELinux Policy Errors|Troubleshooting SELinux Policy Errors]]
 +
 +[[SELinux:Turn off SELinux|Turn off SELinux]]
  
 [[SELinux:Understanding SELinux Configuration|Understanding SELinux Configuration]] [[SELinux:Understanding SELinux Configuration|Understanding SELinux Configuration]]
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.  You need to use the **semanage** command as follows: 
- 
-<code bash> 
-semanage port -a -t http_port_t -p tcp 8181 
-</code> 
  
  
Line 91: Line 90:
  
  
-===== Temporarily switch on SELinux enforcement ===== 
  
-Type the following command as root user: 
  
-<code bash> 
-echo 1 >/selinux/enforce 
-</code> 
  
-Type the following command to see current status, enter: 
  
-<code bash> 
-sestatus 
-</code> 
  
-Sample outputs: 
  
-<code bash> 
-SELinux status:                 enabled 
-SELinuxfs mount:                /selinux 
-Current mode:                   enforcing 
-Mode from config file:          enforcing 
-Policy version:                 24 
-Policy from config file:        targeted 
-</code> 
- 
- 
- 
-===== Turn off SELinux ===== 
- 
-Type the following command: 
- 
-<code bash> 
-echo 0 >/selinux/enforce 
-</code> 
- 
-You can also use the setenforce command to effectively disable it, enter: 
- 
-<code bash> 
-setenforce Permissive 
-</code> 
- 
-OR 
- 
-<code bash> 
-setenforce 0 
-</code> 
- 
-The above commands will switch off SELinux enforcement temporarily until the machine is rebooted.  If you would like to make it permanently, edit /etc/sysconfig/selinux, enter: 
- 
-<code bash> 
-vi /etc/sysconfig/selinux 
-</code> 
- 
-And set / update it as follows: 
- 
-<file bash /etc/sysconfig/selinux> 
-SELINUX=disabled 
-</file> 
- 
-Save and close the file.  The above will only work in CentOS, Fedora and RedHat Enterprise Linux systems.  For all other Linux distros edit your boot loader config file (LILO or GRUB boot loader config file such as /boot/grub/grub.conf).  Find the kernel line, append enforcing=0 at the end: 
- 
-<file /boot/grub/grub.conf> 
-title Red Hat Enterprise Linux Server (2.6.18-194.26.1.el5) 
-        root (hd0,0) 
-        kernel /vmlinuz-2.6.18-194.26.1.el5 ro root=LABEL=/ console=tty0 console=ttyS1,19200n8 enforcing=0 
-        initrd /initrd-2.6.18-194.26.1.el5.img 
-</file> 
- 
-Finally, reboot the system: 
- 
-<code bash> 
-reboot 
-</code> 
- 
- 
- 
-[[SELinux:Confine users|Confine users]] 
help/selinux.1595189340.txt.gz · Last modified: 2020/07/19 20:09 by 192.99.4.140

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki