CentOS 7 sshd link rejected problem solution

  • 2020-06-07 05:44:27
  • OfStack

1, the server is not connected


ssh: connect to host XXXXX port 22: Connection refused

The reason is that centos7 has changed the linked port to 2200.


#Port 22
Port 2200

Modify to go back, or use the 2200 link.

Modified: vi /etc/ssh/sshd_config

2. centos7 installs a firewall instead of iptables by default

Because this is a local test, close the firewall directly and disable boot.


systemctl stop firewalld
systemctl disable firewalld

3. Close selinux

vi /etc/selinux/config

Modify the following


#SELINUX=enforcing # Comment out the 

#SELINUXTYPE=targeted # Comment out the 

SELINUX=disabled # increase 

Thank you for reading, I hope to help you, thank you for your support to this site!


Related articles: