-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Configurable SSH cipher suite #913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
139a538
9286f58
5865a28
372a1c7
c3a8c48
99633ae
3b66029
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,8 @@ SSH_PORT = 22 | |
SSH_LISTEN_PORT = %(SSH_PORT)s | ||
; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'. | ||
SSH_ROOT_PATH = | ||
; Choose the ciphers to support for SSH connections | ||
SSH_SERVER_CIPHERS = aes128-ctr, aes192-ctr, aes256-ctr, [email protected], arcfour256, arcfour128 | ||
; Directory to create temporary files when test publick key using ssh-keygen, | ||
; default is system temporary directory. | ||
SSH_KEY_TEST_PATH = | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,7 @@ var ( | |
ListenHost string `ini:"SSH_LISTEN_HOST"` | ||
ListenPort int `ini:"SSH_LISTEN_PORT"` | ||
RootPath string `ini:"SSH_ROOT_PATH"` | ||
ServerCiphers []string `ini:"SSH_SERVER_CIPHERS"` | ||
KeyTestPath string `ini:"SSH_KEY_TEST_PATH"` | ||
KeygenPath string `ini:"SSH_KEYGEN_PATH"` | ||
MinimumKeySizeCheck bool `ini:"-"` | ||
|
@@ -618,6 +619,7 @@ please consider changing to GITEA_CUSTOM`) | |
} | ||
|
||
SSH.RootPath = path.Join(homeDir, ".ssh") | ||
SSH.ServerCiphers = sec.Key("SSH_SERVER_CIPHERS").Strings(",") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Requires a default value? |
||
SSH.KeyTestPath = os.TempDir() | ||
if err = Cfg.Section("server").MapTo(&SSH); err != nil { | ||
log.Fatal(4, "Failed to map SSH settings: %v", err) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ func GlobalInit() { | |
checkRunMode() | ||
|
||
if setting.InstallLock && setting.SSH.StartBuiltinServer { | ||
ssh.Listen(setting.SSH.ListenHost, setting.SSH.ListenPort) | ||
log.Info("SSH server started on %s:%v", setting.SSH.ListenHost, setting.SSH.ListenPort) | ||
ssh.Listen(setting.SSH.ListenHost, setting.SSH.ListenPort, setting.SSH.ServerCiphers) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use tabs for indentation |
||
log.Info("SSH server started on %s:%v. Cipher list (%v)", setting.SSH.ListenHost, setting.SSH.ListenPort, setting.SSH.ServerCiphers) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ListenPort should use |
||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make it clear that this only affects Built-In SSH-server
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.