SOCKS5 proxy only, git wants to use ssh to xx.xx.xx.xx - forward? - mac os

Posted by AlexAtNet on Super User See other posts from Super User or by AlexAtNet
Published on 2014-06-08T00:55:41Z Indexed on 2014/06/08 3:28 UTC
Read the original article Hit count: 409

Filed under:
|
|

I have SOCKS5 proxy configured and want to work with the git repository, originally cloned from ssh:... So when it tries to connect the error "Network is unreachable" appears.

There are a few possible solutions:

  1. Use GIT URL rewriting and use https:// with proxy option. Probably should work well for github repositories.
  2. Use port forwarding and something like iptables/ipfw to rewrite address xx.xx.xx.xx:22 to 127.0.0.1:10yyy

I'm trying to do #2. I have limited knowledge in this area, but know that I should use something like iptables. But then I discovered that on a Mac I should use ipfw. And then in the ipfw man page it told me "This utility is DEPRECATED. Please use pfctl(8) instead".

So what I want to do is to rewrite xx.xx.xx.xx:22 to 127.0.0.1:10yyy and remove this rewriting. As I read, the pf.conf line should be

rdr proto tcp from 127.0.0.1 to xx.xx.xx.xx port 22 -> 127.0.0.1 port 10yyy

But how to add (and remove) this rule from command line?

© Super User or respective owner

Related posts about port-forwarding

Related posts about osx-mavericks