在 VPS 上架设 Shadowsocks 服务跳出大墙

前文主要讲述了如何在 VPS 上搭建 Ghost 博客,在购买了 VPS 后,除去架设网站这种主要用途,还会产生一个副产物,就是可以利用 VPS 给自己架设跳墙代理,拥有一个自己专用的跳墙线路,方便科学上网。

VPS 端配置

安装 Shadowsocks 库

apt-get install python-pip
pip install shadowsocks

创建配置文件

vim /etc/shadowsocks.json

将以下代码写入文件中

{
    "server":"VPS IP",
    "server_port":8388,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"your password",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false,
    "workers": 1
}

其中,server填写你 VPS 的 IP 地址,server_port可以用默认的 8388,也可以改成一个其他非周知端口。password填写自己想用的密码。

让 Shadowsocks 后台运行

apt-get install python-m2crypto supervisor
vim /etc/supervisor/conf.d/shadowsocks.conf

将以下代码写入配置文件


[program:shadowsocks]
command=ssserver -c /etc/shadowsocks.json
autorestart=true
user=nobody

/etc/default/supervisor最后加入一行ulimit -n 51200,执行

service supervisor start
supervisorctl reload

如果以后修改了 Shadowsocks 的配置,可以通过

supervisorctl restart shadowsocks

对服务进行重启。

客户端配置

客户端直接下载小飞机即可,Linux 和 Windows 以及 Mac 都有各自的版本,Windows 的下载地址是 https://github.com/clowwindy/shadowsocks-csharp

下载完毕后,填写 VPS 的 IP 和刚才自己设置的密码即可连接,剩下的就是配合火狐或者 Chrome 的 switch 插件了,亲测速度稳定,好使。


comments powered by Disqus