0 votes
1 view
in AWS by (5.8k points)

I've set up the EC2 instance couple days ago and even last night I was able to SSH to it with no problems. Today morning, I can't ssh to it. Port 22 is already open in the security group and I haven't changed anything since last night.

Error:

ssh: connect to host [ip address] port 22: Connection refused

I had similar issue recently and i couldn't figure out why it was happening, so I had to create a new instance, set it up again, and connect and configure all EBS storages to the new one. Took me couple hours... and now it's happening again. In the previous one, I've installed denyhost, which might have blocked me, but in the current one, there are only apache2, and mysql running.

The current instance has been up for 16 hours now, so I don't think it's because it didn't finish booting... Also, port 22 is open to all sources (0.0.0.0/0) and is using tcp protocol.

Any ideas?

Thanks.

1 Answer

0 votes
by (18.5k points)

Seems to me that the sshd has stopped. One reason could be that the sshd was supposed to be started after the fstab is successful. But it wasn't and that's why it's now refusing the connection.

To resolve this issue you can just stop using fstab or create a temporary instance, mount EBS from the original instance and comment out stuff from fstab. Now you will be able to connect again.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...