Setting up a proxy server in Ubuntu

A proxy server is a kind of intermediate PC that is an intermediary between the user's computer and the Internet. It is through this computer and pass all your Internet requests. The server processes them and sends you files downloaded from the internet. Typically, corporate networks use a proxy server to access the Internet. In order for utilities to understand that they need to connect through a proxy, it is important to configure the system variables. Thus, you will configure most utilities to work with a proxy server and, last but not least, such a process is global in nature, and it concerns all users of the system. In this article we will analyze in detail how to set up a connection through a proxy server in Ubuntu. Let's figure it out. Go!

Learn how to set up a proxy connection in Ubuntu correctly and independently.

To configure the connection to Ubuntu through a proxy, you must open the System Settings menu, and then go to the Network section.

Find the “Network” section in the operating system.

Click on the item "Network proxy service" and set the "Manual" method, then enter your settings.

In the "Network Proxy Service" and set the "Manual" method

The next step is to make your own settings.

The disadvantage of this method is that if you have a proxy with authorization by login and password, you cannot specify this data, and, as a result, the proxy will not work.

You can also configure the system level through configuration files. To do this, open the file / etc / environment with root-rights (this is done with the command: sudo nano / etc / environment). At the end of the file, add the lines:

https_proxy = "// user: : port /"

http_proxy = "// user: : port /"

ftp_proxy = "ftp: // user: : port /"

socks_proxy = "socks: // user: : port /"

If proxy is not authorized, then the lines should look like:

_proxy = "// proxy: port /"

To make the changes in the settings take effect, reboot.

Usually, a global proxy configuration is enough for all other utilities to work through it without the need to enter proxy data inside the program. However, some utilities cannot work with global parameters or they require special settings.

Firefox

Firefox allows you to use not only the global settings, but also your own. To assign a proxy, go to the browser settings window and open the "Advanced" tab, then click "Network" and click on the "Configure" button. An important feature is that Firefox can use NTLM authentication. This distinguishes Firefox from many other browsers.

Firefox can easily use its own settings.

Chromium

This browser can also use global parameters, while having its own. To assign a proxy, open the file / etc / chromium-browser / default and add the line there:

CHROMIUM_FLAGS = "- proxy-server = address: port"

Now you need to restart Chromium

Apt

New versions can work with global parameters, unlike the old ones, which worked exclusively with personal ones. In the /etc/apt/apt.conf file you need to register:

Acquire :: http :: proxy “// login: password @ ip_proxy: port_proxy /”;

Acquire :: https :: proxy "// login: password @ ip_proxy: port_proxy /";

Acquire :: ftp :: proxy "// login: password @ ip_proxy: port_proxy /";

Acquire :: socks :: proxy "// login: password @ ip_proxy: port_proxy /";

Acquire :::: Proxy "true";

If the server is not authorized, then the login and password will have to be removed.

Bash

Of course, the above configuration via / etc / environment will work for each utility that has been launched through the terminal. If you need to set the parameters directly for the utility being run, then before starting it run:

export http_proxy = '// login: password @ ip_proxy: port_proxy /'

export ftp_proxy = '// login: password @ ip_proxy: port_proxy /'

wget

Add to the / etc / wgetrc file:

proxy-user = username

proxy-password = password

http_proxy = //xxx.xxx.xxx.xxx:8080/

ftp_proxy = //xxx.xxx.xxx.xxx:8080/

use_proxy = on

If proxy without authorization, remove proxy-user and proxy-password

apt-add-repository

Most institutions block all dubious, unknown ports to the outside. As a rule, the port number 11371 is also blocked, which is used by the apt-add-repository program to add repositories. There is a simple solution that allows you to receive repository keys through port 80, which is used to access Internet pages.

Edit the file /usr/lib/python2.6/dist-packages/softwareproperties/ppa.py (requires root rights, instead of /usr/lib/python2.6 version 2.7 may be available). Find the line keyserver.ubuntu.com and replace:

hkp: //keyserver.ubuntu.com

on

hkp: //keyserver.ubuntu.com: 80

Now you will know how to set up a connection through a proxy server in Ubuntu. Write in the comments if you have successfully coped with the proxy settings, share your experience with other users, and ask any questions you may have about the topic of the article.