I have seen a lot of posts but couldn't find a simple answer that summarizes everything.
I am new so I am still confused.
Thanks :)
I have seen a lot of posts but couldn't find a simple answer that summarizes everything.
I am new so I am still confused.
Thanks :)
As there a lot of places to configure proxy settings, it might get confusing at beginning. Let me summarize some things and suggest some good practices.
Ex: wget, git and almost every console application which connects to internet.
If you want to configure proxy every time you run your commands for some reason then set the environment variables using following commands.
export http_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/
export ftp_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/
Else if you want to use the same settings everytime for all users, then use of these.
Configure in bashrc
$ nano /etc/bash.bashrc
export http_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/
export ftp_proxy=http://DOMAIN\USERNAME:PASSWORD@SERVER:PORT/
Configure in /etc/environment
$ nano /etc/environment
https_proxy="http://myproxy.server.com:8080/"
ftp_proxy="http://myproxy.server.com:8080/" ...
Configure using GUI
Open the network settings and set the your system wide network proxy.
Network -> Network proxy -> Configure -> Apply system wide.
But this might not be useful if you have authentication for the proxy.
You need to do some extra work for apt, as incidentally apt doesn't obey environment variables,
$ nano /etc/apt/apt.conf
Acquire::http::Proxy "http://USERNAME:PASSWORD@SERVER:PORT";
Acquire::https::Proxy "https://USERNAME:PASSWORD@SERVER:PORT";
For everything out of this scope, there must be an option to configure proxy settings in the application itself. If not I'm sorry ;)
apt-get
has, for some versions, now, supported the http_proxy
and https_proxy
environment variables.
– muru
May 16 '17 at 01:53