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:
parent
f34acf272c
commit
6a87cc6556
@ -216,12 +216,12 @@ func modifySshdConfig() error {
|
|||||||
sshdConfigString := string(sshdConfig)
|
sshdConfigString := string(sshdConfig)
|
||||||
|
|
||||||
for _, item := range []string{
|
for _, item := range []string{
|
||||||
"UseDNS no",
|
"UseDNS ",
|
||||||
"PermitRootLogin no",
|
"PermitRootLogin ",
|
||||||
"ServerKeyBits 2048",
|
"ServerKeyBits ",
|
||||||
"AllowGroups docker",
|
"AllowGroups ",
|
||||||
} {
|
} {
|
||||||
match, err := regexp.Match("^"+item, sshdConfig)
|
match, err := regexp.Match("(?m)^"+item, sshdConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user