Git with double SSH

前端 未结 2 1629
忘掉有多难
忘掉有多难 2020-12-19 19:38

I have: local, server1, server2.

I have Git repository on server2. But I can\'t connect with it. I can connect to server1 with SSH and then connect to server2 with S

2条回答
  •  渐次进展
    2020-12-19 19:53

    Have a look at ssh's ProxyCommand. By adding a section into your ssh config file like

    Host server2 ProxyCommand ssh -q server1 nc -q0 %h 22

    you should be able to use git with a repo an server2. Note: This requires nc being available on server1.

    This solution makes accessing server2 through ssh, e.g. with git, transparent as if it was directly accessible.

提交回复
热议问题