Feature request: pre-set SSH keys

merlin-vrn

Member
Feb 10, 2020
14
0
21
42
When creating container there is an option to enter root password or upload SSH public keys. That is very useful; what is inconvenient is that one needs to find their keys each time.

What would be convenient if we had a way to set up "default" keys in advance in e.g. user profile, and then have an option to roll out the "default" keys during creation.

In principle it's possible to do with the password too (by storing and applying the hash in the same way), though I doubt it's secure enough.
 
Hello,

In the command line, you can use 'pct' with its appropriate option :
--ssh-public-keys <filepath>
Setup public SSH keys (one key per line, OpenSSH format).
( See : https://pve.proxmox.com/pve-docs/pct.1.html)
Then script it, so it applies with the same key each time you create a container.

At this point it may be handier to create a container template with all the options you wish (create a 'normal' user for instance, with appropriate password, (sudo-) rights and ssh keys) and spawn your container from that template.
Another option would be to write an ansible playbook for that purpose.

Kind regards,

GD
 
Last edited: