Install server-side Shadowsocks under Ubuntu 16.04

This tutorial is only applicable to Ubuntu 16.04 and later versions. It is based on Python 3. Since the package manager pip3 corresponding to Python 3 is not pre-installed, first install pip3:

sudo apt install python3-pip

Install shadowsocks

sudo pip3 install https://github.com/shadowsocks/shadowsocks/archive/master.zip

**Check Shadowsocks version: **

sudo ssserver --version

New configuration file

sudo mkdir /etc/shadowsockssudo 
vim /etc/shadowsocks/shadowsocks.json

Add configuration information for multiple users

//Multi-user{"server":"::","local_address":"127.0.0.1","local_port":1080,"port_password":{"8888":"123456789","9999":"123456789"},"timeout":300,"method":"aes-256-cfb","fast_open":false}

Add configuration information single user

//Single user{"server":"::","server_port":8388,"local_address":"127.0.0.1","local_port":1080,"password":"123456789","timeout":300,"method":"aes-256-cfb","fast_open":false}

Parameter Description:

server: Shadowsocks server address
server_port: Shadowsocks server port
local_address: local IP
local_port: local port
password: Shadowsocks connection password
timeout: waiting timeout time
method: encryption method
workers:Number of worker threads
fast_open: true or false

Configure auto-start

  1. Create a new startup script file /etc/systemd/system/shadowsocks.service
sudo vim  /etc/systemd/system/shadowsocks.service

The content is as follows:

[ Unit]
Description=Shadowsocks

[ Service]
TimeoutStartSec=0
ExecStart=/usr/bin/ssserver -c /etc/shadowsocks/shadowsocks.json

[ Install]
WantedBy=multi-user.target
  1. Start the Shadowsocks client
sudo systemctl enable shadowsocks.service
sudo systemctl start shadowsocks.service
sudo systemctl status shadowsocks.service

At this point, Shadowsocks has been configured. The following part is the optimization of Shadowsocks[server] (https://cloud.tencent.com/product/cvm?from=10680) side.

BBR is the latest TCP congestion control algorithm developed by Google. It currently has a better bandwidth improvement effect, and is not even worse than the old brand's sharp speed. BBR was introduced in Linux kernel 4.9. First check the server kernel version:

uname -r

If the displayed version is below 4.9.0, you need to upgrade the Linux kernel, otherwise please ignore the following.

Update package manager:

sudo apt update

View the available Linux kernel versions:

sudo apt-cache showpkg linux-image

Find a Linux kernel version you want to upgrade, such as "linux-image-4.10.0-22-generic":

sudo apt install linux-image-4.10.0-22-generic

Wait for the installation to complete and restart the server:

sudo reboot

Delete the old Linux kernel:

sudo purge-old-kernels

Open BBR, run lsmod | grep bbr, if there is no tcp_bbr in the result, run first:

modprobe tcp_bbrecho "tcp_bbr">>/etc/modules-load.d/modules.conf

run:

echo "net.core.default_qdisc=fq">>/etc/sysctl.confecho "net.ipv4.tcp_congestion_control=bbr">>/etc/sysctl.conf

run:

sysctl -p

Save takes effect. run:

sysctl net.ipv4.tcp_available_congestion_controlsysctl net.ipv4.tcp_congestion_control

If both have bbr, then BBR is successfully turned on.

For more high-quality content, please pay attention to [Youth Coder]

Recommended Posts

Install server-side Shadowsocks under Ubuntu 16.04
Install apache+PHP under Ubuntu
Install node.js under Ubuntu
Install python3.6 under Ubuntu 16.04
Install mysql under Ubuntu 16.04
Install Thrift under ubuntu 14.10
Install OpenJDK10 under Ubuntu
2018-09-11 Install arduino under Ubuntu
Install ROS under ROS Ubuntu 18.04[2]
Install MySQL under Ubuntu
Install Yarm-PM2 under Ubuntu
Install rgl package under Ubuntu
Install 3 single-cell R packages under Ubuntu
Install and deploy Gerrit under Ubuntu
Install MySQL under Ubuntu 18.04 (graphic tutorial)
Install JDK1.8 original under Ubuntu Kylin
Install nodejs and npm under Ubuntu 16.04
How to install Audacious under Ubuntu
How to install Tensorflow under ubuntu 16.04
Compile and install QEMU under Ubuntu
ubuntu18.04 install python2
ubuntu18.04 install docker
ubuntu12.04 install python3
Ubuntu install guide
Install linux (ubuntu) dual system under windows system
ubuntu install nodejs
ubuntu 16 install asp.net
ubuntu install leanote
ubuntu install Jenkins
docker install ubuntu
Install PyTesser under ubuntu 14.04 for OCR recognition
ubuntu install elasticsearch
Install Ubuntu with Parallels Desktop under Mac
Three ways to install software under Ubuntu
ubuntu16.0.1 install pagoda
Install utility software collection under Ubuntu system
ubuntu18.04 install python
ubuntu 18.04 install teamviewer
ubuntu install sendmail
How to install vim editor under Linux (Ubuntu 18.04)
Install the old version of seurat under Ubuntu
The solution to the failure to install .deb under Ubuntu 16.04
How to install gcc compiler faster under Ubuntu
install vscode on ubuntu18
Install mysql-pytho in Ubuntu
ubuntu install zsh terminal
Install Redis on Ubuntu
Install R4 on ubuntu20
Install nvtop on Ubuntu 18.04
Install docker on Ubuntu
Install mysql5.7 under CentOS7
Ubuntu18.04 install opencv 3.2.0 solution
Install ActiveMQ under Centos7
Python MySQLd under Ubuntu
Install Docker on ubuntu18.04
Start working under ubuntu
Install nodejs10 on Ubuntu16
Install PostgreSQL12 under CentOS7
Install CentOS under VMware
ubuntu install harbor warehouse
[python] python2 and python3 under ubuntu