本文目的是使ubuntu服务器可以在终端中使用ss访问外网。除tsocks外还可以选择proxychains,polipo。
1.ss客户端设置
安装shadowsocks
sudo apt-get update
sudo apt-get install python-pip
sudo apt-get install python-setuptools m2crypto
sudo pip install shadowsocks
客户端配置
{
"server":"11.22.33.44",
"server_port":8838,
"local_port":1080,
"password":"123456",
"timeout":300,
"method":"aes-256-cfb"
}
启动ss
sslocal -c /etc/shadowsocks.json -d start
加上 -d start
表示后台启动(守护进程)
2.tsocks代理ss
安装tsocks
apt-get install tsocks
修改/etc/tsocks.conf
# 本地
server = 127.0.0.1
# socks4还是socks5
server_type = 5
# 上面ss设置的local_port
server_port = 1080
在终端使用tsocks代理
tsocks apt-get update
tsocks curl google.com
tsocks wget ...