linux - 启动/停止或重启后无法访问 (ssh) 从 AMI 启动的 EC2 实例

标签 linux amazon-web-services amazon-ec2 rhel amazon-ami

当我们从 AMI 启动实例时。起初实例是可访问的(ssh)。一旦我们停止/启动实例或重新启动它,机器就无法通过 ssh 访问,但我们可以 ping 它。我们在系统日志中看到以下错误。

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

./

最佳答案

能够解决这个问题。这是由于 a bug from REDHAT for 6.4 rhel instances . 从 AMI 启动机器后,连接到机器并切换到 root 用户并对 /etc/rc.d/rc.local 文件进行以下更改 ...

删除以下三行并保存文件:

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

还应该从 /etc/ssh/sshd_config 文件中删除垃圾条目。

机器在这些更改后重新启动后工作正常。

关于linux - 启动/停止或重启后无法访问 (ssh) 从 AMI 启动的 EC2 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17296655/

相关文章:

linux - dbus_bus_request_name () : Connections are not allowed to own the service

c - 在linux环境下模拟不同IP地址的不同PC

powershell - Amazon Web Service PowerShell 凭据设置错误

python - 调用StartInstances操作时发生客户端错误(UnauthorizedOperation)

node.js - 将 ReactJs 前端 + NodeJs 后端部署到 AWS

linux - 如何从 Linux 运行 shell 文件的位置获取路径?

linux - 如何在 shell 脚本中获取我的公共(public) IP 地址?

ruby-on-rails - 如何修复部署 AWS eb 的 "Your Ruby version is 2.5.3, but your Gemfile specified 2.5.1"?

amazon-web-services - 如何监控 ECS 任务循环?

nginx - 如何在 Amazon EC2 AMI 实例上使用 nginx 一致地设置 PHP-FPM 5.6