How to Configure Proxy Settings in Linux


Here are two ways to configure Linux to recognize a proxy server or proxy configuration file.

Operating System Level

Personal kneeling in stone tunnel, photo credit jondoe via flickr

photo credit: jondoe

Use the following commands to configure your proxy for http and ftp traffic on the command line
export http_proxy=http://<proxy host or IP>:<proxy port >
export ftp_proxy=http://<proxy host or IP>:<proxy port >

If your proxy requires login/authentication, you can use the format:
export http_proxy=http://username:password@:<proxy host or IP>:<proxy port >

To have this applied every time you log in, place these lines in your .bashrc in your home (~) directory.
export http_proxy=http://<proxy host or IP>:<proxy port >
export ftp_proxy=http://<proxy host or IP>:<proxy port >

System-Wide Proxy Settings can be set in your Network Settings

For GNOME, go to Computer->Desktop Preferences->Network Proxy
For KDE desktop manager, you can get to the network proxy settings under System Settings > Network Settings > Proxy

In the setting you can configure either by your proxy server and port, by the network, or a file via a URL/file location (e.g. http://myproxyserver:port/proxyfile.pac) .

These setting work with most other applications (e.g. other browsers like Chrome, OS commands).

Program/Application Level

Some applications and commands will not pick up the system wide proxy settings, so you have to configure each program you use. Below are some common examples.

Firefox

Occasionally, Firefox does not pick up the operating system proxy setting.
You can manually set up the Firefox proxy in Options menu. Go to Options > Advanced > Settings.

Fedora – Yum Package Manager

yum proxy settings can be found in the file system at
/etc/yum.conf

Add a line to the file with the following information:
proxy=http://<proxy IP>:<proxy port >
The next time you run yum, it will pick up that proxy.

For Ubuntu

Here is a similar how to article on configuring proxy settings in Ubuntu covering Synaptic Package Manager, Gnome, apt-get, and Firefox.

About these ads

One thought on “How to Configure Proxy Settings in Linux

  1. Pingback: Proxy Servers | Linux Academy

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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