本文记录一下centos下ss的安装
安装pip
[root@host etc]# curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1602k 100 1602k 0 0 4541k 0 --:--:-- --:--:-- --:--:-- 4540k
[root@host etc]#
[root@host etc]# python get-pip.py
Collecting pip
Downloading https://files.pythonhosted.org/packages/62/a1/0d452b6901b0157a0134fd27ba89bf95a857fbda64ba52e1ca2cf61d8412/pip-10.0.0-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 11.2MB/s
Collecting setuptools
Downloading https://files.pythonhosted.org/packages/20/d7/04a0b689d3035143e2ff288f4b9ee4bf6ed80585cc121c90bfd85a1a8c2e/setuptools-39.0.1-py2.py3-none-any.whl (569kB)
100% |████████████████████████████████| 573kB 18.5MB/s
Collecting wheel
Downloading https://files.pythonhosted.org/packages/1b/d2/22cde5ea9af055f81814f9f2545f5ed8a053eb749c08d186b369959189a8/wheel-0.31.0-py2.py3-none-any.whl (41kB)
100% |████████████████████████████████| 51kB 17.2MB/s
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-10.0.0 setuptools-39.0.1 wheel-0.31.0
[root@host etc]#
安装ss
[root@host etc]# pip install shadowsocks
Collecting shadowsocks
Downloading https://files.pythonhosted.org/packages/02/1e/e3a5135255d06813aca6631da31768d44f63692480af3a1621818008eb4a/shadowsocks-2.8.2.tar.gz
Building wheels for collected packages: shadowsocks
Running setup.py bdist_wheel for shadowsocks ... done
Stored in directory: /root/.cache/pip/wheels/5e/8d/b6/3e2243a7e116984b2c3597c122c29abcfeac77daa260079e88
Successfully built shadowsocks
Installing collected packages: shadowsocks
Successfully installed shadowsocks-2.8.2
[root@host etc]#
设定配置文件
[root@host etc]# cat /etc/shadowsocks.json
{
"server": "0.0.0.0",
"server_port": 8388,
"password": "abcd12341qaz",
"method": "aes-256-cfb"
}
[root@host etc]#
设定systemd文件
[root@host etc]# cat /etc/systemd/system/shadowsocks.service
[Unit]
Description=Shadowsocks
[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/ssserver -c /etc/shadowsocks.json
[Install]
WantedBy=multi-user.target
[root@host etc]#
启动SS
[root@host etc]# systemctl enable shadowsocks
Created symlink from /etc/systemd/system/multi-user.target.wants/shadowsocks.service to /etc/systemd/system/shadowsocks.service.
[root@host etc]# systemctl start shadowsocks
[root@host etc]#
[root@host etc]# systemctl status shadowsocks
● shadowsocks.service - Shadowsocks
Loaded: loaded (/etc/systemd/system/shadowsocks.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2018-04-19 09:48:52 EDT; 14s ago
Main PID: 28799 (ssserver)
CGroup: /system.slice/shadowsocks.service
└─28799 /usr/bin/python /usr/bin/ssserver -c /etc/shadowsocks.json
Apr 19 09:48:52 host.localdomain systemd[1]: Started Shadowsocks.
Apr 19 09:48:52 host.localdomain systemd[1]: Starting Shadowsocks...
Apr 19 09:48:52 host.localdomain ssserver[28799]: INFO: loading config from /etc/shadowsocks.json
Apr 19 09:48:52 host.localdomain ssserver[28799]: 2018-04-19 09:48:52 INFO loading libcrypto from libcrypto.so.10
Apr 19 09:48:52 host.localdomain ssserver[28799]: 2018-04-19 09:48:52 INFO starting server at 0.0.0.0:8388
[root@host etc]#