Help for owners
My AWS server restarted and now the site and SSH do not respond
Short answer
After a restart the server may have a new public address, failed its status checks, or be blocked by a firewall rule that no longer matches your IP. AWS advises checking that the instance is running and has passed its status checks, then the security group rules, route table and network ACL. Do not terminate the instance.
Does this sound like your situation?
- The website on my AWS server stopped loading after a restart.
- My developer says the connection times out.
- The server shows running in the console but nothing answers.
- The address I used before no longer works.
- I am told the SSH key is lost or does not work.
Why does this happen?
The server is not actually ready
AWS says to verify that the instance is in the running state and has passed its status checks, because a newly started instance can take a few minutes before it accepts connections. Running does not mean healthy.
Confirmed by docs.aws.amazon.com
A firewall rule no longer matches
A security group needs an inbound rule from the connecting computer's address on the right port. If the rule allows one single IP address and your internet provider gives you a new one, the rule stops matching and the connection times out.
Confirmed by docs.aws.amazon.com
The network path or public address is missing
Route tables need a route to the internet gateway, network ACLs must allow the traffic, and the instance needs a public IPv4 address. AWS suggests an Elastic IP address when it has none, so the address does not change.
Confirmed by docs.aws.amazon.com
Wrong user name or key
Each server image has a default user name and a key pair it was launched with. A wrong user name or a different key file gives permission denied. AWS also notes that changed file permissions on the server's home folder can break key login.
Confirmed by docs.aws.amazon.com
The app did not start by itself
The machine boots but the web server, app or database was never set to start automatically, so the server answers pings but the site is down.
What can I do about it today?
- Look at the instance state and status checksIn the EC2 console, check the Instance state is running and the Status check column shows all checks passed. Screenshot both.
- Wait a few minutes after a restartAWS notes a server can take a few minutes to accept connections. Wait, then check again before changing anything.
- Check the addressCompare the server's current public address with the one your site or domain points to. A mismatch is a common reason a site looks dead.
- Do not terminate or delete the instanceTerminate deletes the server. A stop or reboot is reversible. If anyone suggests deleting it to start over, ask for a snapshot first.
- Ask who has the key fileThe key file is the only normal way in. Find out who holds it and whether it was stored safely.
- Check the AWS Health DashboardIf a service event matches the time, it may not be your server at all.
When should I bring someone in?
- Status checks are failing, not passing.
- The key file is lost or the one person who had access is gone.
- There is no backup or snapshot of this server.
How do I handle it?
- Snapshot firstIf the disk is reachable I take a snapshot before touching settings, so every step can be undone.
- Check from the outside inInstance status, address, security group, route table and network ACL, in that order, each recorded.
- Use the console route if keys failWhere a key is lost, I use AWS's documented way of attaching the disk to a temporary server and adding a new key, then removing the temporary one.
- Make the app start itselfI set services to start on boot and test it with a real restart at a quiet moment.
- Give you a stable address and a written recovery noteAn Elastic IP where it fits, and a one-page note on how to check the server.
The price depends on what I find, so I quote in writing after a short discovery call. Tell me what is happening and I reply within 24 hours.
What do owners ask about this?
Is my data lost?
Usually not. A restart keeps the disk. The exception AWS notes is instance store volumes, whose data is lost when an instance is stopped.
I lost the key file. Is the server gone?
For servers with an EBS root volume, AWS documents a way to regain access by moving the volume to a temporary instance. It does not work for instance store root volumes.
Why does it time out instead of refusing?
A timeout usually points to a blocked network path such as a firewall rule or route, not to a wrong password.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Found a mistake? Tell me.
For your developer: the technical fixes
ssh: connect to host 203.0.113.25 port 22: Connection timed outssh to an EC2 instance hangs and ends in Connection timed outPermission denied (publickey,gssapi-keyex,gssapi-with-mic).SSH to an EC2 instance fails with Permission denied (publickey,gssapi-keyex,gssapi-with-mic)Please login as the user "ec2-user" rather than the user "root".SSH to EC2 fails: refused key, or told to log in as ec2-user not root@ WARNING: UNPROTECTED PRIVATE KEY FILE! @ssh ignores your EC2 .pem file because its permissions are too open