- 設置全局代理,需要編輯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