AWS ssh连接拒绝 [英] aws ssh connection refused

查看:899
本文介绍了AWS ssh连接拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了来自AMI现货例如,通过一个朋友提供的。

I've created a spot instance from an AMI provided by a friend.

我确定安全组包含以下规则(入站和出站):

I made sure the security group contains the following rules (both inbound and outbound):

  1. 在SSH通过TCP协议在端口22从任何地方(0.0.0.0/0)
  2. 在所有交通(协议:所有,端口范围:0-65535从任何地方)
  3. 所有ICMP(协议:ICMP,端口范围:0-65535从任何地方)

不过,想从我的电脑用ssh的时候,我得到了以下错误:

However, when trying to ssh from my pc, I get the following error:

SSH:连接到主机xxx.xxx.xxx.xxx端口22:连接被拒绝

ssh: connect to host xxx.xxx.xxx.xxx port 22: Connection refused

我可以ping通的机器,但我不能SSH(无论哪个用户或PEM文件我试试)。我也尝试了常规的实例,并出现了同样的问题。

I can ping to the machine, but I can't ssh (no matter which user or which pem file I try). I also tried a regular instance and the same problem occurred.

任何意见?

谢谢!

吉尔。

推荐答案

同时检查安全组和负载平衡器。有多个位置需要通过允许SSH流量。

Check both the security group and the load balancer. There are multiple places you need to allow the SSH traffic through.

你能远程连接到服务器的另一种方式?如果是这样,一旦你在运行须藤netstat的-plutn

Can you remotely connect to the server another way? If so, once you get in, run sudo netstat -plutn.

您应该看到sshd的至少一个条目。如果不这样做,sshd的不运行。如果你这样做,注意在本地地址的端口。如果不是22,指定当SSH登录到特定端口。即:如果是4444,那么你需要做的 SSH根@ [your_ip_address] -p 4444

You should see at least one entry for sshd. If you don't, sshd isn't running. If you do, note the port under 'Local Address'. If it's not 22, specify the specific port when you ssh. Ie: if it's 4444, then you'll need to do ssh root@[your_ip_address] -p 4444.

希望帮助!

这篇关于AWS ssh连接拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆