Setting Ubuntu for Proxy Authenticated Networks

Ubuntu is the most widely used Linux Operating system, but it doesn’t work with authenticated proxy servers out of the box. Authenticated proxy servers are used in a lot of educational institutions and corporate companies .There is an option for using proxy server in Settings->Network->Network Proxy. But that doesn’t help  with authenticated proxy servers as software center and terminal commands don’t work .

Here’s how you set up Ubuntu to work with Authenticated proxy servers :

  • Open your terminal by pressing (Ctrl + Alt + t) or you can search for Terminal in dash menu.
  • Type
    sudo gedit /etc/apt/apt.conf

    in the terminal. This will open the file apt.conf which is the main configuration file for the APT suite of tools.

  • If you have already added the proxy server and port in Settings->Network->Network Proxy, the file will look something like this :Screenshot from 2016-01-31 18:38:29

where is the proxy server address and 3128 is the port. These will vary accordingly from place to place. If you haven’t done the settings in the settings menu it will be a blank file .

  • Add (or edit ) the following lines to the file ,
  Acquire::http::proxy "http://username:password@";
  Acquire::https::proxy "https://username:password@";
  Acquire::ftp::proxy "ftp://username:password@";
  Acquire::socks::proxy "socks://username:password@";

replacing username,password,proxy_server and port with yours.Now it should look   like this :Selection_001

  • Save the file and close it.
  • Next we will edit the bash.bashrc file.Commands in the /etc/bash.bashrc are executed if the bash shell is opened by any user.Type
    sudo gedit /etc/bash.bashrc

    in the terminal to open the file as root user.

  • Scroll down to the end of the file and add the following ,
export http_proxy="http://username:password@"
export https_proxy="https://username:password@"
export ftp_proxy="ftp://username:password@"

Now it should look like this :Selection_002

  • Save the file and reboot your PC. The software center and terminal commands should work now.



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s