• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to install and configure User Authentication in Squid on Ubuntu 16.04

{{postValue.id}}

To install and configure User Authentication in Squid on Ubuntu 16.04

Squid is a proxy server that acts as an intermediate between the internet and a local network. The purpose of this configuration is to allow the Squid user to access internet with their own login credentials using nsca_auth. This tutorial explains the installation and configuration process of User Authentication in Squid on Ubuntu 16.04.

Installation and Configuration procedure

To start with the configuration process, install the Squid server in the system by executing the following command and press y to continue with the installation.

root@linuxhelp:~# apt install squid -y
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gnome-software-common libgtkspell3-3-0
Use ' sudo apt autoremove'  to remove them.
The following additional packages will be installed:
  libecap3 squid-common squid-langpack
Suggested packages:
  squidclient squid-cgi squid-purge smbclient winbindd
The following NEW packages will be installed:
  libecap3 squid squid-common squid-langpack
0 upgraded, 4 newly installed, 0 to remove and 589 not upgraded.
Need to get 2,648 kB of archives.
.
.
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Processing triggers for ufw (0.35-0ubuntu2) ...

Start the Squid service by running the following command.

root@linuxhelp:~# service squid start

Next install Apache service in the system by executing the following apt install command.

root@linuxhelp:~# apt install apache2
Reading package lists... Done
Building dependency tree       
Reading state information... Done
apache2 is already the newest version (2.4.18-2ubuntu3.5).
The following packages were automatically installed and are no longer required:
  gnome-software-common libgtkspell3-3-0
Use ' sudo apt autoremove'  to remove them.
0 upgraded, 0 newly installed, 0 to remove and 589 not upgraded.

Start the Apache service.

root@linuxhelp:~# service apache2 start

Next add the password for the user by running the following command and enter the new password.

root@linuxhelp:~# htpasswd -c  /etc/squid/squid_passwd user1
New password: 
Re-type new password: 
Adding password for user user1

Create a new file for user by executing the following command.

root@linuxhelp:~# touch /etc/squid/passwd

Next configure the Squid configuration file using vim editor and add the rule location to the configuration file. Enter the following contents in the file and save it.

root@linuxhelp:~# vim /etc/squid/squid.conf
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
acl ncsa proxy_auth REQUIRED
acl google_users proxy_auth user1
acl block dstdomain " /etc/squid/block.txt" 
http_access deny block google_users
http_access allow ncsa

Restart the Squid service.

root@linuxhelp:~# systemctl restart squid apache2

Now create a file named block.txt for adding the domain name to the block list. Save and exit the file.

root@linuxhelp:~# vim /etc/squid/block.txt
.facebook.com
.twitter.com

Restart both Squid and Apache service.

root@linuxhelp:~# systemctl restart squid apache2

To check the Squid proxy server authentication on client machines. Enter the Squid login credentials displayed on the pop-up window and click ok.
squid login credentials

Now the user able to access the internet and other websites.
websites

Now to check the configuration for blocked site, try to access the site like Facebook. If the given domain is blocked in the configuration, then the site cannot be accessed and browser will be displayed as shown below.
blocked site

Thus we conclude the installation and configuration procedure of User Authentication in Squid on Ubuntu 16.04.

Tags:
hobbs
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What does a reverse proxy do?

A

A reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more servers.

Q

What authentication type is used in squid proxy server?

A

Basic authentication type is used herein squid proxy.

Q

How to block certain extensions via squid proxy server?

A

To block certain extensions via squid proxy server "https://www.linuxhelp.com/how-to-block-keywords-and-extensions-in-squid-2/"

Q

What is the transparent proxy squid?

A

Transparent proxies are intermediary systems that sit between a user and a content provider. When a user makes a request to a web server, the transparent proxy intercepts the request to perform various actions including caching, redirection and authentication

Q

What is proxy server Linux?

A

A proxy server is a computer that acts as an intermediary between a desktop computer and the internet and allows a client machine to make an indirect connection to network servers and services. There are many reasons why you might want to include a proxy server on your network: To share internet connection on a LAN.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help keel johnston ?
Unhide the folders on windows Explorer

Give any solutions to unhide folder using command prompt?

forum3

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.