1
0
mirror of https://github.com/rancher/os.git synced 2025-07-16 16:11:03 +00:00

Only add ssh options that aren't set

This commit is contained in:
Vincent Fiduccia 2017-09-01 01:06:13 -07:00
parent f34acf272c
commit 6a87cc6556
No known key found for this signature in database
GPG Key ID: 2B29AD6BB2BB2582

View File

@ -216,12 +216,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
}