Shadowsocks科学上网

ssh tunnel全面失效,WTF!

ssh tunnel无论如何更改端口都无效了,听说Shadowsocks科学上网不错,记录一下安装过程.

为了使用Gmail也是拼了!当然前提是要有个VPS,我用linode.

服务器端

安装

/etc/apt/sources.list目录下添加shadowsocks.list,文件内容如下:

1
deb http://shadowsocks.org/debian wheezy main

添加GPG公钥

1
$ wget -O- http://shadowsocks.org/debian/1D27208A.gpg sudo apt-key add -

最后安装:

1
2
$ sudo apt-get update
$ sudo apt-get install shadowsocks-libev

配置:
/etc/shadowsocks-libev/config.json

1
2
3
4
5
6
7
8
{
"server":"your_server_ip",
"server_port":8388,
"local_port":1080,
"password":"barfoo!",
"timeout":60,
"method":"aes-256-cfb"
}

填上服务器密码,修改一下访问密码,加密方法选择高强度加密方法aes-256-cfb,最后重新启动shadowsocks-libev即可.

1
$ sudo service shadowsocks-libev restart

客户端

linux(debian testing Stretch):
安装

1
$ sudo apt-get install shadowsocks

配置:
/etc/shadowsocks/config.json

1
2
3
4
5
6
7
8
9
10
11
{
"server":"my_server_ip",
"server_port":8388,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"mypassword",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false,
"workers": 1
}

修改与服务器相关的item
默认安装的shadowsocks是用于启动服务器的,因此修改一下/etc/init.d/shadowsocks使其用于运行客户端daemon程序

1
2
3
4
...
#DAEMON=/usr/bin/ssserver # Introduce the server's location here
DAEMON=/usr/bin/sslocal # Introduce the cilent's location here
...

保存后重新启动shadowsocks

1
$ sudo service shadowsocks restart

客户端软件访问本地端口127.0.0.1:1080即可.

Mac OS X:
下载安装ShadowsocksX

References:
[1]shadowsocks
[2]shadowsocks-libev
[3]Shadowsocks (简体中文)

===
[erq]