1
0
mirror of https://github.com/rancher/os.git synced 2025-07-13 06:34:04 +00:00

Merge pull request #2070 from vincent99/master

Only add SSH configuration lines that are not set
This commit is contained in:
Sven Dowideit 2017-09-12 11:12:34 +10:00 committed by GitHub
commit 86574b8b61

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
}