[英]Unable to connect to AWS EC2 Instance - Connection Refused
I am new to AWS.我是 AWS 的新手。 I created a new AWS account and created an AWS Linux ESC2 instance and connected through SSH connection.
我创建了一个新的 AWS 账户并创建了一个 AWS Linux ESC2 实例并通过 SSH 连接进行连接。 I could run and install new libraries in python 3.7 as well.
我也可以在 python 3.7 中运行和安装新库。 But then I tried to transfer a file to the instance using scp and since then I am not able to connect to the EC2 instance.
但是后来我尝试使用 scp 将文件传输到实例,从那时起我无法连接到 EC2 实例。 This is the error I get:
这是我得到的错误:
OpenSSH_8.6p1, LibreSSL 2.8.3
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts' -> '/Users/../.ssh/known_hosts'
debug3: expanded UserKnownHostsFile '~/.ssh/known_hosts2' -> '/Users/../.ssh/known_hosts2'
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to ec2-{}.us-east-2.compute.amazonaws.com port 22.
ssh: connect to host ec2-{}.us-east-2.compute.amazonaws.com port 22: Connection refused
When I try to ping the server using this:当我尝试使用此 ping 服务器时:
curl -XGET '{Public IPv4 address}:22'
I get the same error:我犯了同样的错误:
curl: (7) Failed to connect to {Public IPv4 address} port 22: Connection refused
I have already tried rebooting and restarting the instance and also I have already put my IP address in the inbound rules so that it is allowed but still I am not able to connect.我已经尝试重新启动和重新启动实例,并且我已经将我的 IP 地址放在入站规则中,以便允许它,但我仍然无法连接。
Any suggestions?有什么建议?
Possible reasons -可能的原因——
Possible resolutions -可能的解决方案 -
For more details how to solve this problem, please take a look at this aws page .有关如何解决此问题的更多详细信息,请查看此aws 页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.