shadowsocks server deployment

https://hceasy.com/2013/12/shadowsocks-%E6%9C%8D%E5%8A%A1%E7%AB%AF%E9%83%A8%E7%BD%B2/

 

In fact, there are already VPN and SSH on the server. VPN is a global proxy, which is not very convenient. SSH will be disconnected at critical times, and there is no good client on the mobile phone. Today, I suddenly saw the shadowsocks solution, which is more convenient, and it is IOS ANDROID Win linux is universal for all platforms. Simply make a backup.

Specific reference here
https://github.com/clowwindy/shadowsocks/wiki/Shadowsocks-%E4%BD%BF%E7%94%A8%E8%AF%B4%E6%98%8E

First check the Python version, it should be 2.6 or 2.7.

  1. python --version
  2. Python2.7.4

This ubuntu server usually has it.
Then the official website directly uses pip to install shadowsocks. Some people may have command errors and need to install something.

  1. apt-get install python-gevent python-pip

then you can

  1. pip install shadowsocks

Install shadowsocks.
The next configuration is also relatively simple,
create a new config.json, or any other name, the location can be placed under /etc/shadowsocks/ (there is no such file by default, you have to create one yourself), or home or other places.
content is

  1. {
  2. "server":"my_server_ip",
  3. "server_port":8388,
  4. "local_port":1080,
  5. "password":"barfoo!",
  6. "timeout":600,
  7. "method":"table"
  8. }

The specific meaning is also very clear on the wiki

  1. server server IP ( IPv4 / IPv6 ), note that this will also be the IP address the server is listening on
  2. server_port server port
  3. local_port local port
  4. password used to encrypt the password
  5. timeout timeout (seconds)
  6. method encryption method, you can choose "bf-cfb" , "aes-256-cfb" , "des-cfb" , "rc4" , etc. The default is an insecure encryption, "aes-256-cfb" is recommended

I only changed the encryption method and password. The encryption method is recommended to use bf-cfb, because the aes-256-cfb system does not seem to support it by default, and an error will be reported. If you want to support these encryption methods, you have to install

  1. apt-get install python-m2crypto

Then you can start the service.

  1. ssserver -c /etc/shadowsocks/config.json

Of course, you can't keep ssh open all the time, so still

  1. nohup ssserver -c /etc/shadowsocks/config.json > log &

Then you can turn off SSH.
Or more direct boot-up, add to rc.local

  1. /usr/local/bin/ssserver -c /etc/shadowsocks/config.json

Android phones can install " Shadow Shuttle " and configure it, and other phones can google by themselves.
More clients here
https://github.com/clowwindy/shadowsocks/wiki/Ports-and-Clients

Guess you like

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