I would like the git client to establish SSH tunnel per-repository automatically (on-demand), each time that I invoke “pull, push, …” commands. When git client finishes processing, it should also “teardown” this SSH tunnel afterwards.
To access private git repository behind the proxy server, I’m currently doing the following :
Step 1. Configure SSH tunnel (SSH port forwarding) to proxy server (on the client side)
‘ssh -D 1080 -N user@proxyserver -i private_key.pem’
Step 2. Configure git client, using local (per-repository) git config, to send traffic over the SSH tunnel created in Step 1.
git config –local http.sslVerify false
git config –local http.proxy socks5h://localhost:1080
This works as expected.
Now, the question is:
Can git client be configured in such a way, so that I don’t have to explicitly create an SSH tunnel each and evry time I want to access private git repository behind the proxy ?
Ideally, this “imaginary setup” should be “git authentication method” agnostic.