linux全局、apt、wget、curl代理服务器设置

好记性不如乱笔头,记下来总是好的。。。
回复
BG6RSH
帖子: 189
注册时间: 周日 6月 23, 2019 12:00 pm

linux全局、apt、wget、curl代理服务器设置

帖子 BG6RSH »

一、apt代理(nano /etc/apt/apt.conf)
  1. Acquire::http::proxy "http://username:password@192.168.144.232:9128";
  2. Acquire::ftp::proxy "http://username:password@192.168.144.232:9128";
  3. Acquire::https::proxy "http://username:password@192.168.144.232:9128";
二、wget代理(nano /etc/wgetrc)
  1. #You can set the default proxies for Wget to use for http, https, and ftp.
  2. # They will override the value in the environment.
  3. https_proxy = http://username:password@192.168.144.232:9128
  4. http_proxy = http://username:password@192.168.144.232:9128
  5. ftp_proxy = http://username:password@192.168.144.232:9128
  6.  
  7. # If you do not want to use proxy at all, set this to off.
  8. use_proxy = on
三、curl代理 (nano ~/.curlrc)
  1. proxy="http://username:password@192.168.144.232:9128"
上次由 BG6RSH 在 周三 5月 29, 2024 9:26 am,总共编辑 1 次。
BG6RSH
帖子: 189
注册时间: 周日 6月 23, 2019 12:00 pm

Re: apt、wget、curl代理服务器设置

帖子 BG6RSH »

三、debian全局代理(nano /etc/profile.d/proxy.sh)
  1. #!/bin/sh
  2.  
  3. # 设置 HTTP 代理
  4. export HTTP_PROXY="http://username:password@your-proxy-server:port"
  5. export http_proxy="http://username:password@your-proxy-server:port"
  6.  
  7. # 设置 HTTPS 代理
  8. export HTTPS_PROXY="http://username:password@your-proxy-server:port"
  9. export https_proxy="http://username:password@your-proxy-server:port"
  10.  
  11. # 设置 FTP 代理
  12. export FTP_PROXY="http://username:password@your-proxy-server:port"
  13. export ftp_proxy="http://username:password@your-proxy-server:port"
  14.  
  15. # 设置不需要代理的地址
  16. export NO_PROXY="localhost,127.0.0.1,10.0.0.0/8,.yourdomain.com"
  17. export no_proxy="localhost,127.0.0.1,localaddress,.yourdomain.com"
回复