Docs menu
SSH from VS Code or a terminal
Set up cloudflared once on your own laptop to SSH into a car or the pit PC from a terminal or VS Code Remote-SSH, with file copying and port forwarding.
SSH in the browser needs no setup, and it is enough for running commands. For editing the workspace in VS Code, copying files with scp or forwarding a port, set up a normal SSH client on your own laptop. The SSH connection still goes through Cloudflare, so the client hands it to Cloudflare’s cloudflared program through a ProxyCommand.
Set up
-
Install
cloudflared. Cloudflare’s downloads page has Windows, macOS and Linux builds; on macOS,brew install cloudflaredalso works. Open a new terminal afterwards so it is on yourPATH. -
Add the devices to your SSH config. The file is
~/.ssh/configon macOS and Linux andC:\Users\<you>\.ssh\configon Windows; create it if it does not exist. Replace<device username>with the username from your team lead:Host rb1 HostName ssh-rb1.sfuracerbot.ca User <device username> ProxyCommand cloudflared access ssh --hostname %h Host rb2 HostName ssh-rb2.sfuracerbot.ca User <device username> ProxyCommand cloudflared access ssh --hostname %h Host pitpc HostName ssh-pitpc.sfuracerbot.ca User <device username> ProxyCommand cloudflared access ssh --hostname %hEach
Hostentry is the shortcut you type afterssh:Device Hostname HostentrySSH URL Car 1 racerbotcar-1rb1ssh-rb1.sfuracerbot.caCar 2 racerbotcar-2rb2ssh-rb2.sfuracerbot.caPit PC racerbotpitpcpitpcssh-pitpc.sfuracerbot.ca -
Connect:
ssh rb1The first connection opens a browser tab for the Cloudflare Access sign-in. Sign in with your approved address, then enter the device password in the terminal.
Working when: the terminal shows a prompt on the device. Later connections skip the sign-in until the 24-hour session runs out.
VS Code
The Remote - SSH extension reads the same config file. Run Remote-SSH: Connect to Host from the command palette and pick rb1, rb2 or pitpc. VS Code then opens folders on that device, such as ~/racerbot-ws on a car, and its terminal runs there.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
websocket: bad handshake |
Your email address is not approved yet, or the browser signed in with a different account | Sign in with the approved address; ask @it-services if it is new |
cloudflared: command not found |
cloudflared is not installed, or the terminal was opened before it was |
Install it and open a new terminal |
| VS Code hangs at “Setting up SSH host” | The sign-in tab opened behind another window and is waiting | Find the browser tab, sign in, then retry |
Limitations
- Each laptop needs its own
cloudflaredand its own sign-in. - The
ProxyCommandruns on every connection, so a laptop withoutcloudflaredcannot use this config, even on the lab network.