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)?
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/
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/
Relevant questions
AWS Backup - two ec2 instances are assigned as the protected services - but I see an EBS snapshot in the vault?
asked 6 months agoRDS Aurora does not start an instance that I had stopped, it has status starting and does not let me do anything
asked 3 months agoInstances stuck in shutting down
Accepted Answerasked 3 years agoec2 server instances unresponsive
asked a month agoEC2 Dashboard says I have NO INSTANCES
asked 2 years agoDo I get charged for stopped instances?
Accepted Answerasked 5 years agoStopped instance restarted - unable to login
asked 21 days agoTwo EC2 Instances stuck "stopping"
asked 2 years agoEC2 instance stopped unexpectedly in a multi account environment
asked 7 months agoWhy are GameLift EC2 instances more expensive than regular EC2 instances?
asked 10 days ago
Thank you for your suggestions:
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.