Temporary proxy functions: vim ~/.bashrc, and then source ~/.bashrc

# use proxy
function pxy() {
    export {http,https,ftp}_proxy="http://your_url:your_port"
    echo proxy: http://your_url:your_port
}

# use no proxy
function nopxy() {
    unset {http,https,ftp}_proxy
    echo proxy: none
}

Make sudo inherit current proxy settings: sudo visudo -- Original Artical Here

Defaults env_keep += "ftp_proxy http_proxy https_proxy"

Global proxy: sudo vim /etc/profile

http_proxy="http://your_url:your_port"
https_proxy=$http_proxy
export http_proxy https_proxy

yum proxy: sudo vim /etc/yum.conf

proxy="http://your_url:your_port"
Comments
Write a Comment