CentOS 7 Turn off firewall on

Source: Internet
Author: User
Tags ssh port

Because learning requires VMS to be installed, it is cumbersome to switch back and forth with Ctrl+alt with virtual machine operations. It's much more comfortable to use SSH to connect to terminal. However, if you do not shut down the firewall ssh will appear not even fine.


The following example is about viewing ssh and shutting down the iptables firewall operation.


1. First step: After the installation of Linux, we need to use the SS command to see if the 22 port (SSH working port number) is open properly. In theory, after the CentOS 7 installation is complete, SSH Port 22nd is open by default.

The SS command is used to display the active state of the socket information, the function is similar to the netstat command function, but the SS performance is better than Netstar.

# for performance analysis, refer to the article: http://blog.csdn.net/hustsselbj/article/details/47438781 #

# SS Command Description can refer to article: http://blog.csdn.net/hustsselbj/article/details/47438781 #

[[email protected] ~]# SS-TNL #-t only shows TCP sockets;-N does not resolve service name, displays digitally;-l lists all network connection ports #
State recv-q send-q Local address:port Peer address:port
LISTEN 0 *:22 *:* #ssh服务已启用
LISTEN 0 127.0.0.1:25 *:*
LISTEN 0::: £ º::* #ssh服务已启用
LISTEN 0 100:: 1:25



If not open please refer to the following:

The first step

#查看本机是否安装SSH软件包

[Email protected] ~]# Rpm-qa | grep ssh
Openssh-6.6.1p1-31.el7.x86_64
Libssh2-1.4.3-10.el7_2.1.x86_64
Openssh-clients-6.6.1p1-31.el7.x86_64
Penssh-server-6.6.1p1-31.el7.x86_64


#如果没有, you need to install

[email protected]/]# Yum install openssh-server

Step Two

#开启 SSH Service

[email protected] ~]# systemctl start Sshd.service




2nd Step Check Iptables Firewall

# iptables Command Description reference: Http://man.linuxde.net/iptables #

~]# iptables-l-N #查看防火墙列表
~]# iptables-f #单次中止防火墙功能

3rd Step off Iptables Firewall

~]# systemctl Stop firewalld.service #关闭防火墙服务 #

This article is from the "and listen to the Wind Yin" blog, please be sure to keep this source http://ybbdd.blog.51cto.com/843230/1892704

CentOS 7 Turn off firewall on

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.