Linux proxy
Jump to navigation
Jump to search
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.
Make sure you can resolve the proxy server DNS name otherwise you may need to use IP address.
- 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/ sudo -E apt-get update #still requires to pass on local environment variable to be executed as root
- 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