About Me

My photo
Hi Friends, I am Sandeep CC and some people know me as System Administrator. I have started my professional career from 2008. I have been working as System Administrator on Linux Server and Windows Client. I am here to share my Knowledge in which I have experienced and which I have come across till now, It could be help to you people. In case anything wrong or any improvements in my post steps, Please comment to the post, Feel free to contact me by posting comments on this blog. Thanks and Regards, Sandeep CC

Wednesday, November 23, 2011

Configure Squid Authentication Password on REDHAT LINUX

Configure Squid Authentication Password

Before configuring authentication user and password 1st configure SQUID and check whether it is working fine without any authentications [Click here to check Installation steps of Squid/Proxy]

You can configure Squid to prompt users for a username and password. Squid comes with a program called ncsa_auth that reads any NCSA-compliant encrypted password file. You can use the htpasswd program that comes installed with Apache to create your passwords [Click here to check Installation steps of APACHE/WEBSERVER]

Create squid_passwd file on /etc/squid/ directory and you need to make sure that it's universally readable.

[root@sandeeplinux-server squid]# touch squid_passwd
[root@sandeeplinux-server squid]# chmod o+r squid_passwd

Use the htpasswd command to add users to the password file. You can add users at anytime without having to restart Squid. Example: User Name = sandeep with sandeep123 password

[root@sandeeplinux-server squid]# htpasswd /etc/squid/squid_passwd sandeep
New password:
Re-type new password:
Adding password for user sandeep
[root@sandeeplinux-server squid]#

Find your ncsa_auth file using the locate command.

[root@sandeeplinux-server squid]# locate ncsa_auth
[root@sandeeplinux-server squid]#

Enter or un-comment bellow lines in /etc/squid/squid.conf file

[root@sandeeplinux-server squid]# vi squid.conf

auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd

(Add or un-comment above line in auth_param Session)

acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users

(Add above line in ACL Session)

Save & Exit:

Restart Squid Server

[root@sandeeplinux-server squid]# service squid restart
Stopping squid: ................ [ OK ]
Starting squid: . [ OK ]
[root@sandeeplinux-server squid]#

Now Open Browser on client machine (Windows/Linux Client) It will ask for User name and Password, Give above created user name and password, Now you can access Internet...

Thanks and Regards,
Sandeep CC

No comments:

Post a Comment