# Rclone SFTP not respecting HTTP Proxy

**URL:** <https://forum.rclone.org/t/rclone-sftp-not-respecting-http-proxy/47370>\
**Category:** Help and Support\
**Created:** [August 19, 2024, 1:32pm UTC](https://forum.rclone.org/t/rclone-sftp-not-respecting-http-proxy/47370 "2024-08-19T13:32:37Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![markus.thomas](https://forum.rclone.org/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@markus.thomas](https://forum.rclone.org/u/markus.thomas)\
**Post date:** [August 19, 2024, 1:32pm UTC](https://forum.rclone.org/t/rclone-sftp-not-respecting-http-proxy/47370/1 "2024-08-19T13:32:38Z")

</div>

#### 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.

```auto
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)

```auto
SFTP

```

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

```auto
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.

```auto
[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

```auto
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)
....
....

```

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [August 19, 2024, 1:44pm UTC](https://forum.rclone.org/t/rclone-sftp-not-respecting-http-proxy/47370/2 "2024-08-19T13:44:47Z")

</div>

welcome to the forum,

> [@markus.thomas](#):
>
> `set_env = HTTP_PROXY=http://user_readcted:password_redacted@myproxy:8080`

should follow the example in the documentation.

---

<div class="post-metadata">

**Author:** ![markus.thomas](https://forum.rclone.org/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@markus.thomas](https://forum.rclone.org/u/markus.thomas)\
**Post date:** [August 19, 2024, 1:57pm UTC](https://forum.rclone.org/t/rclone-sftp-not-respecting-http-proxy/47370/3 "2024-08-19T13:57:47Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![kapitainsky](https://forum.rclone.org/user_avatar/forum.rclone.org/kapitainsky/32/14450_2.png) [@kapitainsky](https://forum.rclone.org/u/kapitainsky)\
**Post date:** [August 19, 2024, 3:31pm UTC](https://forum.rclone.org/t/rclone-sftp-not-respecting-http-proxy/47370/4 "2024-08-19T15:31:25Z")

</div>

What you need I think is [--sftp-socks-proxy](https://rclone.org/sftp/#sftp-socks-proxy)

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [August 19, 2024, 8:50pm UTC](https://forum.rclone.org/t/rclone-sftp-not-respecting-http-proxy/47370/5 "2024-08-19T20:50:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![markus.thomas](https://forum.rclone.org/letter_avatar_proxy/v4/letter/m/b487fb/32.png) [@markus.thomas](https://forum.rclone.org/u/markus.thomas)\
**Post date:** [August 20, 2024, 1:24pm UTC](https://forum.rclone.org/t/rclone-sftp-not-respecting-http-proxy/47370/6 "2024-08-20T13:24:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![asdffdsa](https://forum.rclone.org/letter_avatar_proxy/v4/letter/a/848f3c/32.png) [@asdffdsa](https://forum.rclone.org/u/asdffdsa)\
**Post date:** [August 20, 2024, 1:27pm UTC](https://forum.rclone.org/t/rclone-sftp-not-respecting-http-proxy/47370/7 "2024-08-20T13:27:05Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [September 19, 2024, 1:27pm UTC](https://forum.rclone.org/t/rclone-sftp-not-respecting-http-proxy/47370/8 "2024-09-19T13:27:32Z")

</div>

Closed on September 19, 2024, 1:27pm UTC

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