@@ -13,14 +13,18 @@ import (
13
13
14
14
// Config is a flat configuration for an SSH connection.
15
15
type Config struct {
16
- Host string `yaml:"host"`
17
- Port int `yaml:"port"`
18
- User string `yaml:"user"`
19
- Password string `yaml:"password"`
20
- KeyFile string `yaml:"key-file"`
21
- Key string `yaml:"key"`
22
- Passphrase string `yaml:"passphrase"`
23
- Fingerprint string `yaml:"fingerprint"`
16
+ Host string `yaml:"host"`
17
+ Port int `yaml:"port"`
18
+ User string `yaml:"user"`
19
+ Password string `yaml:"password"`
20
+ KeyFile string `yaml:"key-file"`
21
+ Key string `yaml:"key"`
22
+ Passphrase string `yaml:"passphrase"`
23
+ Fingerprint string `yaml:"fingerprint"`
24
+ HostKeyAlgorithms []string `yaml:"host-key-algorithms"`
25
+ KeyExchanges []string `yaml:"key-exchanges"`
26
+ Ciphers []string `yaml:"ciphers"`
27
+ MACs []string `yaml:"macs"`
24
28
}
25
29
26
30
// Client is an augmented SSH client.
@@ -155,11 +159,19 @@ func (client *Client) normalizeConfig(config *Config) (*ssh.ClientConfig, error)
155
159
hostKeyCallback = ssh .InsecureIgnoreHostKey ()
156
160
}
157
161
162
+ var connConfig = ssh.Config {
163
+ KeyExchanges : config .KeyExchanges ,
164
+ Ciphers : config .Ciphers ,
165
+ MACs : config .MACs ,
166
+ }
167
+
158
168
return & ssh.ClientConfig {
159
- Auth : []ssh.AuthMethod {authMethod },
160
- HostKeyCallback : hostKeyCallback ,
161
- User : config .User ,
162
- Timeout : client .Timeout ,
169
+ Auth : []ssh.AuthMethod {authMethod },
170
+ HostKeyCallback : hostKeyCallback ,
171
+ User : config .User ,
172
+ Timeout : client .Timeout ,
173
+ HostKeyAlgorithms : config .HostKeyAlgorithms ,
174
+ Config : connConfig ,
163
175
}, nil
164
176
}
165
177
0 commit comments