Linux VPS中安装Shadowsocks

VPS系统版本: Ubuntu 12.04 32bit

最简单的办法

#apt-get install python-pip
#pip install shadowsocks

启动Shadowsock

#ssserver -p 4000 -k sss4k -d start

-p后定义端口号,-k后面设定密码,-d start代表以daemon方式启动


下面是另外一种方法:

安装shadowsocks-libev

先用aptitude show查看libssl-dev版本

aptitude show libssl-dev

然后根据版本执行以下修改:

libssl > 1.0.1

/etc/apt/sources.list添加下行:

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

libssl > 0.9.8 但 < 1.0.0

/etc/apt/sources.list添加下行:

deb http://shadowsocks.org/debian squeeze main

添加GPG

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

添加完成后更新软件源,然后安装shadowsocks

sudo apt-get update
sudo apt-get install python-m2crypto
sudo apt-get install shadowsocks-libev

配置/管理shadowsocks服务

配置

sudo vim /etc/shadowsocks-libev/config.json

以下为一则配置实例:

root@hkvps:~# cat /etc/shadowsocks-libev/config.json 
{
    "server":"118.193.151.193",
    "server_port":"8388",
    "local_port":"1080",
    "password":"foolish",
    "timeout":"60",
    "method":"aes-256-cfb"
}

管理shadowsocks服务

sudo /etc/init.d/shadowsocks-libev start  //开启服务
sudo /etc/init.d/shadowsocks-libev stop   //关闭服务