• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

国民时代

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

linux设置上网代理

一、为系统设置代理

编辑文件/etc/profile,增加如下两行

export http_proxy=http://proxy.com:8080/
export https_proxy=http://proxy.com:8080/
  • 1
  • 2

然后更新一下环境文件:

source /etc/profile
  • 1

二、为yum配置代理

在/etc/yum.conf后面添加以下内容:
如果代理不需要用户名密码认证:

proxy=http://proxy.com:8080/
  • 1

如果需要认证

proxy=http://proxy.com:8080/
proxy_username=代理服务器用户名
proxy_password=代理服务器密码
  • 1
  • 2
  • 3

然后更新一下环境文件:

#使用source后者source yum.conf
source
source /etc/yum.conf
  • 1
  • 2
  • 3

三、为wget代理设置:

编辑文件为:/etc/wgetrc
添加下面两行:

http_proxy=http://proxy.com:8080/
https_proxy=http://proxy.com:8080/
  • 1
  • 2

然后更新一下环境文件:

#使用source后者source /etc/wgetrc
source
source /etc/wgetrc 
  • 1
  • 2
  • 3

四、网页上网

网页上网设置代理很简单,在firefox浏览器下 Edit–>>Preferences–>>Advanced–>>Network
在Connection下点击Settings,里面的manual proxy configuration里设置IP和PORT即可

本篇文章出自“国民时代”,转载请注明转载出处。

posted on 2021-01-04 15:38  国民时代  阅读(1089)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3