My company has a self hosted git server that only accepts connections from within the company's network. In my local machine, while connected to the company's VPN, I can access my git remotes as:


I would like to be able to connect to this git server from a remote machine that I can SSH into but which is not within the company's network, and thus does not have direct access to the git server. So, while my local machine is within my company's network, I would SSH into the remote server and the remote server would connect to the git server by tunneling the connection though my local machine.

Is this possible? How can I configure SSH to do so?

I've done some searching and found many solutions for the reverse problem or how to access locally a resource that's only accessible to the remote, for example this (Transparent access to remote resource on a private network), but I've not found any solution to my use-case.

  • Why don't you connect to the VPN from that machine? Feb 7 at 14:18
  • @MichaelHampton Unfortunately the VPN is not open. It requires some special authentication that I've not been able to reproduce in the remote. It's very possible I'm just not doing this right. If the VPN on the remote turns out to be the best approach I'll dig more into how to make it work.
    – foglerit
    Feb 7 at 14:28

In case you can install any applications on an internal server, you can deploy a SSH Server, through which you can use as your entry point to the network.

You will need to adjust some flows on the firewall, or even deploy a specific server for such access (which is highly recommended).

Once the server is up and running, and SSH is reachable, you have to secure it by:

  1. Firewall
  2. SSH Keys
  3. SSH Authorized Users using SSH Keys and Passwords
  4. Maybe 2FA
  5. Limit Login Attempts to overcome bruteforce

This is just from top of my head.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.