How To Use a Proxy Server in Linux Mint 20 (For Beginners)

How To Use a Proxy Server in Linux Mint 20 (For Beginners)

How To Use a Proxy Server in Linux Mint 20 (For Beginners)

Roughly four out of every five internet users encountered internet censorship in 2022. 

But not every user hits a virtual wall when attempting to access a website or online service for the same reason. Besides content regulations, geopolitics and company policies also influence website restrictions. 

Regardless, a proxy server is just what you need to access restricted content from your device. 

This server acts as an intermediary between you and the web. It takes the requests you make and forwards them to the destination website. Of course, the server receives the responses to these requests and sends them to your device.

Let’s explore how to use a proxy server in Linux Mint in this quick post. 

The steps include installing and configuring a proxy server on your machine before activating it.

Installing Proxy Server in Linux Mint

To get started with setting up a proxy server in Linux Mint 20, follow these simple steps:

Step #1: Open the Terminal

Press “Ctrl + Alt + T” on your keyboard to launch the Terminal. This powerful command-line tool is your gateway to configuring the proxy server.

Step #2: Update the Package List

Before installing any new software, it’s essential to ensure that your system is up to date. Execute the following command to update the package list:

sudo apt-get update

 

Step #3: Install the Squid Proxy Server Package

The Squid proxy server is a reliable choice for setting up a proxy server on Linux Mint. Install it by running the following command:

sudo apt-get install squid

 

This command will fetch and install the Squid package from the repositories.

Step #4: Open the Squid Configuration File

Once the installation is complete, you need to access the Squid configuration file to make the necessary modifications. You can open the file using the nano text editor, which you can launch in the terminal by running:

sudo nano /etc/squid/squid.conf

 

Step #5: Configure the Proxy Server

In the Squid configuration file, find the line that starts with “http_port” and remove the “#” from in front of it to uncomment it.

You can now enter the port number you want to use where you see the default port number 3128.

Say you prefer to use port 9696, modify the line as follows:

http_port 9696

 

Save the changes you made by pressing “Ctrl + O.” You can then close the editor and return to the terminal by hitting “Ctrl + X.”

Step #7: Set Access Control Rules

You can add specific IP address ranges to control access to your proxy server. For instance, to allow access only from the IP address range 192.168.0.0/24, include the following lines in the configuration file:

acl allowed_network src 192.168.0.0/24

http_access allow allowed_network

 

These lines restrict access to the proxy server, ensuring security and control.

Step #8: Save Changes and Restart Squid

 Save the changes you made to the configuration file by pressing “Ctrl + O” and exit the editor. 

Finally, restart the Squid service to apply the new configuration by running:

sudo systemctl restart squid

 

Configuring Proxy Settings in Linux Mint

Configuring a proxy server in Linux Mint is a straightforward process that involves modifying your system’s network settings. 

Follow these steps to configure the proxy settings:

Step #1: Open Network Settings

Begin by accessing the Network Settings window. 

You can do this by clicking on the network icon in the system tray and selecting “Network Settings” from the drop-down menu. Alternatively, directly open the “Network” option from the “System Settings” menu.

Step #2: Access Proxy Settings

Navigate to the top tabs in the Network Settings window and select the “Proxy” option. You will soon see the proxy settings page.

Step #3: Enable the Proxy Server

The proxy settings page is loaded with several configuration options. Toggle the switch at the top of the page to “On” to activate the proxy server.

Step #4: Choose Proxy Method

Specify the method you’ll be using for the proxy server. 

Click on the drop-down menu next to the “Method” section and select “Automatic.” If you’re uncertain about the type of proxy server you’re using, contact your network administrator for guidance.

Step #5: Enter Server Details

Besides the hostname or IP address of the proxy server, you must enter the corresponding port number in the fields that appear. You may also need to input your username and password if the server demands authentication.

Click “Apply” to save the changes. Any applications that rely on the system proxy settings will automatically utilize the configured server.

In some cases, it may be necessary to restart your system for the changes to take effect and ensure smooth operation with the new proxy settings.

Setting up Proxy Authentication in Linux Mint

Setting up the proxy server’s authentication is a prerequisite to accessing specific resources or services with it. 

Follow these steps to configure proxy authentication:

Step #1: Open the Terminal

Hit the hotkey “Ctrl + Alt + T” on your keyboard or open the applications menu and search for “Terminal.”

Step #2: Edit Environment Variables

In the Terminal, enter the following command to edit the environment variables:

sudo nano /etc/environment

 

Step #3: Add Authentication Lines

Scroll to the end of the file and add the following lines, replacing “username” and “password” with your username and actual password:

http_proxy=http://username:password@proxy-server:port/

https_proxy=https://username:password@proxy-server:port/

ftp_proxy=ftp://username:password@proxy-server:port/

 

Make sure to replace “proxy-server” and “port” with the appropriate values for your proxy server.

Step #4: Reload Environment Variables

To apply the changes made to the environment variables, execute the following command in the Terminal:

source /etc/environment

 

Bear in mind that if the proxy server you’ve picked demands Kerberos, NTLM or another authentication type, you’ll need to use other methods to authenticate the proxy.Â