Skip to content

"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files

sftp: fix spurious warning when using --sftp-ssh

Nick Craig-Wood11de1376601c
diff --git a/backend/sftp/sftp.go b/backend/sftp/sftp.go
index 5feb863d6..8c66fbb7e 100644
--- a/backend/sftp/sftp.go
+++ b/backend/sftp/sftp.go
@@ -780,7 +780,7 @@ func NewFs(ctx context.Context, name, root string, m configmap.Mapper) (fs.Fs, e
if err != nil {
return nil, err
}
- if len(opt.SSH) != 0 && (opt.User != "" || opt.Host != "" || opt.Port != "") {
+ if len(opt.SSH) != 0 && ((opt.User != currentUser && opt.User != "") || opt.Host != "" || (opt.Port != "22" && opt.Port != "")) {
fs.Logf(name, "--sftp-ssh is in use - ignoring user/host/port from config - set in the parameters to --sftp-ssh (remove them from the config to silence this warning)")
}