summaryrefslogtreecommitdiff
path: root/cloudinit/ssh_util.py
diff options
context:
space:
mode:
authorDaniel Watkins <oddbloke@ubuntu.com>2021-01-19 12:23:23 -0500
committerGitHub <noreply@github.com>2021-01-19 12:23:23 -0500
commitcdc5b81f33aee0ed3ef1ae239e5cec1906d0178a (patch)
tree983963846c5a0b6b40af13d8b9c16fe4f5d5f148 /cloudinit/ssh_util.py
parent11630044d235e0c6e1ffd2b12ff8906613ccdac6 (diff)
downloadcloud-init-git-cdc5b81f33aee0ed3ef1ae239e5cec1906d0178a.tar.gz
Revert "ssh_util: handle non-default AuthorizedKeysFile config (#586)" (#775)
This reverts commit b0e73814db4027dba0b7dc0282e295b7f653325c.
Diffstat (limited to 'cloudinit/ssh_util.py')
-rw-r--r--cloudinit/ssh_util.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/ssh_util.py b/cloudinit/ssh_util.py
index d5113996..c08042d6 100644
--- a/cloudinit/ssh_util.py
+++ b/cloudinit/ssh_util.py
@@ -262,13 +262,13 @@ def extract_authorized_keys(username, sshd_cfg_file=DEF_SSHD_CFG):
except (IOError, OSError):
# Give up and use a default key filename
- auth_key_fns.append(default_authorizedkeys_file)
+ auth_key_fns[0] = default_authorizedkeys_file
util.logexc(LOG, "Failed extracting 'AuthorizedKeysFile' in SSH "
"config from %r, using 'AuthorizedKeysFile' file "
"%r instead", DEF_SSHD_CFG, auth_key_fns[0])
- # always store all the keys in the first file configured on sshd_config
- return (auth_key_fns[0], parse_authorized_keys(auth_key_fns))
+ # always store all the keys in the user's private file
+ return (default_authorizedkeys_file, parse_authorized_keys(auth_key_fns))
def setup_user_keys(keys, username, options=None):