summaryrefslogtreecommitdiff
path: root/cloudinit/SshUtil.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/SshUtil.py')
-rw-r--r--cloudinit/SshUtil.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/cloudinit/SshUtil.py b/cloudinit/SshUtil.py
index 22f4f2fc..a081fbe8 100644
--- a/cloudinit/SshUtil.py
+++ b/cloudinit/SshUtil.py
@@ -155,6 +155,8 @@ def setup_user_keys(keys, user, key_prefix, log=None):
akeys = ssh_cfg.get("AuthorizedKeysFile", "%h/.ssh/authorized_keys")
akeys = akeys.replace("%h", pwent.pw_dir)
akeys = akeys.replace("%u", user)
+ if not akeys.startswith('/'):
+ akeys = os.path.join(pwent.pw_dir, akeys)
authorized_keys = akeys
except Exception:
authorized_keys = '%s/.ssh/authorized_keys' % pwent.pw_dir