Linux配置代理

  • 设置全局代理,需要编辑profile文件
vi /etc/profile
  • 文末添加以下代理配置,参考代理是否需要用户名密码
#无用户名密码
export http_proxy=http://proxy_ip:prot
export https_proxy=https://proxy_ip:prot

#有用户名密码
export http_proxy=http://username:password@proxy_ip:prot
export https_proxy=https://username:password@proxy_ip:port
  • 生效配置文件
source /etc/profile
  • 查看当前已设置代理
echo $http_proxy
echo $https_proxy

 

 

 

 

 

 


版权声明:本文为mypowerhere原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。