CentOS如何使用命令设置代理?
<p>设置全局代理,方法如下:</p><p><strong>1、在profile文件中设置相关环境变量</strong></p>
<p># vi /etc/profile</p>
<p>http_proxy=http://192.168.20.20:3128 # 分别指定http、https、ftp协议使用的代理服务器地址</p>
<p>export http_proxy</p>
<p><strong>2、 source /etc/profile 生效。</strong></p>
<p>修改完成后,注销重新登录即可.</p>
<p>对于 yum 的代理,还要另外设置 /etc/yum.conf 文件,添加以下代码:</p>
<p>proxy=http://username:password@yourproxy:8080/</p>
<p>#若无密码限制,则为以下方式</p>
<p>#proxy=http://yourproxy:8080/</p>
<p>这样yum的操作就通过代理了</p>
頁:
[1]