How to manually disable linux system firewall

Source: Internet
Author: User
Tags ssh server
This article mainly introduces how to manually disable linux system firewall. For more information, see

A firewall is a protection barrier formed by a combination of software and hardware devices and constructed between the intranet and the external network, and between the private network and the public network. it is an image of a security method. it is a combination of computer hardware and software, enabling a security gateway between the Internet and Intranet.

(1) it takes effect permanently after restart:
Enable: chkconfig iptables on
Close: chkconfig iptables off

(2) it takes effect immediately and becomes invalid after restart:
Enable: service iptables start
Disable: service iptables stop
You can use the preceding command to enable or disable other services in Linux.
When the firewall is enabled, make the following settings to enable the relevant ports,
Modify the/etc/sysconfig/iptables file and add the following content:
-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 information, indicating that the firewall is on.
/Etc/rc. d/init. d/iptables stop disable firewall
Finally:
Enter setup under the root user to enter a graphical interface, select Firewall configuration, enter the next interface, select Security Level as Disabled, and save. Restart.
========================================================== ====================
Under fedora
/Etc/init. d/iptables stop
========================================================== ====================
Under ubuntu:
UBUNTU has no related direct commands.
Use the following command
Iptables-P INPUT ACCEPT
Iptables-P OUTPUT ACCEPT
Temporarily open all ports
No command to disable iptables on Ubuntu
========================================================== ====================
Iptables is a powerful firewall in linux. without considering the efficiency, it is powerful enough to replace most hardware firewalls. However, if the powerful firewall is improperly used, it may block not only the potential attacks, but also you. The harm brought by this may not matter to ordinary personal PCs, but imagine that if this is a server, once this happens, it is not just a normal cinema service, we still need to go to the site for recovery. How much will this cause to you?
So I want to say that you should be very careful when you type every command related to iptables.

1. when applying each rule to the DROP target, you must carefully check the rule. before applying the rule, consider the impact it has on you.

2. in redhat, we can use service iptables stop to disable the firewall, but in some versions, such as ubuntu, this command does not work, you may find many articles on the Internet that tell you to use the iptables-F command to close the firewall, but before using this command, remember to use iptables-L to check the default targets of all links in your system. The iptables-F command only clears all rules, but does not actually close iptables. imagine that if the default target of your chain is DROP, you have rules to allow specific ports, but once iptables-L is applied, after all rules are cleared, the default target will block any access, including remote ssh server management.
So the recommended command to disable the firewall is
Iptables-P INPUT ACCEPT
Iptables-P FORWARD ACCEPT
Iptables-P OUTPUT ACCEPT
Iptables-F

In short, when you want to make any changes on your server, it is best to have a test environment that has been fully tested and then applied to your server. In addition, to make good use of iptables, you must understand the running principle of iptables and know how iptables processes each data packet. In this way, rules can be accurately written to avoid unnecessary troubles.

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.