When using tools such as GitLab can cloned via HTTP and SSH. Especially the second choice can be handy if there is no VPN available – but keep in mind, also sending DNS via the jumphost.
The first step is establishing a SSH connection leveraging port forwarding:
ssh -A -D 1337 USER@IP -i pinkepank.key
Afterwards, http://localhost:1337 can be used as SOCKS proxy verwenden – web servers in the remote networks should be accessable including DNS.
Clonen the Git repositories is done with an customized http configuration:
$ git -c http.proxy=socks5h://localhost:1337 clone http://gitlab.pinkepank.remote-site.org/group/repo.git
Notice the socks5h protocol – the following protocols are supported:
|SOCKS4 proxy, DNS resolution via client|
|SOCKS4 proxy, DNS resolution via remote system|
|SOCKS5 proxy, DNS resolution via client|
|SOCKS5 proxy, DNS resolution via remote system|
To ensure that you don’t need to override the configuration every time, you can set the proxy on repository or global level (–global):
$ git config http.proxy socks5h://localhost:1337