Friday, September 26, 2008

Proxy setting on Linux

If your Linux box is behind a proxy server then to access the internet, proxy configuration will be required. The 'http_proxy' and 'ftp_proxy' environment variables hold the information about proxy server. Just execute the following commands-

$export http_proxy=http://<proxy-server-ip>:<port>
$export ftp_proxy=http://<proxy-server-ip>:<port>


Now wget, yum, apt-get etc. can use these variables to access http/s and ftp URLs out of office LAN. If proxy server needs authentication credentials then pass them as shown below-

$export http_proxy=http://<user>:<password>@<proxy-server-ip>:<port>
$export ftp_proxy=http://<user>:<password>@<proxy-server-ip>:<port>


To avoid executing these commands every time you login or reboot the machine then add them in ~/.bashrc file.

10 Comments:

Anonymous said...

very helpful, thank you.

Anonymous said...

Extremely helpful. Thank you.

Anonymous said...

thanks mate, your post was a timely help.

Anonymous said...

Thanks a ton....it was really helpful

Cheers to google too for spotting this :)

Anonymous said...

How to add domain in http proxy configuration...

Anonymous said...

How to add domain in http proxy configuration? please help in timely manner anybody??

chrupq said...

Thanks for putting the tip on Your blog.

Anonymous said...

To Add domain use below:

$export http_proxy=http://:@:
$export ftp_proxy=http://:@:

Anonymous said...

Thanks a bunch

Wine Cookbooks said...

Good reading this postt