PuTTY/Xshell连接远程服务器提示connection time out的解决方案

刚注册一台云服务器时,想使用PuTTY/Xshell来在本地远程连接服务器,发现会出现以下错误提示:


Network error: Connection time out

PuTTY/Xshell连接远程服务器提示connection time out的解决方案

PuTTY/Xshell连接远程服务器提示connection time out的解决方案


对于新注册的云服务器,什么都没有配置,不存在什么防火墙设置、端口占用的情况。

在本地ping云服务器的公共ip,失败;

在云服务器ping本地的ip,也失败。


在网上找了很多解决方案都没办法,后来自己才解决了。


连接失败的问题是,云服务器的安全组规则没有配置


解决方法:

以阿里云服务器为例。

进入安全组配置;

PuTTY/Xshell连接远程服务器提示connection time out的解决方案PuTTY/Xshell连接远程服务器提示connection time out的解决方案


添加规则;

PuTTY/Xshell连接远程服务器提示connection time out的解决方案PuTTY/Xshell连接远程服务器提示connection time out的解决方案


开放SSH的22端口,

授权策略设置为允许;

填写授权对象,如填写'0.0.0.0/0',表示所有ip都可以访问到服务器。具体规则点击‘教我设置’查看。

PuTTY/Xshell连接远程服务器提示connection time out的解决方案PuTTY/Xshell连接远程服务器提示connection time out的解决方案


添加完安全组规则后,便可以使用PuTTY/Xshell连接远程服务器了。