[服务端 - socks5]
: gcc automake make
: pam-devel openldap-devel cyrus-sasl-devel
: openssl-devel
: https://jaist.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz
: tar zxvf ss5-3.8.9-8.tar.gz && cd ss5-3.8.9
: ./configure && make
: make install
: /etc/opt/ss5/ss5.conf
/ ---u指验证用户名和密码, 取消注释, 无限制
# auth 0.0.0.0/0 - -
// 限制网段、带宽、高可用等, 取消注释 无限制
# ipermit - 0.0.0.0/0 - 0.0.0.0/0
# 配置用户密码验证 - 不用配置
# auth 0.0.0.0/0 - u
# /etc/opt/ss5/ss5.passwd 添加用户名密码
: vim /etc/sysconfig/ss5
# Add startup option here
#SS5_OPTS=" -u root"
SS5_OPTS=" -u root -b 0.0.0.0:1080"
[run]
: chmod a+x /etc/init.d/ss5
: service ss5 start
//ss5 start
: ss -tunlp | grep ss5
: systemctl restart ss5
netstat -an | grep 10808 # 查看启动端口
more /var/log/ss5/ss5.log # 查看日志
[终端 - 命令行代理 - proxychains]
: http://ftp.barfooze.de/pub/sabotage/tarballs/proxychains-ng-4.14.tar.xz
// https://github.com/rofl0r/proxychains-ng.git
:cd proxychains-ng && ./configure && make
: make install
// cp /usr/local/bin/proxychains4 /usr/local/bin/px4
# cp proxychains4 /usr/local/bin/px4
# cp libproxychains4.so /usr/local/lib/
# cp src/proxychains.conf /etc/proxychains.conf && vim /etc/proxychains.conf
: vim /etc/proxychains.conf
# 配置(socket5)代理机器
socks5 127.0.0.1 1080
[run]
: proxychains5 wget www.baidu.com
: cp /usr/local/bin/proxychains4 /usr/local/bin/px4
ss5-3.8.9-8.tar.gz
proxychains-ng.tar.gz
// 只能代理部分协议
[前置操作 - yum 命令不能直接更新源时]
#
: lsb_release -a
// 检查机器
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.7.1908 (Core)
Release: 7.7.1908
Codename: Core
# 手动获取源, yum 命令不能使用情况下执行
: cd /etc/yum.repos.d/
: wget http://mirrors.163.com/.help/CentOS5-Base-163.repo | $releasever 修改为 5
: yum clean all 清除原有缓存
: yum list 获取yum列表
[squid]
: yum install squid
: cd /etc/squid/ && cp squid.conf squid.conf_bak && vim squid.conf
# 表示所有用户都可以访问这个代理
-> http_access deny all 修改为 http_access allow all
# IP及端口是 squid的代理IP及端口, 该IP是能访问外网机器的IP地址,如果是本机,则可以不用修改该地址
-> http_port 3128 修改为 http_port 192.168.0.35:3128
: squid -k parse
: squid -z
: service squid start
: netstat -nltp
[客户机配置]
# 访问外网的内网机器上设置其访问外部网络的代理机器, export的效力仅及于该此登陆操作
: export http_proxy=http://192.168.0.35:3128
: curl www.baidu.com