Xshell Could not connect to 'x.x.x.x' (port 22): Connection failed.

问题:Could not connect to 'x.x.x.x' (port 22): Connection failed. 

解决方案

1.阿里云安全组规则是否启用

2.ssh服务是否开启

2.1 登陆到虚拟机查看目前服务器开放的端口:ss -lnt

没有22端口,那就启动SSH服务,启动命令:service sshd restart

3.防火墙有没有开通22端口

# 查询端口是否开放
firewall-cmd --query-port=22/tcp
# 开放22端口
firewall-cmd --permanent --add-port=22/tcp

#重启防火墙(修改配置后要重启防火墙)
firewall-cmd --reload

4.未安装ssh-server服务器

安装命令:yum install openssh-server

 

posted @ 2019-04-10 18:57  好兵  阅读(914)  评论(0)    收藏  举报