Description
After setting the SSH_PUBLIC_KEY attribute with the updateconf API call (and successful recontextualization), the existing public keys (if present) are dropped from the template, but they remain in the authorized_keys file.
To Reproduce
Assuming there is a VM running (ID=86) and it already has some keys defined inside the SSH_PUBLIC_KEY string, when such a pyone/python snippet is run:
but inside the /root/.ssh/autorized_keys file, more keys are to be found (if defined previously).
Expected behavior
Either the VM template should contain all the keys, or the keys should be consistently removed from the authorized_keys file. It's not that clear, because the updateconf API call has this parameter:
IN
Int
Update type: 0: Replace the whole template. 1: Merge new template with the existing one.
Description After setting the
SSH_PUBLIC_KEY
attribute with the updateconf API call (and successful recontextualization), the existing public keys (if present) are dropped from the template, but they remain in theauthorized_keys
file.To Reproduce Assuming there is a VM running (ID=86) and it already has some keys defined inside the
SSH_PUBLIC_KEY
string, when such a pyone/python snippet is run:this is the output (it indicates only a single key is present):
but inside the
/root/.ssh/autorized_keys
file, more keys are to be found (if defined previously).Expected behavior Either the VM template should contain all the keys, or the keys should be consistently removed from the
authorized_keys
file. It's not that clear, because the updateconf API call has this parameter:so multiple branches need to be considered.
Details
Additional context NA
Progress Status