Monday, May 1, 2017

Using Ubuntu behind proxy server!

Normally the enterprise environment have a proxy server for security and log reasons. How we can use Ubuntu to navigate and install packages behind that proxy? It's easy, only few lines need a little change.

First you need add the proxy settings on System Settings | All settings | Network | Network Proxy just like below, click on Apply System wide and close.



Then to use the apt package manager you need the proxy environment set and /etc/apt/apt.conf configured. So let's see this files.

/etc/apt/apt.conf

Acquire::http::proxy "http://user:password@172.16.100.100:8088/";
Acquire::https::proxy "https://user:password@172.16.100.100:8088/";
Acquire::ftp::proxy "ftp://user:password@172.16.100.100:8088/";


You need change the apt.conf file to add user, password, IP address and port of your Proxy server, like file showed before.

To set environment variables to use proxy you can use your /home/user/.profile to make permanent changes or use a terminal to configure for the current session.

On terminal type:

~$ export http_proxy=http://user:password@172.16.100.100:8088
~$ export https_proxy=https://user:password@172.16.100.100:8088
~$ export ftp_proxy=ftp://user:password@172.16.100.100:8088

To verify type on term:

env | grep oxy

This will find for any match for pattern "oxy"  like "proxy" in environment variables.

Well be happy and use your linux in all places.
;ยบ)



No comments:

Post a Comment