CentOS如何使用命令设置代理?今天小编为大家带来的是CentOS使用命令设置代理的方法;希望对大家会有帮助,有需要的朋友一起去看看吧

设置全局代理,方法如下:

CentOS如何使用命令设置代理?(centos 设置代理)  CentOS 使用命令 设置代理 第1张

1、在profile文件中设置相关环境变量

# vi /etc/profile

http_proxy=http://192.168.20.20:3128 # 分别指定http、https、ftp协议使用的代理服务器地址

export http_proxy

2、 source /etc/profile 生效。

修改完成后,注销重新登录即可.

对于 yum 的代理,还要另外设置 /etc/yum.conf 文件,添加以下代码:

proxy=http://username:password@yourproxy:8080/

#若无密码限制,则为以下方式

#proxy=http://yourproxy:8080/

这样yum的操作就通过代理了

转载请说明出处
知优网 » CentOS如何使用命令设置代理?(centos 设置代理)

发表评论

您需要后才能发表评论