diff options
author | Scott Moser <smoser@ubuntu.com> | 2012-05-22 13:50:30 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2012-05-22 13:50:30 -0400 |
commit | 663989da30d81ccfe74b285d6f27fd801c0f27f9 (patch) | |
tree | cc7ca8b7c550e94a16c3857638c7aa205fc287f2 | |
parent | 4d9722ba567a6ed2e355a464f67fddcad1717aa2 (diff) | |
download | vyos-cloud-init-663989da30d81ccfe74b285d6f27fd801c0f27f9.tar.gz vyos-cloud-init-663989da30d81ccfe74b285d6f27fd801c0f27f9.zip |
support relative path in AuthorizedKeysFile
LP: #970071
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | cloudinit/SshUtil.py | 2 |
2 files changed, 4 insertions, 0 deletions
@@ -1,3 +1,5 @@ +0.6.4: + - support relative path in AuthorizedKeysFile (LP: #970071). 0.6.3: - add sample systemd config files [Garrett Holmstrom] - add Fedora support [Garrent Holstrom] (LP: #883286) 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 |