Proxying all Linux Traffic – set web access for Ubuntu behind a proxy

So that it’s documented… I’m using port 8080 as the default port as the likelyhood of your upstream proxy being on 8080 is high – else, typical proxy ports are, of course, 80, 800 (transpartent), 8000, 3128 (squid)

To force your server to force web traffic via a proxy, just two quick things to set – in /etc/environment, export one (or two) variables:

export http_proxy=http://USER:PASSWORD@PROXYIP:8080/
export ftp_proxy=http://USER:PASSWORD@PROXYIP:8080/

For apt, set the proxy for apt-get in /etc/apt/apt.conf.d/70debconf

Acquire {

http {

Proxy "http://USER:PASSWORD@PROXYIP:8080/";
No-Cache "false";
Max-Age "86400";
No-Store "false";

};

};

And that’s it!