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

与世无争的帅哥 提交于 2019-12-06 00:29:57

问题


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

./

回答1:


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.




回答2:


Also comment following lines in /etc/ssh/sshd_config

permitrootlogin without-password
permitrootlogin without-passwordUseDNS no


来源:https://stackoverflow.com/questions/17296655/ec2-instance-launched-from-ami-not-reachablessh-after-start-stop-or-reboot

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!