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.
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 :
where 126.96.36.199 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:email@example.com:3128/"; Acquire::https::proxy "https://username:firstname.lastname@example.org:3128/"; Acquire::ftp::proxy "ftp://username:email@example.com:3128/"; Acquire::socks::proxy "socks://username:firstname.lastname@example.org:3128/";
replacing username,password,proxy_server and port with yours.Now it should look like this :
- Save the file and close it.
- Next we will edit the bash.bashrc file.Commands in the
/etc/bash.bashrcare executed if the
bashshell 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:email@example.com:3128" export https_proxy="https://username:firstname.lastname@example.org:3128" export ftp_proxy="ftp://username:email@example.com:3128"
Now it should look like this :
- Save the file and reboot your PC. The software center and terminal commands should work now.