SELinux and shutdown of the firewall

Source: Internet
Author: User

[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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.