CentOS如何使用命令设置代理?

2023-12-04 0 557

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

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的操作就通过代理了

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

悠久资源 RedHat/Centos CentOS如何使用命令设置代理? https://www.u-9.cn/system/redhatcentos/82584.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务