From bc0b0132c2edcfec882186619fad8bceafba65c8 Mon Sep 17 00:00:00 2001 From: Sven Dowideit Date: Tue, 12 Sep 2017 11:12:34 +1000 Subject: [PATCH] Merge pull request #2070 from vincent99/master Only add SSH configuration lines that are not set (cherry picked from commit 86574b8b61420e9d7ad5b2c631949ad5b2d005a2) --- cmd/control/console_init.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/control/console_init.go b/cmd/control/console_init.go index 06a93cc8..c1fdde3d 100644 --- a/cmd/control/console_init.go +++ b/cmd/control/console_init.go @@ -218,12 +218,12 @@ func modifySshdConfig() error { sshdConfigString := string(sshdConfig) for _, item := range []string{ - "UseDNS no", - "PermitRootLogin no", - "ServerKeyBits 2048", - "AllowGroups docker", + "UseDNS ", + "PermitRootLogin ", + "ServerKeyBits ", + "AllowGroups ", } { - match, err := regexp.Match("^"+item, sshdConfig) + match, err := regexp.Match("(?m)^"+item, sshdConfig) if err != nil { return err }