Linux firewall shutdown and turn on, disable SELinux

Source: Internet
Author: User
Tags iptables

1) effective after reboot
Open: Chkconfig iptables on
Close: Chkconfig iptables off
2) immediate effect, restart after failure
Open: Service iptables start
OFF: Service iptables stop
It should be explained that for other services under Linux, you can use the above command 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 and 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

There are three ways to set up SELinux.


first, in the graphical interface:
Desktop--> Management--> security level and firewall, set to disable.
Second, in the command mode:
Modify file:/etc/selinux/config, and then reboot the system. Specific modifications as shown:


Third, run the command: Setup, enter the "firewall Configuration", in the SELinux bar, select "Disabled."
Operation Command: Setenforce 0 (no reboot required).

Turn off SELinux protection for the specified service (for example, FTP):
1, use the command: Getsebool Ftpd_disable_trans can view the current state if not on
2, Input command: Setsebool Ftpd_disable_trans 1
Of course, you can add the-p parameter so that you don't have to enter this command every time you boot
Setsebool-p Ftpd_disable_trans 1


Firewall aspect:
First, run the command: Setup, enter the "firewall Configuration", in the security level bar, select "Disabled."
Second, the operation command: Chkconfig--level iptables off.

To open the specified port:
1, run:/sbin/iptables-i input-p tling%2f0%2fcp.html "> cp --dport 80-j ACCEPT Open 80 ports.
2, run:/etc/init.d/iptables Save settings
===========================================
Note:
The above process is the key to solving the problem of vsftp as follows,
Oops:cannot Change Directory
Oops:child died
You can use VSFTP when you turn off firewalls and SELinux
Related Article

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.