我坐在防火墙后面,需要配置我的git-config,这样它就可以使用我的socks5-proxy。我已经尝试过几种方法,但最终还是得到了以下结果:
$ git clone git@my-gitlab.de:username/testprojekt.git
Cloning into 'testprojekt'...
ssh: connect to host my-gitlab port 22: Connection timed out
fatal: Could not read from remote repository.我在前面使用putty时也遇到了同样的问题,但是我能够将代理设置存储在那里,连接随后就可以工作了。我可以通过https克隆repos,但我真的想让我们成为SSH。
我试过的东西,但都没有用:
git config --global http.proxy socks5://myProxy:1080
git config --global http.proxy socks://myProxy:1080使用后
$ git config --get http.proxy我得到了正确的输出:
socks5://myProxy:1080但仍然是同样的错误,你可以看出来。我正在使用Git for windows
编辑:
$ ssh -T git@myGitlab.de已经超时了
这是我试图跟踪的解决这个问题的资源之一:https://gist.github.com/evantoli/f8c23a37eb3558ab8765
发布于 2019-04-23 12:01:08
您已经配置了http.proxy,但正试图通过它与ssh://协议进行连接。当然没有意义了。
您需要配置ssh以使用socks代理。例如,请参见https://superuser.com/questions/454210/how-can-i-use-ssh-with-a-socks-5-proxy。
ProxyCommand /usr/bin/nc -X 5 -x myProxy:1080 %h %phttps://stackoverflow.com/questions/55806493
复制相似问题