Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Install and use Squid under Linux

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the installation and application of Squid under Linux, which is very detailed and has certain reference value. Friends who are interested must finish it!

Squid is a popular proxy server and Web cache server for free software (GNU General Public license).

Installation and configuration

Install the squid package using sudo:

$sudo dnf install squid-y

The squid configuration files are huge, but we only need to configure some of them. Squid uses access control lists to manage connections.

Edit the / etc/squid/squid.conf file and make sure you have the two lines explained below.

First, specify your local IP network. The default configuration file already lists the most commonly used ones, but if not, you need to add your configuration. For example, if your local IP network range is 192.168.1.X, the line would look like this:

Acl localnet src 192.168.1.0/24

Next, add the following line to add the SSH port as a secure port:

Acl Safe_ports port 22

Save the file. Now enable and restart the squid proxy service:

$sudo systemctl enable squid$ sudo systemctl restart squid

The squid agent listens on port 3128 by default. Configure firewalld to allow this service:

$sudo firewall-cmd-- add-service=squid-- perm$ sudo firewall-cmd-- reload test ssh proxy connection

To connect to the server through the ssh proxy server, we will use netcat.

If nmap-ncat is not already installed, install it:

$sudo dnf install nmap-ncat-y

This is an example of a standard ssh connection:

$ssh user@example.com

This is how the squid proxy server is used as a gateway to connect to the server.

This example assumes that the IP address of the squid proxy server is 192.168.1.63. You can also use the hostname of the squid proxy server or FQDN:

$ssh user@example.com-o "ProxyCommand nc-- proxy 192.168.1.63 proxy 3128% h% p"

Here is what these options mean:

ProxyCommand-tells ssh to use the proxy command. Nc-the command used to establish a connection to the proxy server. This is the netcat command. % h-placeholder for the hostname or IP address of the proxy server. % p-placeholder for the proxy server port number.

There are many ways to configure the SSH proxy server, but this is an easy way to get started.

The above is all the contents of the article "install and use Squid under Linux". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report