How to deploy Shadowsocks Server on CentOS 6

Source: Internet
Author: User

Background:

Compared with VPN, it is much easier to build a Shadowsocks service and use it through browser proxy.
Similar to SSH Tunnel, the Shadowsocks server establishes an encrypted Tunnel with its dedicated Shadowsocks client. Then, the Shadowsocks client listens to a local port. The default value is 1080; all data passing through this local port is encrypted through this tunnel.

Related configuration:

OS: CentOS 6.4 x86_64 Minimal

1. Install Shadowsocks Server
# Pip install shadowsocks

2. Configure/etc/shadowsocks. json
# Vim/etc/shadowsocks. json

{
"Server": "0.0.0.0 ",
"Server_port": 443,
"Local_address": "127.0.0.1 ",
"Local_port": 1080,
"Password": "shadowsockspass ",
"Timeout": 600,
"Method": "aes-256-cfb ",
"Fast_open": false,
"Workers": 1
}

Note: In the preceding configuration file,
The server address of the listener is defined as any address: "server": "0.0.0.0 ",
Defines the listening server port 443: "server_port": 443,
Defines the local listening address of the client as 127.0.0.1: "local_address": "127.0.0.1 ",
Defines the local listening port of the client as 1080: "local_port": 1080,
The password is defined as shadowsockspass: "password": "shadowsockspass ",
Defines the connection timeout time as 600 seconds: "timeout": 600,
Defines the encryption method as aes-256-cfb: "method": "aes-256-cfb ",
The fast_open attribute is disabled by default: "fast_open": false,
The number of processes is defined as 1: "workers": 1

3. Configure/etc/sysctl. conf and add the following configuration:
# Vim/etc/sysctl. conf
# For shadowsocks
Fs. file-max = 65535
Net. core. rmem_max = 67108864
Net. core. wmem_max = 67108864
Net. ipv4.tcp _ fin_timeout = 30
Net. ipv4.tcp _ keepalive_time = 1200
Net. ipv4.tcp _ max_syn_backlog = 8192
Net. ipv4.tcp _ max_tw_buckets = 5120
Net. ipv4.tcp _ mem = 25600 51200 102400
Net. ipv4.tcp _ rmem = 4096 87380 67108864
Net. ipv4.tcp _ wmem = 4096 65536 67108864
Net. ipv4.tcp _ mtu_probing = 1
Net. ipv4.tcp _ congestion_control = hybla


4. Start the Shadowsocks service.

# Ssserver-c/etc/shadowsocks. json-d start

# Netstat-lntp | grep 443

1
Tcp 0 0 0.0.0.0: 443 0.0.0.0: * LISTEN 11037/python
5. Download the Shadowsocks client
Windows: https://github.com/shadowsocks/shadowsocks-csharp/releases/download/2.5.6/Shadowsocks-win-2.5.6.zip
Mac OS X: https://github.com/shadowsocks/shadowsocks-iOS/releases/download/2.6.3/ShadowsocksX-2.6.3.dmg

6. Configure the client
Create a server connection and enter:
Server address, such as heylinux.com
Port 443
Encrypted: aes-256-cfb
Password: shadowsockspass

Start the client and keep it in the starting state. By default, Auto Proxy Mode is selected and an Update PAC from GFWList is executed, as shown in the following figure:

7. Configure the browser plug-in
Install plug-in Proxy SwitchySharp: https://chrome.google.com/webstore/detail/dpplabbmogkhghncfbfdeeokoefdjegm

Configure the plug-in, as shown in the following figure:

Enable the configured Proxy: shadowsocks

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.