简述服务器科学上网配置方案
安装 shadowsocks-libev:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
sudo apt update sudo apt install shadowsocks-libev sudo vim /etc/shadowsocks-libev/config.json # 这里按照运维文档要求配置, 但格式不一致 { "server":["运维提供的IP"], "mode":"tcp_and_udp", "server_port": 运维提供的端口, "local_port":1080, "password":"运维提供的密码", "timeout":300, "method":"aes-256-cfb" } |
配置Shadowsocks客户端自启动:
|
1 2 3 |
sudo systemctl enable shadowsocks-libev-local@config sudo systemctl start shadowsocks-libev-local@config sudo systemctl status shadowsocks-libev-local@config |
验证Shadowsocks配置成功:
|
1 2 3 4 |
curl --socks5 127.0.0.1:1080 http://httpbin.org/ip { "origin": "展示代理IP地址" } |
安装Privoxy:
|
1 2 |
sudo apt update sudo apt install privoxy |
修改配置文件:
|
1 2 3 4 5 6 7 8 |
# 修改配置文件 sudo vim /etc/privoxy/config #确保如下内容没有被注释掉 listen-address 127.0.0.1:8118 # 需要找到或者增加这一行配置 forward-socks5t / 127.0.0.1:1080 |
启动Privoxy:
|
1 2 3 |
systemctl enable privoxy systemctl start privoxy systemctl status privoxy |
配置启停命令:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# 写入下面的内容到.sh文件, 重启链接后可用 sudo vim /etc/profile.d/proxy.sh # Proxy variables ProxyAddr="http://127.0.0.1:8118" # Set proxy function set_proxy() { export http_proxy="${ProxyAddr}" export https_proxy="${ProxyAddr}" echo -e "HTTP and HTTPS proxies have been set to '${http_proxy}'." } # Unset proxy function unset_proxy() { unset http_proxy unset https_proxy echo -e "HTTP and HTTPS proxies have been unset." } |
Ubuntu22安装配置SS客户端科学上网
