Linuxiptables is accessible only on ports 22 and 80.

Source: Internet
Author: User
Linuxiptables is set to 22 and 80 ports only. you can run the netstat-tnl command to check which ports are opened on the server. The Ssh code netstat-tnl is used to view the Ssh code iptables-L-n enabled for the firewall. 22, port 80 Ssh code iptables-... linux iptables is set to 22 and 80 ports only. you can run the netstat-tnl command to check which ports are opened on the current server. The Ssh code netstat-tnl is used to view the firewall setting Ssh code iptables-L-n open 22. port 80 Ssh code iptables-a input-p tcp -- dport 22-j ACCEPT iptables-a output-p tcp -- sport 22-j ACCEPT iptables-a input-p tcp -- dport 80-m state -- state NEW, ESTABLISHED-j ACCEPT iptables-a output-p tcp -- sport 80-m state -- state NEW, ESTABLISHED-j ACCEPT cancel access rules for other ports Ssh code iptables-p input drop iptables-p forward drop iptables-p output drop allow local loopback interface (that is, allow local access to the local machine) ssh code iptables-a input-s 127.0.0.1-d 127.0.0.1-j ACCEPT allows established or related connections (such as database links) ssh code iptables-a input-m state -- state ESTABLISHED, RELATED-j ACCEPT allows all local machines to access the Ssh code iptables-a output-j ACCEPT to save the configuration: Ssh Code service iptables save
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.