Centos代理上網設置

原文連接:http://m.blog.csdn.net/article/details?id=51851677

1、centos自帶界面設置代理

1. 界面設置

這裏寫圖片描述 
squid默認代理端口3128。vim

2. firefox設置

設置 -> 局域網設置 -> ip:port / username:passwdcentos

2、terminal分別設置代理

1. 臨時代理proxy

若是隻是暫時使用代理,在命令行輸入下面一條命令:bash

export http_proxy="http://210.45.72.XX:808"
  • 1
  • 另外: 
    /root/.bashrc中加入: 
    export http_proxy="http://username:password@210.45.72.XX:808" 
    若是是經過ip或電腦的網卡地址認證,可忽略全部username 和 password . 
    注:中止使用代理的時候,要把改過的文件改爲原樣.尤爲是若是使用了exportui

  • 注:中止使用代理的時候,要把改過的文件改爲原樣. 
    尤爲是若是使用了export http_proxy="http://210.45.72.XX:808"命令, 
    要在命令行輸入:unset http_proxy ,去除環境變量. 
    由於export http_proxy=」http://210.45.72.XX:808」這條命令的實質是把export後面的設置寫進環境設置文件中.spa

  • 輸入env 能夠看全部的環境變量設置. 
    env >env.txt 能夠把環境變量輸出到env.txt中,而後打開看也能夠. 
    unset 變量 能夠取消曾經設過的環境變量..net

2. 全局代理proxy
  • 文件目錄
vim /etc/profile
  • 1
  • 添加以下
http_proxy=http://username:password@yourproxy:8080/ ftp_proxy=http://username:password@yourproxy:8080/ export http_proxy export ftp_proxy
  • 1
  • 2
  • 3
  • 4
  • 環境變量
source /etc/profile
  • 1
3. yum proxy
  • 文件目錄
vim /etc/yum.conf
  • 1
  • 添加以下
proxy=http://username:password@yourproxy:8080/
  • 1
  • 環境變量
source /etc/profile
  • 1
4. wget proxy
  • 文件目錄
vim /etc/wgetrc
  • 1
  • 最後行添加以下
http_proxy=http://username:password@yourproxy:8080 https_proxy=http://username:password@yourproxy:8080 ftp_proxy=http://username:password@yourproxy:8080
  • 1
  • 2
  • 3
  • 環境變量
source /etc/profile
  • 1
  • 更新163源
在本身安裝的CentOS6.5中使用yum安裝軟件,老是提示404錯誤信息,百度後發現原來要設置yum源。 在安裝完CentOS後通常須要修改yum源,纔可以在安裝更新rpm包時得到比較理想的速度。國內比較快的有163源、sohu源。這裏以163源爲例子。 1. cd /etc/yum.repos.d 2. mv CentOS-Base.repo CentOS-Base.repo.backup 3. wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 4. mv CentOS6-Base-163.repo CentOS-Base.repo 5. yum clean all
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
    • 更新速度加快 
      這裏寫圖片描述
相關文章
相關標籤/搜索