Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

marked as duplicate by Eliah Kagan, maythux, Mitch, devav2, jokerdino Oct 8 '12 at 8:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

2 Answers 2

up vote 3 down vote accepted

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 where 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

share|improve this answer
add comment

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:

cd /etc/apt && sudo cp apt.conf apt.conf.old
share|improve this answer
    
This is specifically APT's proxy information; it doesn't seem to address the question of where the general proxy configuration is stored. –  Eliah Kagan Oct 7 '12 at 10:31
    
@EliahKagan Yes, that's right. I have been able to figure it out. –  Ahatius Oct 8 '12 at 5:25
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.