leftso
100


1.安装python

#yum install –y python

2.查看Python版本

#python -V

注意:如果版本是2.6(centos6.x默认是2.6)则需要升级到2.7.x版本否则会出错。(这里暂时不介绍centos6的安装)偷笑

3.安装pip工具

下载pip
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"

安装pip
python get-pip.py

4.安装shadowsocks

[root@vps ~]# pip install shadowsocks
sh: warning: setlocale: LC_ALL: cannot change locale (zh_CN.UTF-8)
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

5.编写shadowsocks配置文件

vi /etc/shadowsocks.json

内容:
{
  "server": "0.0.0.0",
  "server_port": YOURPORT,
  "password": "YOURTPASSWORD",
  "timeout":600,
  "method": "aes-256-cfb",
  "pid_file":"/var/sss_pid",
  "log_file":"/var/sss_log"
}

6.创建shadowsocks系统服务(可选操作)

/etc/systemd/system/shadowsocks.service

内容:
[Unit]
Description=Shadowsocks
[Service]
TimeoutStartSec=0 ExecStart=/usr/bin/ssserver -c /etc/shadowsocks.json -d start
[Install]
WantedBy=multi-user.target
没用过这个斜眼

7.启动shadowsocks

//系统服务方式启动:
#设置开机启动
systemctl enable shadowsocks
#启动shadowsocks服务
systemctl start shadowsocks

//普通方式启动
#/usr/bin/ssserver -c /etc/shadowsocks.json -d start

#/usr/bin/ssserver -c /etc/shadowsocks.json -d stop

#/usr/bin/ssserver -c /etc/shadowsocks.json -d restart

8 shadowsocks客户端下载

github下载地址勉强
 
暂无评论