Configurable SSH cipher suite (#4109)

* Configurable SSH cipher suite

* Maintain ordering
This commit is contained in:
spacetourist
2017-02-10 19:04:43 +00:00
committed by 无闻
parent 563fc7c6d7
commit 29722af1ae
4 changed files with 10 additions and 3 deletions

View File

@@ -148,8 +148,11 @@ func listen(config *ssh.ServerConfig, host string, port int) {
}
// Listen starts a SSH server listens on given port.
func Listen(host string, port int) {
func Listen(host string, port int, ciphers []string) {
config := &ssh.ServerConfig{
Config: ssh.Config{
Ciphers: ciphers,
},
PublicKeyCallback: func(conn ssh.ConnMetadata, key ssh.PublicKey) (*ssh.Permissions, error) {
pkey, err := models.SearchPublicKeyByContent(strings.TrimSpace(string(ssh.MarshalAuthorizedKey(key))))
if err != nil {