Satria Online

Peace, Friend ‘n Love

Squid-Password Authentication Using NCSA

Ditulis oleh Naruto di/pada 19 November 2008

Anda bisa mengatur Squid untuk menanyakan para pemakai untuk satu username dan password. Squid datang dengan satu program yang disebut ncsa_auth yang membaca NCSA-compliant apapun meng-enkripsi file password. Anda bisa menggunakan program htpasswd yang datang meng-install dengan Apache untuk menciptakan password anda. Berikut cara membuatnya:

1) Buat file password. Nama file password harus /etc/squid/squid_passwd, dan anda perlu untuk meyakinkan itu dapat dibaca universal.

[root@bigboy tmp]# touch /etc/squid/squid_passwd
[root@bigboy tmp]# chmod o+r /etc/squid/squid_passwd

2) Gunakan program htpasswd untuk menambahkan user ke file password. Anda bisa menambahkan para user setiap saat tanpa harus merestart Squid. Dalam hal ini, anda menambahkan satu username www:


[root@bigboy tmp]# htpasswd /etc/squid/squid_passwd www
New password:
Re-type new password:
Adding password for user www
[root@bigboy tmp]#

3) Temukan file ncsa_auth menggunakan perintah locate.
[root@bigboy tmp]# locate ncsa_auth
/usr/lib/squid/ncsa_auth
[root@bigboy tmp]#

4) Edit squid.conf; khususnya, anda perlu untuk mendefinisikan program autentikasi di squid.conf, dalam hal ini ncsa_auth. Berikutnya, buat satu ACL bernama ncsa_users dengan kata kunci REQUIRED dimana memaksa Squid untuk menggunakan NCSA auth_param metoda yang anda definisikan sebelumnya. Akhirnya, buat satu masukan http_access yang memungkinkan lalu lintas yang cocok dengan masukan ncsa_users ACL . Berikut contoh autentikasi user sederhana; urutan statement merupakan hal yang penting:
# Add this to the auth_param section of squid.conf
#
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd

#
# Add this to the bottom of the ACL section of squid.conf
#
acl ncsa_users proxy_auth REQUIRED

#
# Add this at the top of the http_access section of squid.conf
#
http_access allow ncsa_users

5) Ini memerlukan autentikasi password dan memungkinkan akses hanya selama jam kerja. Sekali lagi, urutan statement adalah penting:
#
# Add this to the auth_param section of squid.conf
#
auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/squid_passwd

#
# Add this to the bottom of the ACL section of squid.conf
#
acl ncsa_users proxy_auth REQUIRED
acl business_hours time M T W H F 9:00-17:00

#
# Add this at the top of the http_access section of squid.conf
#
http_access allow ncsa_users business_hours

Ingatlah untuk merestart Squid sehingga dapat diperoleh efek dari perubahan yang dilakukan.

Tinggalkan Balasan

XHTML: Anda dapat gunakan tag ini: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>