Home > Enterprise >  Unable to SSH into EC2 server after reboot
Unable to SSH into EC2 server after reboot

Time:10-14

I have an ubuntu 18.04 based EC2 instance using an Elastic IP Address. I am able to SSH into the instance without any problems.

apt is executing some unattended updates on the instance. If I reboot the system after the updates, I am no longer able to SSH into the system. I am getting the error ssh: connect to host XXX port 22: Connection refused

Few points:

  1. Even after the updates, I am able to SSH before the reboot
  2. Method of restart does not make a difference. sudo shutdown -r now and EC2 dashboard have the same result.
  3. There are no problems with sshd_config. I've detached the volume and attached it to a new working instance. sshd -t did not report any problems either
  4. I am able to do sudo systemctl restart ssh.service after the updates but before the system restart.
  5. I've tried with and without Elastic IP. Same result
  6. From the system logs, I see that SSH is trying to start, but failing for some reason

I want to find out why the ssh daemon is not starting. Any pointers?

Update:

  1. System Logs
  2. Client Logs
  3. No changes in the security groups before and after reboot

CodePudding user response:

EC2 > Network & Security > Security Groups > Edit inblound rules > SSH 0.0.0.0/0

CodePudding user response:

Step 1: EC2 > Instances > Actions > Image and templates > Create image

Step 2: Launch a new instance using the AMI image.

  • Related