mirror of
https://github.com/rclone/rclone.git
synced 2024-11-07 17:14:44 +01:00
sftp: Add option to disable remote hash check command execution
This commit is contained in:
parent
0eba37d8f3
commit
36e6d23112
@ -151,6 +151,10 @@ Modified times are used in syncing and are fully supported.
|
||||
|
||||
SFTP supports checksums if the same login has shell access and `md5sum`
|
||||
or `sha1sum` as well as `echo` are in the remote's PATH.
|
||||
This remote check can be disabled by setting the configuration option
|
||||
`disable_hashcheck`. This may be required if you're connecting to SFTP servers
|
||||
which are not under your control, and to which the execution of remote commands
|
||||
is prohibited.
|
||||
|
||||
The only ssh agent supported under Windows is Putty's pageant.
|
||||
|
||||
|
@ -70,6 +70,10 @@ func init() {
|
||||
Help: "Enables the use of the aes128-cbc cipher.",
|
||||
},
|
||||
},
|
||||
}, {
|
||||
Name: "disable_hashcheck",
|
||||
Help: "Disable the exectution of SSH commands to determine if remote file hashing is available, leave blank unless you know what you are doing.",
|
||||
Optional: true,
|
||||
}},
|
||||
}
|
||||
fs.Register(fsi)
|
||||
@ -613,6 +617,11 @@ func (f *Fs) Hashes() fs.HashSet {
|
||||
return *f.cachedHashes
|
||||
}
|
||||
|
||||
hashcheckDisabled := fs.ConfigFileGetBool(f.name, "disable_hashcheck")
|
||||
if hashcheckDisabled {
|
||||
return fs.HashSet(fs.HashNone)
|
||||
}
|
||||
|
||||
c, err := f.getSftpConnection()
|
||||
if err != nil {
|
||||
fs.Errorf(f, "Couldn't get SSH connection to figure out Hashes: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user