SSH key options are not respected when user is root
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Low
|
Unassigned |
Bug Description
In user data, if "user" is set to "root" and "ssh_authorized
user: root
ssh_
- cert-authority,
...the following ends up in ~root/.
ssh-ed25519 SomeEd25519Key Global User Issuing CA
However, the SSH key options are respected when "user" is not set to root.
I think, but am not sure, that this is due to an oversight in the `apply_credentials` method in `cc_ssh.py`. In this snippet:
if disable_root:
if not user:
user = "NONE"
key_prefix = disable_
key_prefix = key_prefix.
else:
key_prefix = ''
"key_prefix" being set to the empty string causes "ssh_util.
I'm testing in a Proxmox 6 environment using the Debian 10 OpenStack cloud-init image.
Hello Tris and thanks for your bug report. I agree with your findings and could reproduce the issue. The fact that key_prefix is set to the empty string is likely to be the culprit, as you found out already.