SCP through Cloudflare Tunnel

I’d like to use SCP to send a file to a server. The server’s SSH connection is protected by Cloudflare Tunnel.

I’ve set up my .ssh/config file as per the setup guide:

cloudflared access ssh-config --hostname --short-lived-cert

I can SSH into my server like so:


But if I try to use SCP, I get the authentication prompt webpage, then a normal SSH session opens instead of letting the file transfer run:

[email protected]:~$ scp file.txt
failed to get app info: Head "": dial tcp: lookup no such host
A browser window should have opened at the following URL:

If the browser failed to open, please visit the URL above directly in your browser.
Welcome to Ubuntu 22.04.1 LTS

Last login: Thu Aug 18 13:57:01 2022 from
[email protected]:~$

How can I transfer files to a server behind Cloudflare Tunnel?

If it supports it, you’d need to configure SCP to use the SSF Config file.

Those links seem to indicate it may be possible, but I haven’t tested. See also:

Went for the Github solution and it works perfectly. Thanks!

1 Like

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