From 663989da30d81ccfe74b285d6f27fd801c0f27f9 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Tue, 22 May 2012 13:50:30 -0400 Subject: support relative path in AuthorizedKeysFile LP: #970071 --- cloudinit/SshUtil.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'cloudinit/SshUtil.py') 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 -- cgit v1.2.3