Default SSH key for created CTs

yatesco

Renowned Member
Sep 25, 2009
230
10
83
Hi, is there a way I can automatically add an SSH public key to any created CTs? At the moment I am manually uploading my key when I create the CT but this doesn't work when I use the excellent community scripts?
 
Hi,

yes, either via the web interface in the "Create CT" wizard or via the --ssh-public-keys option of pct(1).

but this doesn't work when I use the excellent community scripts?
Please ask their authors at their repository/forum/etc.
 
  • Like
Reactions: yatesco
thanks @cheiss. Do you envisage Proxmox supporting a "default SSH key to be added to CTs" which is then honoured by `pct`? If not, can I ask please, please, pretty, pretty, please, please :-)
 
  • Like
Reactions: yatesco
I appreciate you don't maintain the community scripts - I'm asking about functionality within core Proxmox ;-).
 
It is supported via the Proxmox web GUI and via the Proxmox command line tools and the Proxmox API. Can you explain where else you want Proxmox to support this?

at the moment the SSH key needs to be specified whenever it is referenced, which means every _use_ of `pct` to create a CT, for example, requires changing.

If Proxmox would allow me, at any point, to upload and persist a "default" SSH key, then whenever `pct` is used to create a CT it can check if this "default" key exists, and if so, use that.

This means, as a user, I upload the SSH key once, and then _however_ I create CTs, as long as something uses `pct`, the SSH key gets added.

Specifically:
- Proxmox GUI has a new option: "upload SSH key to be added automatically to new CTs"
- `pct` is updated to check for the presence of this key, and if it exists, automatically adds it to the CT

Does that make sense?
 
If Proxmox would allow me, at any point, to upload and persist a "default" SSH key, then whenever `pct` is used to create a CT it can check if this "default" key exists, and if so, use that.
Put the default ssh-key in a fixed location and write a simple script to create your containers with it? But maybe that brings us back to: somebody please write a (community) script for you that does that.
 
  • Like
Reactions: yatesco
yes, exactly, it requires updating every script :-). I'm surprised nobody has asked for this before as it seems such a simple and obvious use-case?