shadowsocks_on_vultr.md

February 12, 2019 ยท View on GitHub

How to deploy a shadowsocks server on a Vultr VPS Back

1. Install Shadowsocks via script

Here we are going to use the script of teddysun to install servers of Shadowsocks on the Vultr VPS server automatically:

At first, download the script:

wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh

Then change mode of this file to give it privilege to run:

chmod +x shadowsocks.sh

Finally run it:

./shadowsocks.sh 2>&1 | tee shadowsocks.log

If you want to install ShadowsocksR, just download the mirror like the following snippet:

wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh

2. Set the password

set_password

3. Set the port

set_port

4. Select specific encryption method

According to the document, there is a comparison of encryption methods' speed, testing with 100MB datagram size.

  1. x86 + Intel Core i7-6500U

    Encryption MethodsTime Used (ms)
    aes-128-cfb639
    aes-192-cfb693
    aes-256-cfb764
    bf-cfb1103
    camellia-128-cfb1038
    camellia-192-cfb1261
    camellia-256-cfb1266
    cast5-cfb1213
    chacha20307
    des-cfb1613
    idea-cfb2066
    rc2-cfb2214
    rc4-md5551
    salsa20263
    seed-cfb1521
    serpent-cfb1444
  2. x86 + AMD Phenom II X4 N930

    Encryption MethodsTime Used (ms)
    aes-128-cfb1860
    aes-192-cfb1984
    aes-256-cfb2125
    bf-cfb2563
    camellia-128-cfb3812
    camellia-192-cfb4797
    camellia-256-cfb4828
    cast5-cfb2766
    chacha20687
    des-cfb3563
    idea-cfb4562
    rc2-cfb5219
    rc4-md52640
    salsa20875
    seed-cfb2657
    serpent-cfb2875
  3. ARM + Samsung Exynos 4412 Prime

    Encryption MethodsTime Used (ms)
    aes-128-cfb3837
    aes-192-cfb4089
    aes-256-cfb4443
    bf-cfb4320
    camellia-128-cfb5920
    camellia-192-cfb7058
    camellia-256-cfb7057
    cast5-cfb4730
    chacha201297
    des-cfb8147
    idea-cfb6678
    rc2-cfb8846
    rc4-md53170
    salsa201666
    seed-cfb6941
    serpent-cfb4440

5. TCP Fast Open

To enhance the speed of connection, you can do more with followed steps:

  1. Add the followed line into the file /etc/rc.local:
    # /etc/rc.local
    echo 3 > /proc/sys/net/ipv4/tcp_fastopen
    
  2. Add the followed line into the file /etc/sysctl.conf:
    # /etc/sysctl.conf
    net.ipv4.tcp_fastopen = 3
    
  3. Modified the attribute fast_open with true in the file /etc/shadowsocks.json
  4. Restart the server of Shadowsocks:
    /etc/init.d/shadowsocks restart