cloudflared tunnel --hostname ssh.example.com --url ssh://localhost:22
# It is to add DNS record# Not very useful if adding dns manually from the dashboard
cloudflared tunnel run
# To run it as tunnel for debugging
cloudflared access ssh --hostname ssh.example.com
# This command doesn't do anything on the local pc# But you can see an output of [access_token] parsed in the debug log # I run it as tunnel for immediate log observation
ssh [email protected]# This command will pop open a new window for the One-Time-Pin# Once authenticated, terminal will successfully ssh into the VM
Configure locally ~/.ssh/config
cloudflared access ssh-config --hostname ssh.example.com
# This command will add additional information to `~/.ssh/config` file