1. Installation Shadowsocks
- # yum Install python-setuptools && easy_install pip
- # pip Install Shadowsocks
2. Configure Shadowsocks
- # mkdir-p/etc/shadowsocks
- # Vim/etc/shadowsocks/config.json
- {
- "Server": "118.61.***.***",
- "Port_password": {
- "18381": "*********",
- "18382": "*********",
- "18383": "*********",
- "18385": "*********",
- "18384": "*********"
- },
- "Timeout": 300,
- "Method": "Rc4-md5",
- "Fast_open": false,
- "Workers": 1
- }
3. Self-starter files
- # cat /etc/systemd/system/shadowsocks-server.service
- [unit]
- description=shadowsocks service
- after=network.target
-
- [service]
- type=simple
- user=nobody
- execstart=/usr/bin/ssserver -c /etc/shadowsocks/config.json
- execreload=/bin/kill -hup $MAINPID
- execstop=/bin/kill -s quit $MAINPID
- privatetmp=true
- killmode=process
- restart=on-failure
- restartsec=5s
-
- [install]
- wantedby=multi-user.target
Since the start of this piece, do a unified management, whether it is the management tool packaging, or manually installed. Although the feeling is not convenient, but made a unified planning.
4, joined from the start
- # Systemctl Start Shadowsocks-server.service
- # Systemctl Enable Shadowsocks-server.service
- # systemctl Disable Shadowsocks-server.service
5. Open Port
- # Firewall-cmd--permanent--add-port=18381-18385/tcp
- # Firewall-cmd--reload
Centos7 use of FIREWALLD, than directly with iptables to simple, easy to use.