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.
$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:
very helpful, thank you.
Extremely helpful. Thank you.
thanks mate, your post was a timely help.
Thanks a ton....it was really helpful
Cheers to google too for spotting this :)
How to add domain in http proxy configuration...
How to add domain in http proxy configuration? please help in timely manner anybody??
Thanks for putting the tip on Your blog.
To Add domain use below:
$export http_proxy=http://:@:
$export ftp_proxy=http://:@:
Thanks a bunch
Good reading this postt
Post a Comment