Skip to content

Instantly share code, notes, and snippets.

@gbraad
Last active November 22, 2024 16:06
Show Gist options
  • Save gbraad/3fbf35c7c8c435fd6aee2dbcccedf03f to your computer and use it in GitHub Desktop.
Save gbraad/3fbf35c7c8c435fd6aee2dbcccedf03f to your computer and use it in GitHub Desktop.
Quickly install a Tailscale userspace proxy

Quickly install a Tailscale userspace proxy

For example on GitPod you can run the following:

$ curl -fsSL https://gist.githubusercontent.com/gbraad/3fbf35c7c8c435fd6aee2dbcccedf03f/raw/fcb7081234e404c4b3c2acba564b0cb92ca9c22a/install.sh | sh
$ . start-tailproxy

which starts a tailscale daemon with userspace networking turned on, and exposing a socks5 proxy on 3215.

$ tailproxy status

When you have netcat-openbsd installed, you can do the following to copy a file:

$ echo "test" > test
$ scp -o "ProxyCommand /usr/bin/nc -X 5 -x localhost:3215 %h %p" ./test [email protected]:/tmp/test
test                                                                   100%    5     0.0KB/s   00:00

to a server on the network it is connected to, or login/execute a command over ssh:

$ ssh -o "ProxyCommand /usr/bin/nc -x localhost:3215 %h %p" [email protected] -C "cat /tmp/test"
#!/bin/sh
curl -fsSL https://tailscale.com/install.sh | sh
sudo apt-get install -y screen
mkdir -p ~/.local/bin
curl -fsSL https://raw.githubusercontent.com/gbraad/dotfiles/refs/heads/main/zsh/.local/bin/start-tailproxy -o ~/.local/bin/start-tailproxy
chmod +x ~/.local/bin/start-tailproxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment