1.install ss
yum install python-setuptools
easy_install pip
pip install shadowsocks
2.config ss (single user)
vim /etc/shadowsocks.json
{ "server":"my-server", "server_port":8338, "local_port":8888, "password":"password0", "timeout":600, "method":"aes-256-cfb", "auth": true, "fast_open":true }
server:hostname or ip
fast_open:true for Linux core 3.7+
3.optimize ss
vim /etc/security/limits.conf
add 2 line
* soft nofile 51200 * hard nofile 51200
bash
ulimit -n 51200
4.start ss
vim /usr/lib/systemd/system/ss.service
[Unit] Description=Shadowsocks Server After=network.target [Service] PermissionsStartOnly=true ExecStartPre=/bin/mkdir -p /run/shadowsocks ExecStartPre=/bin/chown nobody:nobody /run/shadowsocks ExecStart=/usr/bin/ssserver -c /etc/shadowsocks.json Restart=on-abort User=nobody Group=nobody UMask=0027 [Install] WantedBy=multi-user.target
systemctl start ss
systemctl enable ss
5.firewall
firewall-cmd --zone=public --add-port=8388/tcp --permanent firewall-cmd --zone=public --add-port=8388/udp --permanent firewall-cmd --reload
reference:https://blog.csdn.net/finishx/article/details/79039362