Hi <span class="gmail_quote"><b class="gmail_sendername">kalinix</b></span><br><br>Thanks fro your correct info. It now works as expected. <br><br>I am really happy about your rules. <br><br>Thank you very much <br><br>indunil 
<br><br><br><div><span class="gmail_quote">On 3/24/07, <b class="gmail_sendername">kalinix</b> <<a href="mailto:calin.kalinix.cosma@gmail.com">calin.kalinix.cosma@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Sat, 2007-03-24 at 12:06 +0530, Indunil Jayasooriya wrote:<br>><br>> Hi List,<br>><br>> I want to bind an ip address to a username with squid by using squid<br>> password file.<br>><br>> I am using ncsa_auth programme. Below are line that I have added to
<br>> squid.conf file.<br>><br>> auth_param basic<br>> program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd<br>> auth_param basic children 5<br>> auth_param basic realm Squid proxy-caching web server
<br>> auth_param basic credentialsttl 2 hours<br>> auth_param basic casesensitive off<br>><br>> acl ncsa_users proxy_auth REQUIRED<br>> http_access allow ncsa_users<br>><br>> We are currently browsing internet with usernames and passwords. But
<br>> the problem is a user can access internet from all the workstation<br>> with his username and password. I do not need it. I only want a user<br>> to access internet from his machine.<br>><br>> Solution to that is binding an ip address to an username. Then, A user
<br>> can access internet from that particular ip.<br>><br>> I searche a lot from the internet. I found some info. I tried a lot.<br>> But I still have not been able to solve this issue.<br>><br>><br>> Some info I found from the Internet says perl script can do it.
<br>><br>> pls see below ulrs for it.<br>><br>> <a href="http://iits.uap.edu.ph/~jpira/footnotes/squid.html">http://iits.uap.edu.ph/~jpira/footnotes/squid.html</a><br>><br>> <a href="http://www.visolve.com/squid/squid30/externalsupport.php">
http://www.visolve.com/squid/squid30/externalsupport.php</a><br>><br>> Pls note that I am not a programmer. So I do not know any perl nor do<br>> I know any python stuff.<br>><br>> So I do not want to go with above urls.
<br>><br>> But, I found an easy method from squid list. Pls see below URLS .<br>><br>><br>> <a href="http://www.squid-cache.org/mail-archive/squid-users/200208/0033.html">http://www.squid-cache.org/mail-archive/squid-users/200208/0033.html
</a><br>><br>> <a href="http://www.squid-cache.org/mail-archive/squid-users/200208/0029.html">http://www.squid-cache.org/mail-archive/squid-users/200208/0029.html</a><br>><br>> These above URLS are fine for me. The above URLS say,
<br>><br>> put the IP add in squid passwd<br>><br>> I did it. Pls see below for my squid_passwd file.<br>><br>> [root@worldnet ~]# cat /etc/squid/squid_passwd<br>> indunil:TeiAQ3uqXDQNg:<a href="http://192.168.101.25">
192.168.101.25</a><br>> www:Oi4THedCcN0nQ<br>> web:qsTaT6v2loN5g<br>><br>> It has bound user indunil to ip address <a href="http://192.168.101.25">192.168.101.25</a> .<br>><br>> But user  indunil still can access internet from any ip . Why is that?
<br>> Where did I go wrong?<br>><br>>  I think that it is an easy task.<br>><br>> Pls help me to solve this issue. It is urgent.<br>><br>> --<br>> Thank you<br>> Indunil Jayasooriya<br>><br>>
<br>><br>> _______________________________________________<br>> CentOS mailing list<br>> <a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br>> <a href="http://lists.centos.org/mailman/listinfo/centos">
http://lists.centos.org/mailman/listinfo/centos</a><br><br>You should check whether you have ip_user_check (locate ip_user_check).<br>Normally it comes with squid installation, on CentOS it should be<br>in /usr/lib/squid/.
<br><br>Then you may want to generate a config file, which should contain the<br>list of ips and users (like <IP> <USER>).<br><br>Then you should add a line in your squid config file (e.g. ip.txt):<br>external_acl_type IP_USER %SRC %LOGIN /usr/lib/squid/ip_user_check
<br>-f /path/to/config/file/ip.txt<br><br>After ncsa acl you should define a new acl like this:<br><br>acl IP_USER external IP_USER %SRC %LOGIN<br><br>Once this has completed you may want to rewrite the rules, like:<br><br>
<br>http_access deny !ncsa_users<br>http_access deny !IP_USER<br>http_access allow IP_USER<br>http_access allow ncsa_users<br><br><br>You can check the ip_user_check after you created the config file from a<br>command line, issuing the comand:
<br><br>/usr/lib/squid/ip_user_check -f /path/to/config/file/ip.txt<br><br><br>then if you type the right pair ip user you will get an OK message and<br>if you have an wrong pair you will get an ERR message<br><br><br>For further reading:
<br><br><a href="http://devel.squid-cache.org/external_acl/">http://devel.squid-cache.org/external_acl/</a><br><br><a href="http://www.squid-cache.org/mail-archive/squid-users/200409/0961.html">http://www.squid-cache.org/mail-archive/squid-users/200409/0961.html
</a><br>(the code might be a little fuzzy)<br><br><a href="http://www1.ru.squid-cache.org/mail-archive/squid-users/200303/1304.html">http://www1.ru.squid-cache.org/mail-archive/squid-users/200303/1304.html</a><br><br><br>
<a href="http://linuxportal.ru/forums/index.php/m/31853/#msg_31853">http://linuxportal.ru/forums/index.php/m/31853/#msg_31853</a> (is in<br>russian, but the code is still in english :D )<br><br><br><br><br>HTH<br><br><br>
<br>Calin<br><br>=================================================<br>Appendix: A portion of a book, for which nobody yet has discovered any<br>use.<br><br>_______________________________________________<br>CentOS mailing list
<br><a href="mailto:CentOS@centos.org">CentOS@centos.org</a><br><a href="http://lists.centos.org/mailman/listinfo/centos">http://lists.centos.org/mailman/listinfo/centos</a><br></blockquote></div><br><br clear="all"><br>-- 
<br>Thank you<br>Indunil Jayasooriya<br>