Hi,
I'm trying to write a small script that'll automatically run "pct create" commands for me, so that I can set up containers a bit quicker and easily, and in order to figure out how promox' commands work.
I have, however, run into a small issue: I can't figure out how to specify more than one public ssh key (if that is at all possible). According to the manpage, I can use the option --ssh-public-key with "one file per line" in order to specify multiple ssh keys for the container, but I can't get it to work.
I have tried the following approaches so far:
Use the --ssh-public-key option twice (doesn't work, as expected only public key in specified with the second option is actually added)
Separate the files with a comma (i.e. --ssh-public-key <file1>,<file2>, didn't work as file can't be found due to comma)
I'm using PVE 6.1, and pveversion says I'm running "pve-manager/6.1-7/13e58d5e (running kernel: 5.3.18-2-pve)"
Another option would be to add a second SSH key after creating the container by pushing a new authorized_keys to the container or editing the file, but I think the one-command approach would be nicer, so I hope someone knows the solution.
Thank you in advance (and thank you for the amazing product. Have only been using it at home so far, but it's been great)
EDIT:
I managed to solve the problem. Turns out that you should have the two SSH keys in one file, at one per line, and can't specify multiple files.
I'm trying to write a small script that'll automatically run "pct create" commands for me, so that I can set up containers a bit quicker and easily, and in order to figure out how promox' commands work.
I have, however, run into a small issue: I can't figure out how to specify more than one public ssh key (if that is at all possible). According to the manpage, I can use the option --ssh-public-key with "one file per line" in order to specify multiple ssh keys for the container, but I can't get it to work.
I have tried the following approaches so far:
Use the --ssh-public-key option twice (doesn't work, as expected only public key in specified with the second option is actually added)
Separate the files with a comma (i.e. --ssh-public-key <file1>,<file2>, didn't work as file can't be found due to comma)
I'm using PVE 6.1, and pveversion says I'm running "pve-manager/6.1-7/13e58d5e (running kernel: 5.3.18-2-pve)"
Another option would be to add a second SSH key after creating the container by pushing a new authorized_keys to the container or editing the file, but I think the one-command approach would be nicer, so I hope someone knows the solution.
Thank you in advance (and thank you for the amazing product. Have only been using it at home so far, but it's been great)
EDIT:
I managed to solve the problem. Turns out that you should have the two SSH keys in one file, at one per line, and can't specify multiple files.
Last edited: