登陆linux vps.
首先搭建java环境:
apt-get install -y default-jdk或者openjdk-8-jdk
(centos系统下,则yum install -y java-1.8.0-openjdk)
apt-get install -y default-jdk或者openjdk-8-jdk
(centos系统下,则yum install -y java-1.8.0-openjdk)
这样jdk环境就搭建好了。
然后,
wget https://github.com/zk-123/shadowsocks/releases/download/1.1.0/shadowsocks-server.jar
mv shadowsocks-server.jar shadowsocks-server-by-zk-123.jar
然后,
java -jar shadowsocks-server-by-zk-123.jar -s 0.0.0.0:2354 --password mypassword -m aes-256-cfb
不过此命令是运行在前台的,我们可以利用systemd把它运行为service:
nano /etc/systemd/system/shadowsocks-server-by-zk-123.service
cat /etc/systemd/system/shadowsocks-server-by-zk-123.service
[Unit]
After=network.target
[Service]
ExecStart=/usr/bin/java -jar /root/shadowsocks-server-by-zk-123.jar -s 0.0.0.0:2354 --password mypassword -m aes-256-cfb
Restart=always
[Install]
WantedBy=multi-user.target
然后运行:
systemctl start shadowsocks-server-by-zk-123
systemctl enable shadowsocks-server-by-zk-123
服务器端搭建完成。
至于客户端,兼容各大平台下的ss客户端程序。把4个参数填入即可。
No comments:
Post a Comment