SSH Connect Service Error: Could not connect to ‘xxx.xxx.xx.xx‘ (port 22): Connection failed.

It was strange to report an error when connecting to SSH service this morning

I have searched a lot of information from Baidu. Now I collect and sort out some useful solutions for you

1. Restart CentOS
2 Restart VMware
3 Firewall problem:
solution:
(1) check the firewall: Service iptables status
(2) close the firewall first: /etc/init.d/iptables stop
(3) open firewall: Service iptables start
Start: systemctl start firewalld (centos7 user)
Close: systemctl stop firewalld (centos7 user)
4 Query whether port 22 is enabled

Query all open port commands

  firewall-cmd --zone=public --list-ports

Permanently open port 22

  firewall-cmd --zone=public --add-port=80/tcp --permanent 

Reload

firewall-cmd --reload

5. Query whether SSH is installed on the Linux server

yum install openssh-server

6. Query whether SELinux is started
modify the file in /etc/selinux/config and set SELINUX = disabled:

Read More: