SSH Contextualization [Solved]

I know that you can add an SSH public key to a VM template’s context.
A user can also upload an SSH public key to Sunstone UI and this will get added to the VM upon instantiation.
But when a user with a pub key uploaded, instantiates a VM template with pub key on its context, the VM does not acquire the pub key of the user.

When you hover the tool tip (?) on the VM context, it says if the SSH public key text area is empty then the user’s key will be added. So that means you can only use either.

Is there a way to add both?

Hello.

You can use both, but you have to explicitly reference to the user’s key stored in Sunstone. E.g.,

CONTEXT = [
  NETWORK = "YES",
  SSH_PUBLIC_KEY = "ssh-rsa AAAAB3NzaC1yc2EAA..... user@firstKey
$USER[SSH_PUBLIC_KEY]" ]

See Virtual Machine Template — OpenNebula 6.0.2 documentation.

Best,
Vlastimil

1 Like

Thank you @vholer!