-1

I am trying to install a scientific software package on a HPC cluster. Let's call it clusterhpc. During the configuration process software package tries to clone a bunch of public git repos. However, clusterhpc is behind a firewall, has restricted internet access, and git clone does not work.

I can access clusterhpc via localmachine through passwordless SSH and vice versa. I can do git clone of public repos in localmachine.

How would I setup the git command in clusterhpc so that when git clone is run there, the cloning process tunnels through localmachine?

4

1 Answer 1

1

You can tunnel/proxy ssh traffic when cloning/pulling git from clusterhpc (I'm assuming you're cloning git from github.com),

since you say that

I can access clusterhpc via localmachine through passwordless SSH and vice versa.

I assume that when you want to access localmachine from clusterhpc you run command ssh localmachine

So, in order to use proxy when cloning git via ssh, you can add this in your ~/.ssh/config

Host github.com
  ProxyCommand ssh -q -W %h:%p localmachine

Explanation: config above tunnel ssh traffic to host github.com via proxy command ssh -q -W %h:%p localmachine, which tunnels it to your localmachine's network

If you clone via http/https, you can add this in your ~/.gitconfig

[http]
  proxy = socksv5://localhost:8888

For this to work, you need to open a new terminal from clusterhpc to localmachine like this: ssh -D 8888 localmachine

Explanation: you open a socksv5 proxy on port 8888 (will be tunneled via localmachine) by running ssh -D 8888 localmachine from clusterhpc, and then whenever you clone via http/https, the network traffic will be proxied via localhost:8888

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .