1. 安装libsodium:

sudo apt install libsodium-dev
yum install libsodium -y

2. 安装shadowsocks:

pip3 install https://github.com/shadowsocks/shadowsocks/archive/master.zip -U

3.启动与关闭shadowsocks脚本

#!/bin/bash 
# author: yasin
function enable_shadowsocks(){
    sslocal -c /root/tools/shadowsocks/ss.json -d start
    echo "enable shadowsocks success." 
}

function disable_shadowsocks(){
    sslocal -c /root/tools/shadowsocks/ss.json -d stop
    echo "disable shadowsocks success." 
}

case $1 in
enable)
    enable_shadowsocks;;
disable)
    disable_shadowsocks;;
*)
    echo "Usage:`basename $0` {enable|disable}";;
esac

ss.json:

{
      "server": "jp1-sta74.txrh9.pw",
      "server_port": 44141,
      "password": "8H8bqygJV32N",
      "method": "chacha20-ietf-poly1305",
      "plugin": "",
      "plugin_opts": "",
      "remarks": "日本 1,数据用量倍率:1.00",
      "timeout": 5
}

4. 测试

如果返回你的 ss 服务器 ip 则测试成功:

curl --socks5 127.0.0.1:1080 http://httpbin.org/ip

4. proxychains

①安装
git clone https://github.com/rofl0r/proxychains-ng.git
cd proxychains-ng
./configure
make && make install
cp ./src/proxychains.conf /etc/proxychains.conf
cd .. && rm -rf proxychains-ng
②编辑proxychains配置
vim /etc/proxychains.conf
③将socks4 127.0.0.1 9095改为
socks5 127.0.0.1 1080

5. 设置环境变量:

方法一:手动设置环境变量
export PROXYCHAINS_CONF_FILE=~/.proxychains-ng/4.11/etc/proxychains.conf
export DYLD_INSERT_LIBRARIES=/usr/local/Cellar/proxychains-ng/4.11/lib/libproxychains4.dylib
export DYLD_FORCE_FLAT_NAMESPACE=1
方法二: proxychains-ng直接调用SHELL
BASH
proxychains4 -q /bin/bash
ZSH
proxychains4 -q /bin/zsh
Linux安装Shadowsocks客户端

发表评论

电子邮件地址不会被公开。 必填项已用*标注