原文连接 CentOS安装部署Shadowsocks
- 安装 python setuptools 依赖
yum install python-setuptools
- 安装 pip 更新
easy_install pip && pip install --upgrade pip
- 安装 git
yum install git
- 安装 shadowsocks
pip install git+https://github.com/shadowsocks/shadowsocks.git@master
创建开机启动脚本
vim /usr/lib/systemd/system/shadowsocks.service
在文件中输入以下内容:
[Unit]
Description=Shadowsocks Server
Documentation=https://github.com/shadowsocks/shadowsocks
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
# 设置启动时的配置文件
ExecStart=/usr/bin/ssserver -c /data/shadowsocks/config/shadowsocks.json -d start
ExecReload=/bin/kill -HUP $MAINPID
ExecStop=/usr/bin/ssserver -d stop
[Install]
WantedBy=multi-user.target
- 编写 shadowsocks 配置文件
vim /data/shadowsocks/config/shadowsocks.json
在文件中输入以下内容:
{
"port_password": {
"18388": "shiCheng"
},
"_comment": {
"18388": "用户shicheng"
},
"timeout": 300,
"method": "aes-256-cfb",
"fast_open": false
}
port_password:填写服务对应的端口以及访问的密码,多个以逗号隔开
_comment:用于描述 port_password 中端口的备注信息
method:描述协议的加密方式
配置文件配置后,直接启动 shadowsocks 服务即可