Guangning Yu's Blog

Setup Shadowsocks on Ubuntu server

2015-03-02 13:35:55

Install

  1. apt-get install python-pip
  2. pip install shadowsocks

Setup

Create config file /etc/shadowsocks.json:

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

You can set multiple ports in the config file:

  1. {
  2. "server": "your_ip_address",
  3. "local_address": "127.0.0.1",
  4. "local_port": "1080",
  5. "port_password": {
  6. "8381": "password_1",
  7. "8388": "password_2"
  8. },
  9. "timeout": 300,
  10. "method": "aes-256-cfb"
  11. }

Start

  1. ssserver -c /etc/shadowsocks.json
  2. # run at background
  3. ssserver -c /etc/shadowsocks.json -d start
  4. ssserver -c /etc/shadowsocks.json -d stop

Start on boot

Edit /etc/rc.local:

  1. /usr/local/bin/ssserver -c /etc/shadowsocks.json -d start
  2. exit 0