macbook通ssh代理来访问受限的git服务

时间:2015-08-12 20:01:42   收藏:0   阅读:282

先安装proxychains-ng:

brew install proxychains-ng

然后将公钥上传服务器, 并在~/.ssh下建立authorized_keys文件,进行免登陆处理

cat id_rsa.pub >> authorized_keys

本地编辑

vim ~/.ssh/config

#代理服务器

Host proxyvm

        HostName 192.168.8.7

        IdentityFile ~/.ssh/id_rsa

        User ubuntu

        Port 22

#git服务器

Host 192.168.9.9

        HostName 192.168.9.9

        IdentityFile ~/.ssh/id_rsa

        User git

        ProxyCommand ssh proxyvm -W %h:%p

保存

现在可以通过

git clone git@192.168.9.9:pro.git

clone工程和提交了。


原文:http://my.oschina.net/purely/blog/491301

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!