Browse Source

add default ssh ciphers (#2761)

Lunny Xiao 2 years ago
parent
commit
03900303a9
1 changed files with 5 additions and 1 deletions
  1. 5 1
      modules/setting/setting.go

+ 5 - 1
modules/setting/setting.go

@@ -108,6 +108,7 @@ var (
108 108
 		StartBuiltinServer: false,
109 109
 		Domain:             "",
110 110
 		Port:               22,
111
+		ServerCiphers:      []string{"aes128-ctr", "aes192-ctr", "aes256-ctr", "aes128-gcm@openssh.com", "arcfour256", "arcfour128"},
111 112
 		KeygenPath:         "ssh-keygen",
112 113
 	}
113 114
 
@@ -709,7 +710,10 @@ func NewContext() {
709 710
 		SSH.Domain = Domain
710 711
 	}
711 712
 	SSH.RootPath = path.Join(homeDir, ".ssh")
712
-	SSH.ServerCiphers = sec.Key("SSH_SERVER_CIPHERS").Strings(",")
713
+	serverCiphers := sec.Key("SSH_SERVER_CIPHERS").Strings(",")
714
+	if len(serverCiphers) > 0 {
715
+		SSH.ServerCiphers = serverCiphers
716
+	}
713 717
 	SSH.KeyTestPath = os.TempDir()
714 718
 	if err = Cfg.Section("server").MapTo(&SSH); err != nil {
715 719
 		log.Fatal(4, "Failed to map SSH settings: %v", err)