- http_Proxy environment variable is used to specify proxy settings to wget and curl. To find the proxy server already set on a Linux machine, use the following command:
echo $http_proxy
- To set http_proxy without username and password:
export http_proxy=http://SERVER-NAME:PORT/
- To set http_proxy with username and password:
export http_proxy=http://USER-NAME:PASSWORD@SERVER-NAME:PORT/
- To set http_proxy with username, password, and domain:
export http_proxy=http://DOMAINUSERNAME-NAME:PASSWORD@SERVER-NAME:PORT/
- In the above command, make sure the literal backslash is doubled.
- When the username or password uses the @ symbol, add a backslash () before the @ as follows:
export http_proxy=http://DOMAINUSER-NAME@ME:PASSWORD@SERVER-NAME:PORT
- To make the proxy server settings permanent:
echo "http_proxy=http://proxy.computeman.com:3000/" > /etc/environment
- To set yum proxy, add/modify the following lines to yum.conf.
proxy=http://proxy.example.com:3000
proxy_username=yum-username
proxy_password=hjytr
- To make proxy server settings permanent for bash and sh user, create a new file /etc/profile.d/http_proxy.sh and run the following command.
echo "export http_proxy=http://proxy.computeman.com:3000/" > /etc/profile.d/http_proxy.sh
- To make proxy server settings permanent for csh and tcsh users, create a new file /etc/profile.d/http_proxy.sh and run the following command.
echo "setenv http_proxy http://proxy.computeman.com:3000/" > /etc/profile.d/http_proxy.csh
If you are trying to configure a proxy for chrome or firefox, you need to go through its user guide.