By using AWS re:Post, you agree to the Terms of Use
/Stopped instance restarted - unable to login/

Stopped instance restarted - unable to login


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)?

asked 21 days ago59 views
2 Answers


"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 :

answered 20 days ago
  • 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.


Here is an article on connection refused error. See if it helps:

answered 20 days ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions