ubuntu 代理配置

2023-08-22  本文已影响0人  michael_0x

为apt设置代理:

michael@node:~/Downloads$ ls /etc/apt/apt.conf.d/proxy.conf 
/etc/apt/apt.conf.d/proxy.conf
michael@node:~/Downloads$ cat /etc/apt/apt.conf.d/proxy.conf 
Acquire {
  http::Proxy "http://192.168.0.101:8888/";
  https::Proxy "http://192.168.0.101:8888/";
}

为shell和浏览器设置代理:

cat /etc/profile.d/proxy.sh

# set proxy config via profie.d - should apply for all users
export http_proxy="http://192.168.0.101:8888/"
export https_proxy="http://192.168.0.101:8888/"
export ftp_proxy="http://192.168.0.101:8888/"
export no_proxy="127.0.0.1,localhost"
# For curl
export HTTP_PROXY="http://192.168.0.101:8888/"
export HTTPS_PROXY="http://192.168.0.101:8888/"
export FTP_PROXY="http://192.168.0.101:8888/"
export NO_PROXY="127.0.0.1,localhost"
#将要从代理中排除的其他IP添加到NO_PROXY和no_proxy环境变量中
上一篇 下一篇

猜你喜欢

热点阅读