summaryrefslogtreecommitdiff
path: root/debian/patches/sshd_config_newline_fix.patch
blob: 97c7b5da326c2e7545e49044962c91062fcd3bc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Description: Fix for broken sshd configuration (LP: #1305418)
 Change modification of sshd_config to address lack of newline at EOF.
 Lack of newline resulted in appended config line on same line
 as existing configuration option, breaking sshd_config.

Author: Robert C Jennings <robert.jennings@canonical.com>
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1305418
---
 waagent |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/waagent
+++ b/waagent
@@ -3719,7 +3719,7 @@
             # Disable RFC 4252 and RFC 4256 authentication schemes.
             ReplaceFileContentsAtomic(filepath, "\n".join(filter(lambda a: not
                 (a.startswith("PasswordAuthentication") or a.startswith("ChallengeResponseAuthentication")),
-                GetFileContents(filepath).split('\n'))) + "PasswordAuthentication no\nChallengeResponseAuthentication no\n")
+                GetFileContents(filepath).split('\n'))) + "\nPasswordAuthentication no\nChallengeResponseAuthentication no\n")
             Log("Disabled SSH password-based authentication methods.")
         if self.AdminPassword != None:
             MyDistro.changePass('root',self.AdminPassword)