Ec2 Instance Launched from Ami Not Reachable(Ssh) After Start/Stop or Reboot

Running EC2 instance suddenly refuses SSH connection

With the help of @abhi.gupta200297, we were able to resolve it.

The issue was the error in /etc/fstab, and sshd was supposed to be started after fstab is successful. But it wasn't, hence, the sshd wouldn't start and that's why it was refusing the connection. Solution was to create a temporary instance, mount the root EBS from the original instance, and comment out stuff from the fstab and voila, it's letting me connect again. And for the future, I just stopped using fstab and created bunch of shell commands to mount the EBS volumes to directories and added them in /etc/init.d/ebs-init-mount file and then run update-rc.d ebs-init-mount defaults to initialize the file and I'm no longer having issues with locked ssh.

UPDATE 4/23/2015

Amazon team created a video tutorial of similar issue and show how to debug using this method: https://www.youtube.com/watch?v=_P29ZHu_feU

Possible reasons for timeout when trying to access EC2 instance

Did you set an appropriate security group for the instance? I.e. one that allows access from your network to port 22 on the instance. (By default all traffic is disallowed.)

Update: Ok, not a security group issue. But does the problem persist if you launch up another instance from the same AMI and try to access that? Maybe this particular EC2 instance just randomly failed somehow – it is only matter of time that something like that happens. (Recommended reading: Architecting for the Cloud: Best Practices (PDF), a paper by Jinesh Varia who is a web services evangelist at Amazon. See especially the section titled "Design for failure and nothing will fail".)

Unable to SSH into EC2 server after reboot

I missed the error Failed to start Create Static Device Nodes in /dev. in system logs. The solution given at https://askubuntu.com/questions/1301750/ubuntu-16-04-failed-to-start-create-static-device-nodes-in-dev helped solve my problem

Amazon EC2 micro instance not responding

There are several possibilities, but the two most likely are:

  1. High load on the host that your Micro instance is running on - Micro instances get a small slice of resources anyway, and get scaled back quite harshly when the host is under load.

  2. A fault has occurred on the host which is impacting VM responsiveness - this is actually relatively common, and can exhibit the type of behaviour you're seeing.

In either case, the quickest solution is to nuke the instance and restart it - you'll likely get a new instance on a different host, which may be less stressed or less broken. ;)

EC2 instance connect : There was a problem setting up the instance connection

In order to connect to your instance with "EC2 Instance Connect (browser-based SSH connection)" you need to install ec2-instance-connect to your AMI.

Try connecting to your instance via "A standalone SSH client" (eg. putty) and installing it with a command:

sudo yum install ec2-instance-connect

or (for Ubuntu):

sudo apt-get install ec2-instance-connect 

To me this worked, and I could then easily access my instance via browser next time.

The more detailed explanation is found here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-connect-set-up.html



Related Topics



Leave a reply



Submit