• 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 Restrict Websites for squid proxy user at specific time

{{postValue.id}}

To Restrict Websites for a Squid Proxy user at a specific time

Squid is a proxy caching server which is used for caching internet content that is closer to a requester rather than its original point of origin. With Squid, you can cache different kinds of web content, even the ones that are accessed through HTTP and FTP. Through our previous tutorials, you must have become accustomed with the method to install Squid Proxy server on CentOS, now here let us use the Squid Proxy server to restrict certain Websites for a Squid Proxy user at a specific time. But before proceeding with this tutorial, make sure you know how to configure Squid Proxy Server Authentication.

Restricting Website for Squid Proxy user

Lets begin the process by checking the status of the Squid server as follows.

[root@server1 ~]# systemctl status squid
squid.service - Squid caching proxy
   Loaded: loaded (/usr/lib/systemd/system/squid.service  enabled)
   Active: active (running) since Fri 2017-10-13 01:58:15 IST  4h 21min ago
  Process: 44888 ExecStop=/usr/sbin/squid -k shutdown -f $SQUID_CONF (code=exited, status=0/SUCCESS)
  Process: 44895 ExecStart=/usr/sbin/squid $SQUID_OPTS -f $SQUID_CONF (code=exited, status=0/SUCCESS)
  Process: 44890 ExecStartPre=/usr/libexec/squid/cache_swap.sh (code=exited, status=0/SUCCESS)
 Main PID: 44898 (squid)
   CGroup: /system.slice/squid.service
           ??44898 /usr/sbin/squid -f /etc/squid/squid.conf
           ??44902 (squid-1) -f /etc/squid/squid.conf
           ??44904 (logfile-daemon) /var/log/squid/access.log
           ??44913 (basic_ncsa_auth) /etc/squid/passwd

Once the status is checked, open the Squid configuration file and make a few modifications by adding the ACL rule as follows.

[root@server1 ~]# vim /etc/squid/squid.conf
auth_param basic program /usr/lib64/squid/basic_ncsa_auth /etc/squid/passwd
acl ncsa1 proxy_auth user1 user2
acl block1 dstdomain .facebook.com .youtube.com
acl break time 01:59-02:01
http_access deny ncsa1 block1 break
http_access allow ncsa1 block1


Now you should restart the Squid server, that can be done with the help of the following command.

[root@server1 ~]# systemctl restart squid

The configuration is now over, let us test it. Open your browser and go to Facebook and YouTube which are now allowed for the Squid Proxy user.facebook

These sites are now accessable.
2

But after the allowed time is up, access to Facebook and YouTube are now denied by proxy server for the user.
3
4

With this, the coverage of Restricting Websites for a Squid Proxy user at a specific time comes to an end. If you want to know how to allow users to access the caches at specific times using Squid Proxy Server, click here.

Tags:
jackson
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

Is there any way to have authentication for proxy users?

A

To enable authentication for proxy users enable: "https://www.linuxhelp.com/how-to-configure-squid-proxy-server-authentication-in-centos-6-7/"

Q

How to limit bandwidth for particular users in Squid proxy users?

A

To limit bandwidth for particular users in Squid proxy users link for clear explanation "https://www.linuxhelp.com/how-to-limit-bandwidth-squid/"

Q

How to install squid on windows 7?

A

To install squid on Windows7 "https://www.linuxhelp.com/how-to-configure-squid-in-windows-7/"

Q

how to configure squid in windows Os?

A

For configuring squid on Windows OS :" https://www.linuxhelp.com/how-to-configure-squid-in-windows-7/"

Q

What is squid proxy server?

A

Squid is a proxy caching server which is used for caching internet content that is closer to a requester rather than its original point of origin. With Squid, you can cache different kinds of web content, even the ones that are accessed through HTTP and FTP.

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 Luke ?
workbench for debian

I am using workbench in CentOS whereas now I need to use Debian Operating system so could you please help to install and use in Debian?

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.