From af704562a973b8c2bcfc9cd8f0c04d03c5dfd5fa Mon Sep 17 00:00:00 2001 From: Stefan Heinemann Date: Tue, 15 Oct 2013 10:11:05 +0200 Subject: [PATCH] Set the options of an authorized key comma separated According to the sshd man page, no spaces are permitted between the options of an authorized ssh key --- library/system/authorized_key | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/system/authorized_key b/library/system/authorized_key index 8d1866974b9..339e3b4bf2e 100644 --- a/library/system/authorized_key +++ b/library/system/authorized_key @@ -245,11 +245,15 @@ def writekeys(module, filename, keys): (keyhash,type,options,comment) = key option_str = "" if options: + option_strings = [] for option_key in options.keys(): if options[option_key]: - option_str += "%s=%s " % (option_key, options[option_key]) + option_strings.append("%s=%s" % (option_key, options[option_key])) else: - option_str += "%s " % option_key + option_strings.append("%s " % option_key) + + option_str = ",".join(option_strings) + option_str += " " key_line = "%s%s %s %s\n" % (option_str, type, keyhash, comment) except: key_line = key