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

先安装proxychains-ng:git

brew install proxychains-ngubuntu

而后将公钥上传服务器, 并在~/.ssh下创建authorized_keys文件,进行免登录处理vim

cat id_rsa.pub >> authorized_keys服务器

本地编辑ssh

vim ~/.ssh/config
spa

#代理服务器代理

Host proxyvmorm

        HostName 192.168.8.7ci

        IdentityFile ~/.ssh/id_rsait

        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工程和提交了。

相关文章
相关标签/搜索