–
网上有几种方式在centos上安装,pip安装的版本低,新的加密方式chacha20-ietf-poly1305不支持, go版本的支持新的加密方式,但是不能指定配置文件,rpm包方式下载不下来,只能自己下载新版本的源码包编译安装 参加文档 https://github.com/shadowsocks/shadowsocks-libev#fedora--rhel yum install gettext gcc autoconf libtool automake make asciidoc xmlto c-ares-devel libev-devel # Installation of MbedTLS wget https://tls.mbed.org/download/mbedtls-2.6.0-gpl.tgz tar xvf mbedtls-2.6.0-gpl.tgz cd mbedtls-2.6.0 make SHARED=1 CFLAGS="-O2 -fPIC" make DESTDIR=/usr install ldconfig # Installation of libsodium wget https://download.libsodium.org/libsodium/releases/libsodium-1.0.17.tar.gz tar xvf libsodium-1.0.17.tar.gz cd libsodium-1.0.17 ./configure --prefix=/usr && make make install ldconfig # Install shadowsock wget https://github.com/shadowsocks/shadowsocks-libev/releases/download/v3.3.4/shadowsocks-libev-3.3.4.tar.gz tar xf shadowsocks-libev-3.3.4.tar.gz cd shadowsocks-libev-3.3.4/ ./configure && make make install 执行文件位置 ll /usr/local/bin/ss-* -rwxr-xr-x 1 root root 746563 Jan 29 15:45 /usr/local/bin/ss-local -rwxr-xr-x 1 root root 350780 Jan 29 15:45 /usr/local/bin/ss-manager -rwxr-xr-x 1 root root 6049 Jan 29 15:45 /usr/local/bin/ss-nat -rwxr-xr-x 1 root root 628650 Jan 29 15:45 /usr/local/bin/ss-redir -rwxr-xr-x 1 root root 778756 Jan 29 15:45 /usr/local/bin/ss-server -rwxr-xr-x 1 root root 621725 Jan 29 15:45 /usr/local/bin/ss-tunnel 增加配置文件 mkdir -p /etc/shadowsocks cat /etc/shadowsocks/shadowsocks.json { "server":"xxx", "server_port":31426, "local_address": "127.0.0.1", "local_port":1080, "password":"qgcfAm6567cU7Yk", "timeout":300, "method":"chacha20-ietf-poly1305", "fast_open": false, "workers": 1 } system启动方式 cat /etc/systemd/system/shadowsocks.service [Unit] Description=Shadowsocks [Service] TimeoutStartSec=0 ExecStart=/usr/local/bin/ss-local -c /etc/shadowsocks/shadowsocks.json [Install] WantedBy=multi-user.target 启动服务 systemctl enable shadowsocks systemctl start shadowsocks systemctl status shadowsocks ss服务测试,下面表示正常 curl --socks5 127.0.0.1:1080 http://httpbin.org/ip { "origin": "103.121.208.241" } 5. 安装配置Privoxy Shadowsocks是一个 socket5 服务,我们需要使用 Privoxy 把流量转到 http/https 上。 虽然socks代理起来了,但是还不能直接用,需要privoxy转发一下 安装Privoxy yum -y install privoxy 启动Privoxy systemctl enable privoxy systemctl start privoxy systemctl status privoxy 配置/etc/privoxy/config修改 cat /etc/privoxy/config listen-address 127.0.0.1:8118 #8118 是默认端口 forward-socks5t / 127.0.0.1:1080 #转发到本地端口 #我们打开注释就可以,要确保只有一个! 6.配置环境变量 cat /etc/profile export http_proxy=http://127.0.0.1:8118 #这里的端口和上面 privoxy 中的保持一致 export https_proxy=http://127.0.0.1:8118 export no_proxy=localhost,172.16.0.0/16,192.168.0.0/16.,127.0.0.1,10.0.0.0/8 $ source /etc/profile 测试 curl http://httpbin.org/ip { "origin": "103.121.208.241" } 关闭代理 unset http_proxy unset https_proxy 参考文档:https://i4t.com/3151.html
–
–
评论前必须登录!
注册