美文网首页
ubuntu 代理配置

ubuntu 代理配置

作者: michael_0x | 来源:发表于2023-08-22 21:47 被阅读0次

    为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环境变量中
    

    相关文章

      网友评论

          本文标题:ubuntu 代理配置

          本文链接:https://www.haomeiwen.com/subject/gvbumdtx.html