记录一下 Shadowsocks 的部署和配置。并使用 Dockerfile 做成标准镜像,方便使用。
注意:此文章仅作为作者整理知识所用,请勿用于非法用途。作者保留所有权利。
普通服务器部署方式
本文以 CentOS 7 为例。
yum install epel-release -y yum makecache fast yum update -y
yum install dnf -y dnf install 'dnf-command(copr)' -y dnf copr enable librehat/shadowsocks -y dnf update yum install shadowsocks-libev -y
vim /etc/shadowsocks-libev/config.json { "server":"0.0.0.0", "server_port":8388, "local_port":1080, "password":"password!", "timeout":30, "method":"chacha20-ietf-poly1305" }
git clone https://github.com/shadowsocks/v2ray-plugin.git cd v2ray-plugin/ yum install golang -y go version go build cp v2ray-plugin /usr/bin/
wget "https://github.com/shadowsocks/v2ray-plugin/releases/download/v1.3.0/v2ray-plugin-linux-amd64-v1.3.0.tar.gz"
cp v2ray-plugin /usr/bin/
ss-server -c /etc/shadowsocks-libev/config.json -p 8388 --plugin v2ray-plugin --plugin-opts "server"
cat << EOF > /etc/systemd/system/ss.service [Unit] Description=ss service [Service] Type=simple ExecStart=/usr/bin/ss-server "-c" "/etc/shadowsocks-libev/config.json" "-p" "8388" "--plugin" "v2ray-plugin" "--plugin-opts" "server" Restart=always KillMode=process RestartSec=1 [Install] WantedBy=multi-user.target EOF
systemctl enable ss.service systemctl start ss.service systemctl status ss.service
journal -u ss.service
|
Dockerfile
其他