The Initial Setting
1. Login VPS
2. Install shadowsocks
1 | sudo apt-get install python-pip |
3. Edit configuration file
1 | sudo vi /etc/shadowsocks.json |
1 | { |
4. Start shadowsocks
Start shadowsocks service as below:1
ssserver -c /etc/shadowsocks.json
Start and stop shadowsocks service in background:1
2sudo ssserver -c /etc/shadowsocks.json -d start
sudo ssserver -c /etc/shadowsocks.json -d stop
shadowsocks logs will be saved in /var/log/shadowsocks.log
5. Special setting
For Azure VM, we need to add an Inbound rule in Network Security Group. The port should be the same as the one defined in /etc/shadowsocks.json file
Starting shadowsocks service Automatically on Boot
1. Create /etc/init.d/shadowsocks script
1 | sudo vi /etc/init.d/shadowsocks |
1 | #!/bin/sh |
2. Add execute permission for this script
1 | sudo chmod +x /etc/init.d/shadowsocks |
3. Install System-V style init script links
1 | sudo update-rc.d shadowsocks defaults |
Control service in Shell:1
sudo service shadowsocks {start|reload|stop}
4. Edit /etc/rc.local file
Add the command in the /etc/rc.local script that is executed at the end of startup1
sudo vi /etc/rc.local
Add the following command before exit 0
1
sudo service shadowsocks start