5fc726f8186773821.jpg_fo742.jpg

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://www.cnblogs.com/cocowool/archive/2012/07/05/2578487.html

2 对 “CentOS设置代理”的想法;

  1. 临时代理
    export http_proxy=http://10.0.0.4:1080
    export https_proxy=http://10.0.0.4:1080

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

Captcha Code