安装shadowsocks命令行客户端
sudo apt-get install python-pip
sudo pip install shadowsocks

ss的json配置(shadowsocks.json)

{
“server”: serverIp,
“server_port”:1984,
“local_address”: “127.0.0.1”,
“local_port”:1080,
“password”:”**“,
“timeout”:600,
“method”:”aes-256-cfb”
}

启动
sudo sslocal -c path/shadowsocks.json -d start (stop)

设置代理 http/https协议(clone https://前缀的repo会走ss)
git config —global http.proxy ‘socks5://127.0.0.1:1080’
git config —global https.proxy ‘socks5://127.0.0.1:1080’

删除
git config —global —unset http.proxy
git config —global —unset https.proxy

[email protected]走的是ssh协议,所以配置ssh代理

配置.ssh/config (确保安装了 NetCat)
Host github.com bitbucket.org
ProxyCommand nc -x 127.0.0.1:1080 %h %p

文档更新时间: 2018-07-04 09:46   作者:admin