How to enable port 80 and port 22 of iptables firewall in CentOS

Source: Internet
Author: User
The following operations require root permissions Oh command: #/sbin/iptables-IINPUT-ptcp -- dport80-jACCEPT #/sbin/iptables-IINPUT-ptcp -- dport22-jACCEPT and then save: #/etc/rc. d/init. d/iptablessave
Command:
#/Sbin/ Iptables-I INPUT-p tcp -- dport 80-j ACCEPT
#/Sbin/iptables-I INPUT-p tcp -- dport 22-j ACCEPT
Then save:
#/Etc/rc. d/init. d/iptables save
If the above steps are not complete, it may be that the iptables file uses include call.
Generally, this path is/etc/sysconfig/iptables.
Open this file and manually add it.

Port viewing method:
#/Etc/init. d/iptables status
Some firewall commands are also presented
Service iptables start | restart | stop | status
Service iptables panic is equivalent to clearing the rules
Serviceiptables condrestart: iptables additional Module: ip_conntrack_netbios_n
The service iptablessave is saved so the rule is to/etc/sysconfig/iptables. note:

Port 80
HTTP (HyperText Transport Protocol) is the HyperText Transfer Protocol, which is the most frequently used Protocol for surfing the Internet. it is mainly used for WWW (WorldWideWeb), that is, the world wide web transmission information Protocol. You can access the website by adding ": 80" to the HTTP address (commonly referred to as "URL"). because the default port number of the browser web service is 80, enter the URL, you do not need to enter ": 80.

Port 22
Is an SSH remote connection interface
SSH is short for Secure Shell, developed by the Network Working Group of IETF. SSH is a security protocol built on the application layer and transport layer. SSH is a reliable protocol designed for remote logon sessions and other network services. The SSH protocol can effectively prevent information leakage during remote management. S h was initially a program on the u n ix system, and then quickly expanded to other operating platforms. S h can make up for vulnerabilities in the network when used correctly. The s h client is suitable for multiple platforms. Almost all un I x platforms-including h p-u x, L I n u x, a I x, S o l a r I s, Digital UNIX, I ri x, and other platforms-run s h.

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.