在将模板升级到 RHEL 8.7 或 9 后,无法 SSH 到新的虚拟机
Issue
- 在升级到 RHEL 8.7、9 或更高版本后,无法 SSH 到虚拟机。
- 首次启动过程中,sshd 无法在新虚拟机上启动:
Nov 29 08:49:18 rhel8 systemd[1]: Starting OpenSSH server daemon...
Nov 29 08:49:18 rhel8 sshd[2946]: Unable to load host key: /etc/ssh/ssh_host_rsa_key
Nov 29 08:49:18 rhel8 sshd[2946]: Unable to load host key: /etc/ssh/ssh_host_ecdsa_key
Nov 29 08:49:18 rhel8 sshd[2946]: Unable to load host key: /etc/ssh/ssh_host_ed25519_key
Nov 29 08:49:18 rhel8 sshd[2946]: sshd: no hostkeys available -- exiting.
Nov 29 08:49:18 rhel8 systemd[1]: sshd.service: Main process exited, code=exited, status=1/FAILURE
Nov 29 08:49:18 rhel8 systemd[1]: sshd.service: Failed with result 'exit-code'.
Nov 29 08:49:18 rhel8 systemd[1]: Failed to start OpenSSH server daemon.
Environment
- Red Hat Enterprise Linux (RHEL) 9
- cloud-init-22.1-5 或更高版本(9.1)
- cloud-init-21.1-10 或更高版本(9.0)
- Red Hat Enterprise Linux (RHEL) 8
- cloud-init-22.1-5 或更高版本(8.7)
- 配置文件 cloud.cfg 最初在带有 cloud-init-20.3-10 或更早版本的 RHEL 8.4 上创建的
- Red Hat Virtualization 4
- Red Hat OpenStack Platform 16
- Red Hat OpenShift Container Platform 4
- Amazon AWS
- Microsoft Azure
- Google Cloud Platform
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.