If you are having ubuntu desktop/laptop in your office or at home behind proxy aerver this tutorial is for you.This tutorial will explain How to Configure Ubuntu desktop/laptop to use your proxy server from terminal.
Enable proxy setting from terminal in ubuntu 12.04
Open the terminal and run the following commands
Important Note:- Host IP and port setting will be different please check with your proxy administrator
gsettings set org.gnome.system.proxy.socks host '192.168.1.1′
gsettings set org.gnome.system.proxy.socks port 8080
gsettings set org.gnome.system.proxy mode ‘manual'
Disable proxy setting from terminal in ubuntu 12.04
gsettings set org.gnome.system.proxy mode ‘none'
Incoming search terms:
- ubuntu 12 04 proxy settings
- ubuntu 12 04 proxy
- proxy ubuntu 12 04
- how to change proxy settings in ubuntu 12 04
- how to set proxy in ubuntu 12 04
- ubuntu terminal proxy
- ubuntu 12 04 set proxy
- proxy settings ubuntu 12 04
- configurar proxy ubuntu 12 04
- proxy ubuntu 12





when I run the ‘gsettings set org.gnome.system.proxy mode ‘none’ I get an error:
** (process:4676): WARNING **: The connection is closed
** (process:4676): WARNING **: The connection is closed
When I ps aux | grep 4676 there isn’t a process associated with it.
Any thoughts?
[Reply]
Hello.
Thanks for this hint, but what to do when my proxy requires authentication (with user and password)?
Greetings
[Reply]
gsettings set org.gnome.system.proxy.http authentication-user true
gsettings set org.gnome.system.proxy.http authentication-user ‘login’
gsettings set org.gnome.system.proxy.http authentication-password ‘pass’
[Reply]
So now, script it so you can change from proxied to not proxied:
#!/bin/bash
ping -c 1 192.168.1.1
if [ $? -eq 0 ]
then
gsettings set org.gnome.system.proxy.socks host ’192.168.1.1?
gsettings set org.gnome.system.proxy.socks port 8080 #squid uses 3128
gsettings set org.gnome.system.proxy mode ‘manual’
echo “Proxy set to 192.168.1.1 port 8080
else
gsettings set org.gnome.system.proxy mode ‘none’
echo “No proxy”
fi
exit
make it executable, put it in a directory in your path, and run it at will, or run it from /etc/local.rc (with the full path) on boot
This is useful to me because sometimes my laptop is on my home ethernet, and sometimes on wireless.
[Reply]
Wastrel Reply:
July 10th, 2012 at 6:04 pm
Oops, omit the indent on the shebang, and fully quote the echo statements.
[Reply]
Well, I made other typos, but surely the readers of this page can figure them out….
[Reply]
Does gsettings also work if you’re running KDE on Ubuntu?
[Reply]