Rclone SFTP not respecting HTTP Proxy

What is the problem you are having with rclone?

I need to transfer files to an SFTP site. In order to access the internet I need to go through an HTTP proxy. Although I've set the HTTP_PROXY and HTTPS_PROXY environment variable in the same Windows Shell rclone still tries to resolve/connect to the sftp target server.
Also setting the Proxes in the Variable section of the config file does not work.
On another PC where I do not need to use a proxy everything works as expected.
Does the RClone SFTP module support Proxy servers at all? I can only find the option to provide a Socks5 Proxy, which I do not have.

Run the command 'rclone version' and share the full output of the command.

rclone v1.67.0
- os/version: Microsoft Windows Server 2016 Standard 1607 (64 bit)
- os/kernel: 10.0.14393.6452 (x86_64)
- os/type: windows
- os/arch: amd64
- go/version: go1.22.4
- go/linking: static
- go/tags: cmount

Which cloud storage system are you using? (eg Google Drive)

SFTP

The command you were trying to run (eg rclone copy /tmp remote:tmp)

rclone lsd SFTP://

Please run 'rclone config redacted' and share the full output. If you get command not found, please make sure to update rclone.

[SFTP]
type = sftp
host = XXX
user = XXX
pass = XXX
shell_type = cmd
md5sum_command = none
sha1sum_command = none
set_env = HTTP_PROXY=http://user_readcted:password_redacted@myproxy:8080

A log from the command that you were trying to run with the -vv flag

rclone lsd SFTP:// -vv

2024/08/19 15:24:46 DEBUG : rclone: Version "v1.67.0" starting with parameters ["rclone" "lsd" "SFTP://" "-vv"]
2024/08/19 15:24:46 DEBUG : Creating backend with remote "SFTP://"
2024/08/19 15:24:46 DEBUG : Using config file from "D:\\rclone\\rclone.conf"
2024/08/19 15:24:46 DEBUG : pacer: low level retry 1/10 (error couldn't connect SSH: dial tcp: lookup external_server_redacted: no such host)
2024/08/19 15:24:46 DEBUG : pacer: Rate limited, increasing sleep to 200ms
2024/08/19 15:24:46 DEBUG : pacer: low level retry 2/10 (error couldn't connect SSH: dial tcp: lookup external_server_redacted:: no such host)
....
....

welcome to the forum,

should follow the example in the documentation.

Tried already several combinations. Also providing the variables along with the actual command:

rclone lsd SFTP:// --sftp-set-env HTTP_PROXY=http://user:pass@proxy-ip:8080 -vv

still shows that the proxy setting is not respected, but rclone is trying to directly connect to the target, which fails.

What you need I think is --sftp-socks-proxy

that works, for socks5
DEBUG : sftp://xxx@xxx.your-storagebox.de:23/: New connection 127.0.0.1:51992->127.0.0.1:1080 to "SSH-2.0-OpenSSH_9.5 FreeBSD-20240701"

but the OP is asking about sftp over http proxy.

i did some quick testing on windowz and that is not working.
maybe things are different on a macintrash ;wink

I was finally able to solve it by setting up an SSH tunnel with Putty using the HTTP proxy connecting to the traget SFTP server along with providing a local SSH port. Then I connected with rclone through the Putty provided local port.

ok, good.
i was going to suggest that. but instead of putty, i use btivise client.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.