Centos 7 builds shadowsocks server deployment

I have nothing to do, I bought a foreign server for a long time, so I thought about getting a Shadowsocks server to play with. There are many online tutorials. Here is a summary of my actual combat process.

 

Install

1. Install Python and Pip environment:

yum install python-setuptools && easy_install pip

2. Install Shadowsocks:

pip install shadowsocks

 

use

ssserver -p 443 -k password -m rc4-md5 

Parameter definition:
password: password
rc4-md5: encryption method

If you want to run in the background:

sudo ssserver -p 443 -k password -m rc4-md5 --user nobody -d start

If you want to stop:

sudo ssserver -d stop

 

We can also deploy through configuration files

 

Single User Configuration

New: vim /etc/shadowsocks.json 

content:

{
    "server":"my_server_ip",
    "server_port":8388,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"mypassword",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

explain:

name illustrate
server The address your server listens to, either IPV4 or IPV6
server_port Server port, write the port number you want to use
local_address your local listening address
local_port local port
password password for encryption
timeout overtime time
method encryption method, default: "aes-256-cfb", see encryption
fast_open use TCP_FASTOPEN , true/false
workers Number of workers available on Unix/Linux

 

Multi-user configuration

With port_password, each user corresponds to a port, followed by a password. If you want to build a user management system, see: Manager API .

{
    "server": "0.0.0.0",
    "port_password": {
        "8381": "foobar1",
        "8382": "foobar2",
        "8383": "foobar3",
        "8384": "foobar4"
    },
    "timeout": 300,
    "method": "aes-256-cfb"
}

Run in the foreground:

ssserver -c /etc/shadowsocks.json

To run in the background:

ssserver -c /etc/shadowsocks.json -d start
ssserver -c /etc/shadowsocks.json -d stop

 

We may encounter some problems during the installation process, such as:

1、500 Internal Privoxy Error

This problem occurred during my installation because the server was not started in the background. Once ssh is closed, the service is also closed, causing connection problems.

2、Cannot assign requested address

When this problem occurs, I initially configured the server in the configuration file with the real ip of my own server.

"server":"myserverip"

Just change the real ip to 0.0.0.0

"server":"0.0.0.0"

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325479116&siteId=291194637