1. [服务端 - socks5]
    2. : gcc automake make
    3. : pam-devel openldap-devel cyrus-sasl-devel
    4. : openssl-devel
    5. : https://jaist.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz
    6. : tar zxvf ss5-3.8.9-8.tar.gz && cd ss5-3.8.9
    7. : ./configure && make
    8. : make install
    9. : /etc/opt/ss5/ss5.conf
    10. / ---u指验证用户名和密码, 取消注释, 无限制
    11. # auth 0.0.0.0/0 - -
    12. // 限制网段、带宽、高可用等, 取消注释 无限制
    13. # ipermit - 0.0.0.0/0 - 0.0.0.0/0
    14. # 配置用户密码验证 - 不用配置
    15. # auth 0.0.0.0/0 - u
    16. # /etc/opt/ss5/ss5.passwd 添加用户名密码
    17. : vim /etc/sysconfig/ss5
    18. # Add startup option here
    19. #SS5_OPTS=" -u root"
    20. SS5_OPTS=" -u root -b 0.0.0.0:1080"
    21. [run]
    22. : chmod a+x /etc/init.d/ss5
    23. : service ss5 start
    24. //ss5 start
    25. : ss -tunlp | grep ss5
    26. : systemctl restart ss5
    27. netstat -an | grep 10808 # 查看启动端口
    28. more /var/log/ss5/ss5.log # 查看日志
    29. [终端 - 命令行代理 - proxychains]
    30. : http://ftp.barfooze.de/pub/sabotage/tarballs/proxychains-ng-4.14.tar.xz
    31. // https://github.com/rofl0r/proxychains-ng.git
    32. cd proxychains-ng && ./configure && make
    33. make install
    34. // cp /usr/local/bin/proxychains4 /usr/local/bin/px4
    35. # cp proxychains4 /usr/local/bin/px4
    36. # cp libproxychains4.so /usr/local/lib/
    37. # cp src/proxychains.conf /etc/proxychains.conf && vim /etc/proxychains.conf
    38. : vim /etc/proxychains.conf
    39. # 配置(socket5)代理机器
    40. socks5 127.0.0.1 1080
    41. [run]
    42. : proxychains5 wget www.baidu.com
    43. : cp /usr/local/bin/proxychains4 /usr/local/bin/px4

    ss5-3.8.9-8.tar.gz

    proxychains-ng.tar.gz

    1. // 只能代理部分协议
    2. [前置操作 - yum 命令不能直接更新源时]
    3. #
    4. : lsb_release -a
    5. // 检查机器
    6. LSB Version: :core-4.1-amd64:core-4.1-noarch
    7. Distributor ID: CentOS
    8. Description: CentOS Linux release 7.7.1908 (Core)
    9. Release: 7.7.1908
    10. Codename: Core
    11. # 手动获取源, yum 命令不能使用情况下执行
    12. : cd /etc/yum.repos.d/
    13. : wget http://mirrors.163.com/.help/CentOS5-Base-163.repo | $releasever 修改为 5
    14. : yum clean all 清除原有缓存
    15. : yum list 获取yum列表
    16. [squid]
    17. : yum install squid
    18. : cd /etc/squid/ && cp squid.conf squid.conf_bak && vim squid.conf
    19. # 表示所有用户都可以访问这个代理
    20. -> http_access deny all 修改为 http_access allow all
    21. # IP及端口是 squid的代理IP及端口, 该IP是能访问外网机器的IP地址,如果是本机,则可以不用修改该地址
    22. -> http_port 3128 修改为 http_port 192.168.0.35:3128
    23. : squid -k parse
    24. : squid -z
    25. : service squid start
    26. : netstat -nltp
    27. [客户机配置]
    28. # 访问外网的内网机器上设置其访问外部网络的代理机器, export的效力仅及于该此登陆操作
    29. : export http_proxy=http://192.168.0.35:3128
    30. : curl www.baidu.com