Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides
https://forum.ivorde.com/

Set up HTTP PROXY for shell internet access Linux/FreeBSD
https://forum.ivorde.com/set-up-http-proxy-for-shell-internet-access-linux-freebsd-t19732.html
Page 1 of 1

Author:  mandrei99 [ Tue Jan 20, 2015 4:59 pm ]
Post subject:  Set up HTTP PROXY for shell internet access Linux/FreeBSD

Setting HTTP PROXY for command line tools such as wget/fetch/pkg_add/yum/apt-get on Linux and Freebsd.

Wget/apt-get/fetch/yum/pkg_add -rv and the rest of command line tools in Linux and FreeBSD that use HTTP protocol will not use the proxy settings from your Firefox/Konqueror/Opera browsers. Instead, an environment variable "HTTP_PROXY" must be set and exported.

Assuming that your HTTP Proxy IP address is 192.168.0.1 port 3128 (standard proxy port), you must use following command (as the user you wish you have this setting for):

Code:
# export HTTP_PROXY='http://192.168.0.1:3128'

Setting up HTTP Proxy with authentication for command line tools in FreeBSD and Linux

Code:
export HTTP_PROXY='http://username:password@192.168.0.1:3128'
In order to make this proxy permanent, add the line to your ~/.profile or /etc/profile or ~/(bash|ksh|sh)rc file.

The export command is obvious: it tells the shell that all programs started from this point on, to use this variable.

Removing HTTP_PROXY for current shell requires unsetting the variable:
Code:
# unset HTTP_PROXY

Note: Some shells require the variable in lower case: "http_proxy".

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/