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

 

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章