Cloning container templates: SSH host key regeneration

tok1

Member
May 3, 2020
9
0
6
54
Hi,

I noticed a disturbing/surprising behavior of Proxmox when creating linked/full clones from container templates: SSH host keys are not regenerated during cloning process. Isn't this something fundamental that would make sense as functionality? Maybe I missed something.

I verified both with a template already containing host keys (=the clone has still the same keys) as well as a template where I deleted all host keys before the conversion (=the clone ends up without keys too). In contrast, Proxmox does generate host keys when creating a new container from a built-in tgz template. Could this procedure be adapted to also cover template cloning (linked, full)?

And yes, I could prepare my container template so a systemd unit runs ssh-keygen -A inside of the container before launching sshd (e.g. Debian does not do this by default because of entropy concerns). Yet it might make more sense for Proxmox to properly take care of that instead?

Regards
 
hi,

I noticed a disturbing/surprising behavior of Proxmox when creating linked/full clones from container templates: SSH host keys are not regenerated during cloning process. Isn't this something fundamental that would make sense as functionality? Maybe I missed something.

how is it surprising? a clone is a clone. it's literally copying the disk. that means the stuff in the filesystem (like ssh keys) will be the same.
 
You are right, this may be a false expectation from my side. Would be nice though to either use existing functionality for this use case too, or being able to hook into the cloning process.

Regards
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!