歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> CentOS:設置系統級代理(轉),centos

CentOS:設置系統級代理(轉),centos

日期:2017/3/3 17:57:42   编辑:學習Linux

CentOS:設置系統級代理(轉),centos

CentOS:設置系統級代理(轉),centos


原文地址:http://www.cnblogs.com/cocowool/archive/2012/07/05/2578487.html

YUM代理設置

編輯/etc/yum.conf,在最後加入

# Proxy

proxy=http://username:password@proxy_ip:port/

也可以使用proxy_username和proxy_password來配置代理的用戶名和密碼

這樣的配置完成後,所有的用戶在使用yum時,都會使用代理,可以說是全局代理。

如果需要為單獨的用戶配置代理,可以在用戶的~/.bash_profile中設置。

Wget的代理設置

編輯/etc/wgetrc,在最後加入

# Proxy

http_proxy=http://username:password@proxy_ip:port/

ftp_proxy=http://username:password@proxy_ip:port/

系統全局代理

如果需要為某個用戶設置一個系統級的代理,可以在~/.bash_profile中設置:

http_proxy="http://username:password@proxy_ip:port"

export_http_proxy

上面的設置只對某個用戶生效,如果要對所有系統用戶生效,寫在/etc/profile中就可以了

http://xxxxxx/Linuxjc/1183312.html TechArticle

Copyright © Linux教程網 All Rights Reserved