cloud-init and ssh hostkeys

DeanMurphy

New Member
Feb 13, 2025
1
0
1
After removing the hostkeys from /etc/ssh and generating a template, cloud-init generates new hostkeys according to /var/log/cloud-init-output.log but the keys are not written to /etc/ssh/.
Because there are no hostkeys, ssh.service does not start.
I can get around this by using the noVNC shell and running
sudo dpkg-reconfigure openssh-server
but that is just a work-around and prevents remote logins until new keys are generated and the ssh.service is started.
Is this a bug or is there a solution?
 
Hu @DeanMurphy , welcome to the forum.

The VM’s operating system and the CloudInit package running inside it are completely independent of the hypervisor.
The hypervisor only supplies the configuration file (automatically or custom-built).

Creating a template is not specific to Proxmox. It might help to review the steps in your current guide or consider finding an alternative tutorial.

Cheers,


Blockbridge : Ultra low latency all-NVME shared storage for Proxmox - https://www.blockbridge.com/proxmox