Difference between revisions of "Linux proxy"

From Ever changing code
Jump to navigation Jump to search
Line 15: Line 15:
Append enviroment variables to ~/.profile
Append enviroment variables to ~/.profile
  http_proxy=http://proxyserver.local:8080/
  http_proxy=http://proxyserver.local:8080/
;Manage local environment variables
unset HTTP_PROXY  #unset HTTP_PROXY single variable
env -i bash        #unset all local variables back to default on login
exec bash          #unset all local variables back to default on login
= Resources =
= Resources =
*[http://askubuntu.com/questions/158557/setting-proxy-from-terminal setting-proxy-from-terminal]
*[http://askubuntu.com/questions/158557/setting-proxy-from-terminal setting-proxy-from-terminal]

Revision as of 15:07, 19 February 2016

When you behind a firewall of a company proxy you may need to configure your Linux distro to use it in coure to have access to internet

In the examples below depends on your proxy server it can be used without or with authentication. Many times this could be your Active Directory login/password combination. It does not need to be user name that you logged on.

Temporary set up per command
sudo env http_proxy=http://proxyserver.local:8080 apt-get update
sudo env http_proxy=http://username:password@10.0.0.1:8080 apt-get update
Temporary set up per session, remember to use -E with sudo to preserve local environment variables
export http_proxy=http://proxyserver.local:8080/
export ftp_proxy=http://username:password@proxyserver.local:8080/
sudo -E apt-get update 
Permanent per user

Append enviroment variables to ~/.profile

http_proxy=http://proxyserver.local:8080/
Manage local environment variables
unset HTTP_PROXY   #unset HTTP_PROXY single variable
env -i bash        #unset all local variables back to default on login
exec bash          #unset all local variables back to default on login

Resources