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

相關文章
相關標籤/搜索