Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EC2 instance launched from AMI not reachable(ssh) after start/stop or reboot

When we launch an instance from an AMI. At first the instance is accessible(ssh). Once we stop/start the instance or reboot it the machine becomes inaccessible via ssh,we can ping it though. We see below error in System log.

AMI ID used - ami-72dc9220
Instance - i-0896a15f - 

Linux rhel6.4 M1.large instance.
../

******************* BLKFRONT for device/vbd/2049 **********
backend at /local/domain/0/backend/vbd/236/2049
Failed to read /local/domain/0/backend/vbd/236/2049/feature-barrier.
Failed to read /local/domain/0/backend/vbd/236/2049/feature-flush-cache.
14680064 sectors of 512 bytes
**************************
Thread "kbdfront": pointer: 0x21e0130010, stack: 0x3720000
FBFRONT for device/vfb/0 **********
KBDFRONT for device/vkbd/0 **********
Failed to read device/vfb/0/backend-id.
Failed to read device/vkbd/0/backend-id.
Error ENOENT when reading the backend path device/vkbd/0/backend
Thread "kbdfront" exited.
Error ENOENT when reading the backend path device/vfb/0/backend

./
like image 942
Ashwani Kumar Avatar asked Jun 25 '13 11:06

Ashwani Kumar


1 Answers

Was able to fix this. This is due to a bug from REDHAT for 6.4 rhel instances. After launching the machine from an AMI, connect to the machine and switch to root user and make below changes to /etc/rc.d/rc.local file ...

Remove the following three lines and save the file:

cat <<EOL >> /etc/ssh/sshd_config 
UseDNS no 
PermitRootLogin without-password
../

One should also remove garbage entries from /etc/ssh/sshd_config file.

The machine once rebooted after these changes works fine.

like image 158
Ashwani Kumar Avatar answered Sep 23 '22 07:09

Ashwani Kumar