Debian 12 cloud image SSH key
-
Hi
I have follows the instructions from https://xcp-ng.org/forum/topic/9943/after-days-of-research-and-tinkering-a-working-guide-for-debian-12-template-with-cloud-init-and-dhcp and i cloned a Debian 12 VM and attached the cloud image and created a template. When i add my ed25519 ssh keys from the template and boot the new VM i am refused to login via ssh.
-
@hypernoob I suggest this procedure instead:
- Get the Debian
genericcloud
QCOW2 image off of here: https://cdimage.debian.org/images/cloud/ - Convert to VHD:
qemu-img convert -O vpc debian-12-genericcloud-amd64.qcow2 debian-12-genericcloud-amd64.vhd
- Import the converted VHD into XO
- Attach to empty Debian VM, set to boot from hard drive and convert to template
- Create new VMs from this template, adding your ssh keys and guest agent in cloud config if desired:
#cloud-config hostname: {name} ssh_authorized_keys: - ssh-rsa ... apt: sources: xen-guest-agent: filename: xen-guest-agent.list source: deb [trusted=yes] https://gitlab.com/api/v4/projects/xen-project%252Fxen-guest-agent/packages/generic/deb-amd64/ release/ append: false packages: - xen-guest-agent
The same procedure will work with Ubuntu, Alma and other cloud images.
- Get the Debian
-
Hi dinhngtu
I think i have found the problem. The end of the ssh key has 'bastion production' at the end of the key and i believe this is the wrong format for cloud init, all of the other parts of the configuration file work as xen orchestra indicated that the guest utils are installed. It a bit of a pain to regenerate the keys because i have a lot of devices i connect too.
-
@hypernoob That's just the key's name, I use keys with long complicated names too and had no problem. What did
ssh -vv
tell you? -
yeah that would be it. It was logging in as the local machines username, i changed it to debian and it work. My forum username says i all.
Thanks @dinhngtu
-
haha we were all noobs when we started, it's fine