Configuration of shadowsocks in Ubuntu
System Environment: Ubuntu 14.04 LTS
Install
The commands executed by different Linux distributions are as follows:
Debian/Ubuntu:
Apt-get install python-pip
Pip install shadowsocks
CentOS:
Yum install python-setuptools & easy_install pip
Pip install shadowsocks
Configuration
Sudo vim/etc/shadowsocks. json
// The json file is created by yourself, not the built-in file.
The configuration file is roughly as follows:
{
"Server": "server ip Address ",
"Server_port": 19175,
"Local_address": "127.0.0.1 ",
"Local_port": 1080,
"Password": "password ",
"Timeout": 300,
"Method": "aes-256-cfb ",
"Fast_open": false
}
Start the ss Client
The first two steps are very simple, but some people are wondering how to use them after installation. In fact, you can use sslocal-help to view the help information.
Sslocal-c/etc/shadowsocks. json
A command proxy can be started.
Ubuntu runs automatically after it is started
Now you can access the Internet scientifically, but you have to manually open the terminal to enter a command every time you start the system. Although this command is not long, you have to manually enter it every time, and it seems quite low, and the terminal proxy is disabled.
Write a script
We can create a new file named shadow. sh under/home, for example, write the command we need to start the ss client, and then save it.
#! /Bin/bash
# Shadow. sh
Sslocal-c/etc/shadowsocks. json
Check whether the command sh/home/shadow. sh can be executed on the terminal. If the command is successful, information will be output. You can also try it in the browser. At this time, even if you enter less, but the terminal is closed, we can let him run in the background, nohup sh/home/shadow. sh &.
Add to start running
Here, we need to edit a file named rc and local under/etc. We need root permission. su gets root permission first on the terminal. If you have a root account, then vim/etc/rc. local Editing: Enter nohup bash/home/shadow before exit. sh>/home/d.txt & Save.
Now you can rebootand restart the server. The test shows that the server cannot be automatically run on the backend server. You can check whether the d.txt output is/home/shadow. sh line 3: sslocal: command not found, and the browser cannot be connected to the proxy server.
After some searches, we found that the sslocal command was not found far away from linux? You need to add the path. We found that the sslocal and ssserver commands exist under/usr/local/bin. In fact, you do not need to add them to the profile, you can directly move these two files to/bin.