I have a remote machine I can access only through a cloudflared
tunnel. In my .ssh/config
file I have
Host ssh.example.com
User some_user_name
IdentityFile ~/.ssh/somthing
ProxyCommand cloudflared access ssh --hostname %h
This works when I do ssh ssh.example.com
But when I just run the cloudflared
directly, I only get the SSH server greetings
cloudflared access ssh --hostname ssh.example.com
SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.5
# After I press enter
Invalid SSH identification string.
The example at the bottom of this guide: https://developers.cloudflare.com/cloudflare-one/tutorials/ssh-service-token/
shows cloudflared access ssh --hostname gitlab-ssh.widgetcorp.tech --id a61c032ee4510f8b7e2749ea0896cc14.access --secret 85dcb2301975e8b8e40deb6097645995aa4bed35c2badf098028652097c69eeb
while mentioning The command relies on the SSH configuration file being set to proxy the connection through cloudflared.
which I did.
In my case, I haven’t setup the service tokens auth yet. However, running the cloudflared
for SSH should work directly. I don’t understand why it doesnt.