欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  网络运营

CentOS 7 sshd 链接被拒绝问题解决办法

程序员文章站 2022-06-20 21:09:07
1,服务器链接不上 ssh: connect to host xxxxx port 22: connection refused 原因,centos7...

1,服务器链接不上

ssh: connect to host xxxxx port 22: connection refused

原因,centos7 修改了链接的端口变成 2200了。

#port 22
port 2200

修改回去,或使用2200链接。

修改:vi /etc/ssh/sshd_config

2,centos7默认安装了防火墙不是iptables了

因为是本地测试,所以直接关闭防火墙,禁用开机启动。

systemctl stop firewalld
systemctl disable firewalld

3,关闭selinux

vi /etc/selinux/config

修改以下内容

#selinux=enforcing #注释掉

#selinuxtype=targeted #注释掉

selinux=disabled #增加

感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!