mirror of
https://github.com/rancher/os.git
synced 2025-08-23 17:08:18 +00:00
Merge pull request #2070 from vincent99/master
Only add SSH configuration lines that are not set
(cherry picked from commit 86574b8b61
)
This commit is contained in:
parent
98cb81f536
commit
bc0b0132c2
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user