forked from TrueCloudLab/rclone
sftp: add --sftp-host-key-algorithms to allow specifying SSH host key algorithms
This commit is contained in:
parent
4d7b6e14b8
commit
f4c787ab74
1 changed files with 19 additions and 0 deletions
|
@ -368,6 +368,20 @@ At least one must match with server configuration. This can be checked for examp
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
umac-64-etm@openssh.com umac-128-etm@openssh.com hmac-sha2-256-etm@openssh.com
|
umac-64-etm@openssh.com umac-128-etm@openssh.com hmac-sha2-256-etm@openssh.com
|
||||||
|
`,
|
||||||
|
Advanced: true,
|
||||||
|
}, {
|
||||||
|
Name: "host_key_algorithms",
|
||||||
|
Default: fs.SpaceSepList{},
|
||||||
|
Help: `Space separated list of host key algorithms, ordered by preference.
|
||||||
|
|
||||||
|
At least one must match with server configuration. This can be checked for example using ssh -Q HostKeyAlgorithms.
|
||||||
|
|
||||||
|
Note: This can affect the outcome of key negotiation with the server even if server host key validation is not enabled.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
ssh-ed25519 ssh-rsa ssh-dss
|
||||||
`,
|
`,
|
||||||
Advanced: true,
|
Advanced: true,
|
||||||
}},
|
}},
|
||||||
|
@ -408,6 +422,7 @@ type Options struct {
|
||||||
Ciphers fs.SpaceSepList `config:"ciphers"`
|
Ciphers fs.SpaceSepList `config:"ciphers"`
|
||||||
KeyExchange fs.SpaceSepList `config:"key_exchange"`
|
KeyExchange fs.SpaceSepList `config:"key_exchange"`
|
||||||
MACs fs.SpaceSepList `config:"macs"`
|
MACs fs.SpaceSepList `config:"macs"`
|
||||||
|
HostKeyAlgorithms fs.SpaceSepList `config:"host_key_algorithms"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fs stores the interface to the remote SFTP files
|
// Fs stores the interface to the remote SFTP files
|
||||||
|
@ -740,6 +755,10 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
|
||||||
ClientVersion: "SSH-2.0-" + f.ci.UserAgent,
|
ClientVersion: "SSH-2.0-" + f.ci.UserAgent,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(opt.HostKeyAlgorithms) != 0 {
|
||||||
|
sshConfig.HostKeyAlgorithms = []string(opt.HostKeyAlgorithms)
|
||||||
|
}
|
||||||
|
|
||||||
if opt.KnownHostsFile != "" {
|
if opt.KnownHostsFile != "" {
|
||||||
hostcallback, err := knownhosts.New(env.ShellExpand(opt.KnownHostsFile))
|
hostcallback, err := knownhosts.New(env.ShellExpand(opt.KnownHostsFile))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue