support relative path in AuthorizedKeysFile
This commit is contained in:
parent
807e27a00f
commit
a23fca2f56
@ -1,3 +1,5 @@
|
|||||||
|
0.6.4:
|
||||||
|
- support relative path in AuthorizedKeysFile (LP: #970071).
|
||||||
0.6.3:
|
0.6.3:
|
||||||
- add sample systemd config files [Garrett Holmstrom]
|
- add sample systemd config files [Garrett Holmstrom]
|
||||||
- add Fedora support [Garrent Holstrom] (LP: #883286)
|
- add Fedora support [Garrent Holstrom] (LP: #883286)
|
||||||
|
@ -155,6 +155,8 @@ def setup_user_keys(keys, user, key_prefix, log=None):
|
|||||||
akeys = ssh_cfg.get("AuthorizedKeysFile", "%h/.ssh/authorized_keys")
|
akeys = ssh_cfg.get("AuthorizedKeysFile", "%h/.ssh/authorized_keys")
|
||||||
akeys = akeys.replace("%h", pwent.pw_dir)
|
akeys = akeys.replace("%h", pwent.pw_dir)
|
||||||
akeys = akeys.replace("%u", user)
|
akeys = akeys.replace("%u", user)
|
||||||
|
if not akeys.startswith('/'):
|
||||||
|
akeys = os.path.join(pwent.pw_dir, akeys)
|
||||||
authorized_keys = akeys
|
authorized_keys = akeys
|
||||||
except Exception:
|
except Exception:
|
||||||
authorized_keys = '%s/.ssh/authorized_keys' % pwent.pw_dir
|
authorized_keys = '%s/.ssh/authorized_keys' % pwent.pw_dir
|
||||||
|
Loading…
x
Reference in New Issue
Block a user