Install shadowsock server on Ubuntu 18.04 LTS

Root

sudo –i## Upgrade OS

apt update
apt upgrade
uname –sr

Enable BBR

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
sysctl -p
lsmod | grep bbr

Install shadowsocks server

sudo apt-get update
sudo apt-get install python-pip
sudo pip install shadowsocks
sudo vim /etc/shadowsocs.json

Configure as below

{
"server":"0.0.0.0",
"server_port":9090,
"local_address":"127.0.0.1",
"local_port":1080,
"password":"Tale365.com",
"timeout":600,
"method":"aes-256-cfb"
}

Fix shadowsocks bug

vi /usr/local/lib/python2.7/dist-packages/shadowsocks/crypto/openssl.pyReplace “EVP_CIPHER_CTX_cleanup” by “EVP_CIPHER_CTX_reset”

:%s/EVP_CIPHER_CTX_cleanup/EVP_CIPHER_CTX_reset/g## Start

sudo ssserver -c /etc/shadowsocks.json -d start## Autostart

Enable rc.local

vi /etc/systemd/system/rc-local.serviceEdit as below

[Unit]
 Description=/etc/rc.local Compatibility
 ConditionPathExists=/etc/rc.local

[Service]
 Type=forking
 ExecStart=/etc/rc.local start
 TimeoutSec=0
 StandardOutput=tty
 RemainAfterExit=yes
 SysVStartPriority=99

[Install]
 WantedBy=multi-user.target

Create rc.local and enable the service

touch /etc/rc.local
chmod +x /etc/rc.local
printf '%s\n' '#!/bin/bash' '/usr/bin/python /usr/local/bin/ssserver -c /etc/shadowsocks.json -d start' 'exit 0' | sudo tee -a /etc/rc.local
systemctl enable rc-local
systemctl start rc-local.service
systemctl status rc-local.service