Configurable SSH cipher suite (#913)
* Configurable SSH cipher suite * Update configuration file comment * Add default in settings loading code * Fix fmt and log messsage * Remove default from code as this could probably might not be good idea
This commit is contained in:
parent
985a39590b
commit
7131c7d40d
4 changed files with 11 additions and 3 deletions
|
@ -151,8 +151,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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue