Cloudflare tunnel SSH: cloudflared binary not found

Summary
I want to be able to SSH into my raspberry pi from anywhere using cloudflare tunnels. But I ran into a road block, receiving an error of zsh: no such file or directory every time I ran ssh <username>@ssh.example.com. I am using MacOS as my client, and I run raspbian OS on my raspberry pi. I followed these docs religiously but for some reason I can’t get past this error (see logs below for full error log).

To Reproduce
Steps to reproduce the behavior (basically follow everything here):

  1. Import a domain into cloudflare or buy a domain through cloudflare
  2. Create a website project with that domain
  3. Set up the tunnel (through dashboard)
  4. Install and start the cloudflared service in the server with the command given in the dashboard
  5. Edit your client’s ssh config (~/.ssh/config) with:
Host ssh.example.com
    ProxyCommand /opt/homebrew/bin/cloudflared access ssh --hostname %h
  1. Install cloudflared on client machine (brew install cloudflared)
  2. Run ssh <username>@ssh.example.com
  3. See error

Expected behavior

I expect cloudflared to open up a browser authentication screen, using my cloudflare account as authentication. Once I authenticate properly, I am able to ssh into my raspberry pi.

Environment and versions

  • OS: MacOS
  • Architecture: M2
  • Version: Sonoma 14.4.1

Logs and errors

debug1: Executing proxy command: exec /usr/local/bin/cloudflared access ssh --hostname ssh.example.com
debug1: identity file /Users/gdivino/.ssh/id_rsa type -1
debug1: identity file /Users/gdivino/.ssh/id_rsa-cert type -1
debug1: identity file /Users/gdivino/.ssh/id_ecdsa type -1
debug1: identity file /Users/gdivino/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/gdivino/.ssh/id_ecdsa_sk type -1
zsh: No such file or directory
debug1: identity file /Users/gdivino/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /Users/gdivino/.ssh/id_ed25519 type -1
debug1: identity file /Users/gdivino/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/gdivino/.ssh/id_ed25519_sk type -1
debug1: identity file /Users/gdivino/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /Users/gdivino/.ssh/id_xmss type -1
debug1: identity file /Users/gdivino/.ssh/id_xmss-cert type -1
debug1: identity file /Users/gdivino/.ssh/id_dsa type -1
debug1: identity file /Users/gdivino/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.6
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535