6

Possible Duplicate:
How do I set systemwide proxy servers in Xubuntu, Lubuntu or Ubuntu Studio?

I'd like to built a script to switch the proxies between home and work. I know that you can set the wget proxy by using export http_proxy=proxy_address, but that's not the setting where the gui saves the setting to.

Chrome for example uses the setting I deployed under System settings -> Network -> Proxy. Where is this information saved?

0

2 Answers 2

8

I found the solution to my question just 2 days ago.

In order to be able to switch quickly between work and home, I wanted to write a script which changes my proxy configuration for all applications at once. Most of the applications were easy, they all had some kind of configuration file, for which I just created a copy to use for work and for home.

The system proxy however, is saved in gconf. To make switching easy, I went to the network settings, changed the proxy to manual and entered all my information for the proxy (host & port).

Then if I wanted to surf without proxy, I simply had to execute the following command:

gsettings set org.gnome.system.proxy mode 'none'

In order to switch back to the proxy connection I had to use the following command:

gsettings set org.gnome.system.proxy mode 'manual'

No need to specify host & port again, since those are already saved. If, however, you have to work with several proxies and would need to switch between different hosts, you can specify the proxy data with the following commands:

gsettings set org.gnome.system.proxy.http port 8080

gsettings set org.gnome.system.proxy.http host 172.16.1.1

Changes take effect immediately.

Source

3

Proxy Authentication is stored in /etc/apt/apt.conf file. However you need root privileges to edit the file.

One way to edit it is:

gksu gedit /etc/apt/apt.conf

You may want to back it up first with:

sudo cp /etc/apt/apt.conf /etc/apt/apt.conf.old
2
  • 4
    This is specifically APT's proxy information; it doesn't seem to address the question of where the general proxy configuration is stored. Oct 7, 2012 at 10:31
  • @EliahKagan Yes, that's right. I have been able to figure it out.
    – Ahatius
    Oct 8, 2012 at 5:25

Not the answer you're looking for? Browse other questions tagged .