zoukankan      html  css  js  c++  java
  • 如何为linux系统设置全局的默认网络代理

    方法1:更改全局配置文件/etc/profile

    all_proxy="all_proxy=socks://proxy.xxx.com.cn:80/"
    ftp_proxy="ftp_proxy=http://proxy.xxx.com.cn:80/"
    http_proxy="http_proxy=http://proxj.xxx.com.cn:80/"
    https_proxy="https_proxy=http://proxy.xxx.com.cn:80/"
    no_proxy="no_proxy=localhost,127.0.0.0/8,::1,.xxx.intra"
    
    for var in "$all_proxy" "$ftp_proxy" "$http_proxy" "$https_proxy" "$no_proxy";do
          echo $var >> /etc/profile
    done
    
    for var in "all_proxy" "ftp_proxy" "http_proxy" "https_proxy" "no_proxy";do
          echo "export $var" >> /etc/profile
    done
    

     方法2:仅针对Gnome或MATE桌面系统, 根据GSetttings配置原理添加override文件

    [org.gnome.system.proxy]
    ignore-hosts=['localhost', '127.0.0.0/8', '::1'']
    
    [org.gnome.system.proxy.ftp]
    host='proxy.xxx.com.cn'
    port=80
    
    [org.gnome.system.proxy.http]
    host='proxy.xxx.com.cn'
    port=80
    
    [org.gnome.system.proxy.https]
    host='proxy.xxx.com.cn'
    port=80
    
    [org.gnome.system.proxy.socks]
    host='proxy.xxx.com.cn'
    port=80
    

      note:命令行下查询Gsetting数据库键值的方法

    [cxy@localhost-live x86_64]$ gsettings get org.gnome.system.proxy
    org.gnome.system.proxy         org.gnome.system.proxy.ftp     org.gnome.system.proxy.http    org.gnome.system.proxy.https   org.gnome.system.proxy.socks 
    [cxy@localhost-live x86_64]$ gsettings get org.gnome.system.proxy
    org.gnome.system.proxy         org.gnome.system.proxy.ftp     org.gnome.system.proxy.http    org.gnome.system.proxy.https   org.gnome.system.proxy.socks 
    [cxy@localhost-live x86_64]$ gsettings get org.gnome.system.proxy.http
    org.gnome.system.proxy.http    org.gnome.system.proxy.https   
    [cxy@localhost-live x86_64]$ gsettings get org.gnome.system.proxy.http 
    authentication-password  authentication-user      enabled                  host                     port                     use-authentication       
    [cxy@localhost-live x86_64]$ gsettings get org.gnome.system.proxy.http host
    'proxy.xxx.com.cn'
    

    [cxy@localhost-live x86_64]$ gsettings
    用法:
    gsettings --version
    gsettings [--schemadir SCHEMADIR] COMMAND [ARGS...]

    命令:
    help 显示此信息
    list-schemas 列出安装了的方案
    list-relocatable-schemas 列出可重定向的方案
    list-keys 列出某个方案中的键
    list-children 列出某个方案的子对象
    list-recursively 递归地列出键和值
    range 查询某个键的范围
    describe 查询某个键的描述
    get 获取某个键值
    set 设置某个键值
    reset 重设某个键值
    reset-recursively 重设指定方案中的所有值
    writable 检查某个键是否可写
    monitor 监视更改

    使用 'gsettings help 命令' 查看详细的帮助。

      

  • 相关阅读:
    Java数据结构和算法——汉诺塔问题
    svn的使用
    Struts+iBatis+Spring+mysql整合开发
    Java Collection
    IOS推送功能的实现(javapns)
    [工具库]JFileDownloader工具类——多线程下载网络文件,并保存在本地
    xsl 中 foreach 的使用
    网页制作技巧24条
    js 实现 datagrid 鼠标移动时datagrid 表的该变
    How to extend ASP.NET datagrid for multiselection of data rows.
  • 原文地址:https://www.cnblogs.com/noxy/p/9407254.html
Copyright © 2011-2022 走看看