Ubuntu – Set Network Proxy with Authentication


Ubuntu-set Network proxy with Authentication , we know that Ubuntu provides various ways to access Internet through proxy servers. One of the easiest ways is to use the Gnome Network Properties.

To use Gnome Network Properties,

1. Go to System Settings

Screenshot from 2014-07-05 00:51:46

2. Click on Network and then click on Network proxy.

Screenshot from 2014-07-05 00:52:14

3. Select Manual in Methods and then insert proxy details

4. Finally click on “Apply System Wide” and you are done.

If you are accessing Internet from School/College/Office network, chances are that you need to enter authentication details. And that’s where Gnome Network Properties fails. It does not provide any means to connect through a proxy server.

Another problem that occurs sometimes after you set proxy through Settings -> Network -> Network Proxy -> Manual -> Apply System Wide is that the packaging tool apt-get and Ubuntu Software Center can not connect to Internet.

There are two ways to overcome these problems.

One simple way is to set up a temporary proxy session through terminal. In that particular session, you can browse the Internet as well as download and install packages through apt-get. If you are using a http-proxy, then to Set up a temporary proxy session, type the following in the terminal –

                export http_proxy=http://proxyaddress:proxyport

Replace proxyaddress with your host address (e.g and proxyport with the required port (e.g 9050)

If the server you are trying to connect uses anything other than http-proxy like a ftp-proxy or https-proxy, just replace the http-proxy part of the above command with ftp-proxy or https-proxy

If you are using authenticated proxy, then you need to enter your username and password in the same command like this –

       export http_proxy=http://username:[email protected]:proxyport

As stated earlier, this method creates a temporary proxy session and it will be over once you log out of the system. You can, however, create a permanent proxy session by the following steps –

Open the terminal and type the follwing –

                sudo gedit /etc/apt/apt.conf.d/40proxy

This will create a file 40proxy in the /etc/apt/apt.conf.d directory and will open it in gedit text editor.

Now, add the following lines in the editor (alternatively just copy and paste the following)

    Acquire::http::proxy “http://username:[email protected]:proxyport/”;

    Acquire::https::proxy “https://username:[email protected]:proxyport/”;

   Acquire::ftp::proxy “ftp://username:[email protected]:proxyport/”;

   Acquire::socks::proxy “socks://username:[email protected]:proxyport/”;
Replace all the username and password with your username and corresponding password. Also replace proxyaddress with your host address (e.g and proxyport with the required port (e.g 9050). Refer the screenshot below as an example – 

Screenshot from 2014-07-05 02:50:20


Last Updated on by Vamsee Angadala

Get Your Daily Dose of Tech Delivered To Your E-Mail!

Get updates on all the latest news, offers and more. Subscribe to our newsletter now!

By subscribing, you agree to our Privacy Policy.

Latest Stories

Q Mic – Designed for ASMR, Amateur & Professional...

With the rise of ASMR & other content types, recording high-quality sound is quite necessary. One particular problem content creators face having different mics...

Fossil sport review – Bringing out the fitness beast...

Fossil, one of my favorite watch manufacturers came up with a new smartwatch, Fossil Sport, recently. Fossil is not new to Google wear OS...

EasySMX VIP002D Review

Recently, we tried quite a few gaming accessories and a cheap gaming headset was among them. While I quite liked the product, in terms...

ROG Phone II Hands-on Review – My First Impressions...

ROG Phone II is finally official now. Yet again, the leaks have come true, and boy, the device is lit AF. I was invited...

Related Stories

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.