Skip to content

Instantly share code, notes, and snippets.

@Kagami
Last active March 13, 2024 21:02
Show Gist options
  • Save Kagami/c3a93a20e03a1db53534 to your computer and use it in GitHub Desktop.
Save Kagami/c3a93a20e03a1db53534 to your computer and use it in GitHub Desktop.
Using github through SSH tunnel
# Prerequisites: netcat-openbsd (BSD version of netcat)
$ ssh -fND 127.0.0.1:8081 user@<your-vps>
$ git config --global url."https://github".insteadOf git://github
$ git config --global http.proxy 'socks5://127.0.0.1:8081'
$ echo -e 'Host github.com\nProxyCommand nc -x 127.0.0.1:8081 %h %p' >> ~/.ssh/config

Alternative solutions:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment