joephon / blog

极简博客
3 stars 2 forks source link

How to set up a VPN in Ubuntu #18

Open joephon opened 4 years ago

joephon commented 4 years ago

Step 1

Install shadowsocks

sudo apt install shadowsocks

Step 2

Edit the config file

column description
server server side address
server_port server side port
local_address local address
local_port local port
password your password
timeout senconds
method crypto
fast_open TCP-Fast-Open

for an example

{
  "server": "0.0.0.0",
  "server_port": 8623,
  "local_address": "127.0.0.1",
  "local_port": 1080,
  "password": "your password",
  "timeout": 300,
  "method": "aes-256-cfb",
  "fast_open": false
}
sudo vim /etc/shadowsocks/config.json

For multi users might look like this

{
    "server":"0.0.0.0",
    "port_password": {
        "8388": "user1 password",
        "8888": "user2 password"
    },
    "local_address": "127.0.0.1",
    "local_port":1080,
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false,
    "workers": 1,
    "prefer_ipv6": false
}

Step 3

Start ssserver

sudo ssserver -d start -c /etc/shadowsocks/config.json

Step 4

Set up once boot

sudo vi /etc/rc.local

+ sudo ssserver -d start -c /etc/shadowsocks/config.json

Bingo~