2020-02-05 21:00:47 0 Comments Linux Boy.Lee

Centos 6.x Install ShadowSocks Server Side Program

It's very easy to install and use ShadowSocks on Centos 6.x, just follow the below commond

*the follow commands only for Centos 6.x

 

{ 1. Install ShadowSocks }

yum install python-setuptools
easy_install pip
pip install shadowsocks

 

{ 2. Config ShadowSocks }

mkdir /etc/shadowsocks
touch /etc/shadowsocks/config.json


//open /etc/shadowsocks/config.json edit as
{
    "server":"server ip",
    "port_password":{
         "20001":"pass1",
         "20002":"pass2",
         "20003":"pass3",
         "20004":"pass4"
    },
    "timeout":600,
    "method":"rc4-md5"
}

port_password is a group of account and password, each line can be used as one account, in shadowsocks, only have port and pass, so port here is username,  port range: 0 - 65535, normally we use port >= 30000 and also check with iptables, in case the port is using.

also suggest to use random string as password, try will itool's only random string generate code, it's very cool

http://itool.yiilib.com/#/t/randomString

 

{ 3. run ShadowSocks }

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

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

ssserver -c /etc/shadowsocks/config.json -d restart


// auto run
vi /etc/rc.d/rc.local
// add new line
ssserver -c /etc/shadowsocks/config.json -d start
:wq

 

{ 4. iptable Config }

// see iptables rules
iptables -L -n

// input at first line for shadowsocks 
iptables -I INPUT 1 -p tcp -m tcp --dport 20001:20004 -j ACCEPT

If you don't have iptable, then skip this line.

 

{ 5. Client App Suggestion }

ShadowsocksX-NG it's very cool, but the white name mode is not good, so have a look at << SHADOWSOCKS-NG WHITE LIST MODE >> if you also need use white list mode

https://github.com/shadowsocks/ShadowsocksX-NG

 

GoAgentX also very good, the only problem is not support new encode method

https://github.com/mithril-global/GoAgentX

 

 

{ 6. Client Config }

Use "Server IP" + "one port and password" + rc4+md5 as encode method

 

{ links }

http://blog.csdn.net/chenghuikai/article/details/51644921

http://yiilib.com/topic/712/2017 CLASSICAL IPTABLES CONFIG RULES DEMO FOR CENTOS 6 WEB SERVER

http://itool.yiilib.com/#/t/randomString