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