Skip to content

devlanes is in beta and not ready for production use.Report an issue

Connect through Cloudflare

A box behind Cloudflare needs one route, to its SSH server, because everything devlanes mirrors travels inside the SSH connection.

::example{slug="remote-ssh-box"}

Install cloudflared on the box, create a tunnel, and give it a published application route on a hostname of your zone with the SSH service type and localhost:22. Protect the hostname with a self-hosted Access application, and run the tunnel as a service.

/etc/cloudflared/config.yml
tunnel: <tunnel-uuid>
credentials-file: /etc/cloudflared/<tunnel-uuid>.json
ingress:
- hostname: ssh.example.invalid
service: ssh://localhost:22
- service: http_status:404

Reach the hostname through cloudflared, written with its full path, since your daemon’s path may not include it.

~/.ssh/config
Host my-vps
HostName ssh.example.invalid
User you
ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %h

cloudflared signs you in through the browser, which your daemon cannot show you, so sign in from a terminal first. Then pair and connect as Connect to a box describes. When the Access session expires, a reconnect fails until you run both commands again.

on your machine
$ ssh my-vps true
$ devlanes remote connect my-vps

Write the full path to cloudflared.exe in the proxy command, in double quotes when it holds a space.

The box is then reachable at a private address through the client, and the SSH entry needs no proxy command.