Phatso
Phatso
Explore posts from servers
CDCloudflare Developers
Created by Phatso on 9/2/2023 in #general-help
"Leave cloudflared running to download the token automatically"
I use cloudflare SSH tunnels to access some of my remote servers. My SSH config and everything is configured well - it does work:
Match host <my.example.domain> exec "cloudflared access ssh-gen --hostname %h"
ProxyCommand cloudflared access ssh --hostname %h
IdentityFile ~/.cloudflared/%h-cf_key
CertificateFile ~/.cloudflared/%h-cf_key-cert.pub
Match host <my.example.domain> exec "cloudflared access ssh-gen --hostname %h"
ProxyCommand cloudflared access ssh --hostname %h
IdentityFile ~/.cloudflared/%h-cf_key
CertificateFile ~/.cloudflared/%h-cf_key-cert.pub
However, when I try to ssh into the server I always have to manually click the URL it generates, i.e.:
Please open the following URL and log in with your Cloudflare account:

https://<my.example.domain>/cdn-cgi/access/cli?<blah>
Please open the following URL and log in with your Cloudflare account:

https://<my.example.domain>/cdn-cgi/access/cli?<blah>
and then wait for the callback to complete, and then finally I'm connected. After that minorly annoying process, I'm teased by cloudflared with this message:
Leave cloudflared running to download the token automatically 🙂
That smug cli is telling me my life could be way easier if I just leave it running - super! Except.. can I? Any time I try to install the cloudflared service worker: sudo cloudflared service install, it complains:
Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]
Cannot determine default configuration path. No file [config.yml config.yaml] in [~/.cloudflared ~/.cloudflare-warp ~/cloudflare-warp /etc/cloudflared /usr/local/etc/cloudflared]
Okay fine, so I make an empty config file in /etc/cloudflared:
sudo touch /etc/cloudflared/config.yaml
sudo touch /etc/cloudflared/config.yaml
And then sudo cloudflared service install:
2023-09-02T23:55:52Z ERR Configuration file /etc/cloudflared/config.yaml was empty
2023-09-02T23:55:52Z ERR Configuration file /etc/cloudflared/config.yaml was empty
Configuration file must contain entries for the tunnel to run and its associated credentials:
tunnel: TUNNEL-UUID
credentials-file: CREDENTIALS-FILE
2023-09-02T23:55:52Z ERR Configuration file /etc/cloudflared/config.yaml was empty
2023-09-02T23:55:52Z ERR Configuration file /etc/cloudflared/config.yaml was empty
Configuration file must contain entries for the tunnel to run and its associated credentials:
tunnel: TUNNEL-UUID
credentials-file: CREDENTIALS-FILE
But.. I don't want to make a tunnel? I'm trying to connect to a tunnel. I have to give it information about a tunnel that I do not want to start? Am I missing something? Can I just give it dummy data or something? Do I have to configure it with the specific tunnel that I'm trying to connect to?
7 replies