YUM代理設置bash
編輯/etc/yum.conf,在最後加入spa
# Proxy代理
proxy=http://username:password@proxy_ip:port/ip
也可使用proxy_username和proxy_password來配置代理的用戶名和密碼get
這樣的配置完成後,全部的用戶在使用yum時,都會使用代理,能夠說是全局代理。proxy_pass
若是須要爲單獨的用戶配置代理,能夠在用戶的~/.bash_profile中設置。ftp
Wget的代理設置配置
編輯/etc/wgetrc,在最後加入file
# 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中就能夠了。