Setup Socks/Socks5 proxy and git repo via proxy

Host windows.local has VPN connection which is granted with git repository.

  • Setup Socks/Socks5 proxy
1
2
3
$ ssh-copy-id -i id_rsa.pub darling@windows.local

$ ssh -D 3128 -q -C -N -f darling@windows.local
  • -q: quiet mode, don’t output anything locally
  • -C: compress data in the tunnel, save bandwidth
  • -N: do not execute remote commands, useful for just forwarding ports
  • -f: keep it running in the background

If PasswordAuthentication is enforced, and pubilc key authentication in SSH Server is not supported, try:

1
$ sshpass -f ~/.ssh/windows.passwd ssh -D 3128 -q -C -N -f darling@windows.local
  • Configure git with Sock/Socks5 proxy
1
2
3
4
5
6
7
8
9
$ git config http.proxy 'socks5://localhost:3128'

$ cat .git/config
[user]
name = Terrence Miao
email = terrence.miao@paradise.net
signingkey = EBCEB936
[http]
proxy = socks5://localhost:3128

Then can access git repository via proxy both on command line and in UI client.

Contents