CentOS 在 Terminal 用 Proxy [http,https,ftp]

2016-04-02 CentOS

在 Windows 使用網際網路選項設定 Proxy 上網

在 圖形化的 Linux,瀏覽器也支援 Proxy 設定

 

但是在 terminal 的話要如何使用 Proxy 上網!?

 

在 Linux 中有 proxy 環境變數可以這樣用

$ vim proxy_wget

# Proxy : http_proxy, https_proxy, ftp_proxy ..
export http_proxy=http://proxy.server:80

$ wget http://www.yahoo.com
正在查找主機 proxy.server...

$ unset http_proxy

 

你也可以把 http , https, ftp 一次代理起來

$ export {http,https,ftp}_proxy="http://proxy-server:port"
$ unset {http,https,ftp}_proxy

 

要常駐就寫到 ~/.bashrc 吧!

 

參考資料:

HowTo : Use a Proxy on the Linux Command Line

給 Mr. 沙先生一點建議

彙整

分類

展開全部 | 收合全部

License

訂閱 Mr. 沙先生 的文章

輸入你的 email 用於訂閱