【ubuntu】设置代理 您所在的位置:网站首页 ubuntu设置全局代理 【ubuntu】设置代理

【ubuntu】设置代理

2023-03-30 16:53| 来源: 网络整理| 查看: 265

准备免费代理服务或购买专有代理服务

此服务会提供SS或SSR服务器配置信息,后续步骤会用到

参数释义 method —— 加密算法 protocol —— 通信协议 protocol_param —— 通信参数 obfs —— 流量混淆工具名 obfs_params —— 流量混淆工具参数

安装SSR客户端

# 下载脚本 wget http://www.djangoz.com/ssr

# 为脚本增加可执行权限 sudo chmod +x ssr

# 把脚本移动到环境变量路径下 sudo mv ssr /usr/local/bin/

# 执行安装 ssr install

# 根据SSR服务器(代理服务器)配置信息配置此客户端 ssr config

# 启动ssr服务sudo ssr start

# 配置开机启动ssr服务

编辑/etc/rc.local——若不存在则新增(首行 #!/bin/bash,并且保证可以被执行:chmod a+x /etc/rc.local),添加:

ssr start

安装代理服务器 # 安装 # sudo apt-get install privoxy

# 修改配置文件:/etc/privoxy/config # 于5.3 forwarded-connect-retries上一行添加 forward-socks5 / 127.0.0.1:1080 .

# 开机启动 # 重启 sudo service privoxy restart

# 配置代理 编辑~/.bashrc,增加代理配置 export http_proxy="127.0.0.1:8118" export https_proxy="127.0.0.1:8118"

注意:此处在bashrc中配置了HTTP代理,但它可能会影响那些需要访问本地网络的bash命令行工具的使用。譬如:kubernetes集群客户端工具kubectl。在开启代理的情况下,kubectl无法顺利连接到APIServer,需要unset http_proxy和https_proxy两个环境变量,才可恢复正常。

测试效果 curl http://www.google.com curl http://cip.cc


【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有