diff options
author | Emanuele Giuseppe Esposito <eesposit@redhat.com> | 2021-07-12 20:21:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-12 12:21:02 -0600 |
commit | 9b52405c6f0de5e00d5ee9c1d13540425d8f6bf5 (patch) | |
tree | f931bfaa3757d0a1ee83ef88845bc8bd79e4a8ea /cloudinit/persistence.py | |
parent | 108611aee26e09bec683e6cf1b8e03bec9362de9 (diff) | |
download | vyos-cloud-init-9b52405c6f0de5e00d5ee9c1d13540425d8f6bf5.tar.gz vyos-cloud-init-9b52405c6f0de5e00d5ee9c1d13540425d8f6bf5.zip |
ssh-util: allow cloudinit to merge all ssh keys into a custom user file, defined in AuthorizedKeysFile (#937)
This patch aims to fix LP1911680, by analyzing the files provided
in sshd_config and merge all keys into an user-specific file. Also
introduces additional tests to cover this specific case.
The file is picked by analyzing the path given in AuthorizedKeysFile.
If it points inside the current user folder (path is /home/user/*), it
means it is an user-specific file, so we can copy all user-keys there.
If it contains a %u or %h, it means that there will be a specific
authorized_keys file for each user, so we can copy all user-keys there.
If no path points to an user-specific file, for example when only
/etc/ssh/authorized_keys is given, default to ~/.ssh/authorized_keys.
Note that if there are more than a single user-specific file, the last
one will be picked.
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com>
Co-authored-by: James Falcon <therealfalcon@gmail.com>
LP: #1911680
RHBZ:1862967
Diffstat (limited to 'cloudinit/persistence.py')
0 files changed, 0 insertions, 0 deletions