安装proxychains-ng配合ssr代理

@lzeroyuee  May 4, 2020

前提准备

安装ssr客户端

  1. 下载ssr脚本并安装

    cd /usr/local/bin/
    sudo wget https://onlyless.github.io/ssr
    sudo chmod 766 ssr
    sudo ssr install
  2. 配置ssr

    sudo ssr config

    填写配置文件,一般只需填写注释部分

    {
        "server": "0.0.0.0", // ssr服务器
        "server_ipv6": "::",
        "server_port": 8388, // 端口
        "local_address": "127.0.0.1",
        "local_port": 1080,
    
        "password": "m", // 密码
        "method": "aes-128-ctr", // 加密方式
        "protocol": "auth_aes128_md5", // 协议
        "protocol_param": "",
        "obfs": "tls1.2_ticket_auth_compatible", // 混淆
        "obfs_param": "",
        "speed_limit_per_con": 0,
        "speed_limit_per_user": 0,
    
        "additional_ports" : {}, 
        "additional_ports_only" : false, 
        "timeout": 120,
        "udp_timeout": 60,
        "dns_ipv6": false,
        "connect_verbose_info": 0,
        "redirect": "",
        "fast_open": false
    }
    

安装proxychains-ng

  1. 卸载自带的proxychains并删除相关配置文件

    sudo apt-get remove proxychains
    sudo rm -rf /etc/proxychains.conf
  2. 安装proxychains-ng

    cd /usr/local/share/
    git clone https://github.com/rofl0r/proxychains-ng.git
    cd proxychains-ng/
    ./configure --prefix=/usr --sysconfdir=/etc
    make
    sudo make install
    sudo make install-config
  3. 配置proxychains-ng

    sudo vim /etc/proxychains.conf

    取消dynamic_chain的注释,并且在最后添加代理记录,以下是配置文件的部分内容

    # The option below identifies how the ProxyList is treated.
    # only one option should be uncommented at time,
    # otherwise the last appearing option will be accepted
    #
    dynamic_chain
    #
    # Dynamic - Each connection will be done via chained proxies
    # all proxies chained in the order as they appear in the list
    # at least one proxy must be online to play in chain
    # (dead proxies are skipped)
    # otherwise EINTR is returned to the app
    # ...
    # ...
    # ...
    [ProxyList]
    # add proxy here ...
    # meanwile
    # defaults set to "tor"
    # socks4     127.0.0.1 9050
    socks5     127.0.0.1 1080
  4. 测试是否配置成功

    sudo cp /usr/local/share/proxychains-ng/src/proxyresolv /usr/bin/
    proxyresolv curl www.google.com

终端与浏览器代理

proxychains4 curl www.google.com        # 终端代理

proxychains4 firefox &> /dev/null &        # 浏览器代理

添加新评论