github ssh proxy | github ssh 协议代理配置

配置一个 proxy-wrapper 脚本

cat > $HOME/bin/proxy-wrapper
#!/bin/bash
nc -x127.0.0.1:7080 -X5 $*

给它增加一个可执行权限

$ chmod +x $HOME/bin/proxy-wrapper

配置 .ssh/config , 对 github.com 设置一个代理命令

Host github github.com
    Hostname github.com
    User git
    ProxyCommand $HOME/bin/proxy-wrapper '%h %p'

必须全部走ssh协议

$ git clone git@github.com:jjrdn/node-open.git

git 协议请参考 Using GIT through a SOCKS proxy.

参考

Comments

blog comments powered by Disqus
Fork me on GitHub