首页 > Computer > How to change Gnome Proxy Settings on a Terminal window
2011
08-04

How to change Gnome Proxy Settings on a Terminal window

This document will show how to change proxy settings for Gnome from a terminal window (not from gnome-network-preferences).

The configuration information is saved under .gconf (front end GconfEdior), which is a system for storing application preference in Gnome (think Registry for Windows PC).

Keys can be accessed in terminal under “/home/user/.gconf/*”. The command below will display current proxy configuration loaded by gconf:

$ cat .gconf/system/http_proxy/%gconf.xml

This will be the same as:


The proxy configuration can be divided into two parts:
. /system/proxy/ – Configures SOCKS Proxy
. /system/http_proxy/ – Configures HTTP proxy

We can use gconftool -R to view the options within the subkeys. For the screenshot above we would get something similar to this:

$ gconftool -R /system/proxy
old_ftp_port = 0
socks_host = 127.0.0.1
mode = manual
old_socks_port = 0
secure_host = 127.0.0.1
ftp_host = 127.0.0.1
socks_port = 80
old_secure_host =
secure_port = 80
ftp_port = 80
old_ftp_host =
autoconfig_url =
old_secure_port = 0
old_socks_host =

$ gconftool -R /system/http_proxy
use_http_proxy = true
use_authentication = false
host = 127.0.0.1
authentication_user =
ignore_hosts = [localhost,127.0.0.0/8,*.local]
use_same_proxy = true
authentication_password =
port = 80

So, to edit the proxy to the same settings as the one shown on the screenshot, we would do the following:

$ gconftool -s /system/http_proxy/use_http_proxy -t bool true
$ gconftool -s /system/http_proxy/host -t int 127.0.0.1
$ gconftool -s /system/http_proxy/port -t int 80
$ gconftool -s /system/http_proxy/use_same_proxy -t bool true

$ gconf -s /system/proxy/mode -t string manual

最后编辑:
作者:wy182000
这个作者貌似有点懒,什么都没有留下。

留下一个回复