2

I am trying to find a way to force git commands to go through VM.

Currently I have a windows 10 machine which does not have admin rights (company restricted) and I have virtualbox on it which runs Linux Mint as a VM.

Currently port 22 is blocked on our network and windows cannot do git commands over SSH. I did even tried forwarding SSH to use port 443 instead of 22 using the SSH config file but they have blocked that too.

Interestingly when I do git commands on VM it works all good and looks like somehow that's not blocked.

What I am trying to achieve is to somehow make all the git commands that I do in Windows (Git Bash) to go through VM and then VM to Bitbucket.

I hope this makes sense. So I would like to forward all traffic to bitbucket from windows to go to Linux Mint VM which is on the VirtualBox on same device and has static internal IP and then VM will forward it to where it should go which is Bitbucket.

Imagine doing the following git command: git clone git@bitbucket.org:xxxx/yyyy.git

Does anyone have any idea how this can be achieved please?

Thank you guys in advance.

Mo Baqeri
  • 333
  • 2
  • 16
  • 2
    It sounds like you want to tunnel out by using your VM as a proxy (allowing port forwarding), and setting Windows SSH up to tunnel through it (e.g. using the `ProxyJump` confiuration option). I'm assuming that you have some ability to connect to the VM from your host machine. – Hasturkun Mar 02 '21 at 10:45

1 Answers1

2

What I am trying to achieve is to somehow make all the git commands that I do in Windows (Git Bash) to go through VM and then VM to Bitbucket.

Which is precisely why, in every large company I ever worked for, VM on Windows PC are not allowed: you could bypass limitations imposed by IT.

I never saw port 22 allowed for outgoing request. I always used HTTPS for external Git repository operations.

You might be able to configure your SSH through forced command (like gitolite does) in order to run a script which would:

  • intercept your git command
  • update the matching bitbucket in a shared folder (shared between the VM and the host)

But make sure first you are not circumventing IT security policy, or that will catch up with you sooner or later.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250