Stopped instance restarted - unable to login

0

I have TWO EC2 instances that I have been using for more than a month. 2 wks ago - I STOPPED both instances.

Today - when I try to start the instances - I am not able to login (ssh) into that machine --- 20min after 2/2 checks have passed. I tried to START those instances last week as well --- and had the same issue.

  • Both instances have Elastic-IP addresses.
  • Both machines are standard g4dn.xlarge instances.
  • Both machines had free-disk-space (10G+) when they were stopped.
  • Both machines have magnetic/spinning disks (so they take a little longer to spin up)
  • Console shows that 2/2 checks have passed.
  • I have enabled ICMP-ALL on that instance and I CAN ping that machine => IP-stack is UP
  • Security group assigned to that instance has the SSH port OPEN.
  • I have that same security group assigned to other instances and I am able to login to those instances => not a security-group issue
  • Trying to ssh into that machine - I get a "Connection refused" error on port 22.
$ ssh -i <pem-file> ubuntu@<static-ip-of-instance>
ssh: connect to host <static-ip-of-instance> port 22: Connection refused

Is there some kind of ongoing issue with AWS EC@ g4dn.xlarge instances (I have run into AWS capacity issues for this instance-type in the past)?

pk-dori
질문됨 2년 전352회 조회
2개 답변
0

Hi

"ssh: connect to host <static-ip-of-instance> port 22: Connection refused" This message comes from a host remotely.

The following are common causes for this error:

The host reached the instance but there was no service listening on the SSH port.
A firewall blocked and was set to reject the package instead of dropping it.

Please Verify the following:

There isn't a firewall blocking the connection.
The SSH service is running on the instance.
The SSH TCP port 22 is in the listening state.
The server's IP address or hostname.
The security group and network ACLs allow incoming traffic on TCP port 22.

please refer to this link for steps on troubleshooting the issue :https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-resolve-ssh-connection-errors/

steven
답변함 2년 전
  • Thank you for your suggestions:

    • There is no firewall blocking the connection
    • SSH in the security-group is OPEN
    • Server IP is an elastic-IP and has not changed; I am logging into the correct instance
    • Yes, security-group allows incoming SSH

    Regarding verifying that SSH is actually running on a port is something of a catch22 situation. Unless I login to the machine - I cannot tell if the SSH service is running. Is there another way for me to login to that instance? If so, that would be something to try.

0

Here is an article on connection refused error. See if it helps:
https://aws.amazon.com/premiumsupport/knowledge-center/ec2-linux-resolve-ssh-connection-errors/

답변함 2년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠