EC2 instance launched from AMI not reachable(ssh)

2019-04-08 00:30发布

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

./

2条回答
▲ chillily
2楼-- · 2019-04-08 00:47

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.

查看更多
爱情/是我丢掉的垃圾
3楼-- · 2019-04-08 01:05

Also comment following lines in /etc/ssh/sshd_config

permitrootlogin without-password
permitrootlogin without-passwordUseDNS no
查看更多
登录 后发表回答