[Email protected] targeted]# pwd
/etc/selinux/targeted
[Email protected] targeted]# Getsebool-a|grep Samba
Samba_create_home_dirs--off
Samba_domain_controller--off
Samba_enable_home_dirs--off
Samba_export_all_ro--off
SAMBA_EXPORT_ALL_RW--off
Samba_run_unconfined--off
Samba_share_fusefs--off
Samba_share_nfs--off
Use_samba_home_dirs--off
Virt_use_samba--off
[Email protected] targeted]# Setsebool samba_create_home_dirs on
Chcon
To close the SELinux method:
Modify the Selinux= "" in the/etc/selinux/config file to Disabled, and then restart.
If you do not want to restart the system, use the command Setenforce 0
Note:
Setenforce 1 setting SELinux to become enforcing mode
Setenforce 0 Setting SELinux to become permissive mode
Added in Lilo or grub boot parameters: Selinux=0, can also turn off SELinux
#---------------------------------------------------------------
To view the SELinux status:
/usr/bin/setstatus-v
As follows:
SELinux status:enabled
SELINUXFS Mount:/selinux
Current Mode:permissive
Mode from config file:enforcing
Policy version:21
Policy from config file:targeted
Getenforce/setenforce View and set the current mode of operation for SELinux.
Linux off Firewall
1) Permanent effect after reboot:
Open: Chkconfig iptables on
OFF: Chkconfig iptables off
2) immediate effect, failure after reboot:
Open: Service iptables start
Close: Service iptables stop
It should be stated that for other services under Linux, the above command can be used to perform the open and close operations.
When the firewall is turned on, make the following settings, open the relevant port,
Modify the/etc/sysconfig/iptables file to add the following:
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 80-j ACCEPT
-A rh-firewall-1-input-m state--state new-m tcp-p TCP--dport 22-j ACCEPT
Or:
/etc/init.d/iptables status will get a series of messages stating that the firewall is open.
/etc/rc.d/init.d/iptables Stop shutting down the firewall
The recommended shutdown Firewall command is
Iptables-p INPUT ACCEPT
Iptables-p FORWARD ACCEPT
Iptables-p OUTPUT ACCEPT
Iptables-f
Note:
Under Fedora:
/etc/init.d/iptables stop
SELinux and shutdown of the firewall