Squid authentikasi

ahh dodol cari disana sini artikel ketemu nya begini

PErnah punya Proxy yang ingin dipakai oleh user tertentu saja?? Di Squid tersedia beberapa pilihan authentication yang bisa dipakai, diantarana :

=> NCSA: Uses an NCSA-style username and password file.
=> LDAP: Uses the Lightweight Directory Access Protocol
=> MSNT: Uses a Windows NT authentication domain.
=> PAM: Uses the Linux Pluggable Authentication Modules scheme.
=> SMB: Uses a SMB server like Windows NT or Samba.
=> getpwam: Uses the old-fashioned Unix password file.
=> SASL: Uses SALS libraries.
=> NTLM, Negotiate and Digest authentication

Kali ini aq coba bikin authentication dengan NCSA dengan Squid 2.6 STABLE 18.

Dengan asumsi proxy Squid sudah terinstal, maka kita perlu mengubah beberapa line di file /etc/squid/squid.conf. Tapi sebelumna kita perlu membuat file passwd yang isina nama user beserta passwordna dalam style NCSA. Masuk ke terminal dan ketikkan perintah :

# htpasswd /etc/squid/passwd usersquid

Perintah diatas berarti akan membuat file baru /etc/squid/passwd. Nanti ada prompt untuk memasukkan password si usersquid :

New password:
Re-type new password:
Adding password for user usersquid

Setelah itu kita harus tau dimana binary ncsa_auth disimpan :

# dpkg -L squid | grep nsca_auth

Hasilna :

/usr/lib/squid/ncsa_auth

atau dengan :

# rpm -ql squid | grep nsca_auth

hasilna :

/usr/lib/squid/ncsa_auth

Abis itu kita harus mengedit file konfigurasi si Squid di /etc/squid/squid.conf. Buka file tersebut dengan teks editor kesayangan :P lalu tambahin line2 berikut :

auth_param basic program /usr/lib/squid/ncsa_auth /etc/squid/passwd
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server

Lalu cari bagian tag http_access dan tambahin ACL berikut :

acl ncsa_users proxy_auth REQUIRED
http_access allow ncsa_users

pertanyaannya !!!!!!!!!!

neh tuh command taruh dimana dah bikin orang awam ribet masukinnya tapi salut deh buat artikelnya

berikut hasil nya small squid konfigurasi yang dah gw coba sendiri pake mata kepala gw ....

http_port 8080
icp_port 3130
cache_mem 32 MB
cache_dir ufs /cache 1000 16 256

# log (bagian ini berisikan tentang lokasi file log yang akan digunakan squid).
cache_access_log /var/log/squid/access.log
cache_log /var/log/squid/cache.log
cache_store_log /var/log/squid/store.log

acl all src 0.0.0.0/0.0.0.0
acl manager proto cache_object
acl localhost src 127.0.0.1/255.255.255.255
acl lan src 10.0.0.0/255.0.0.0 #komp lan
auth_param basic program /usr/lib/squid/ncsa_auth /usr/lib/squid/ncsa/login.auth
auth_param basic children 5
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hours
auth_param basic casesensitive off
acl ncsa_users proxy_auth REQUIRED

acl to_localhost dst 127.0.0.0/8
acl PURGE method PURGE
acl SSL_ports port 443 563 10000
acl Safe_ports port 80 # http
acl Safe_ports port 21 # ftp
acl Safe_ports port 443 563 # https, snews
acl Safe_ports port 70 # gopher
acl Safe_ports port 210 # wais
acl Safe_ports port 1025-65535 # unregistered ports
acl Safe_ports port 280 # http-mgmt
acl Safe_ports port 488 # gss-http
acl Safe_ports port 591 # filemaker
acl Safe_ports port 777 # multiling http
acl magic url_regex -i ftp .exe .mp3 .vqf .tar.gz .gz .rpm .zip .rar .avi .mpeg .mpe .mpg .qt .ram .rm .iso .raw .wav
acl CONNECT method CONNECT

http_access allow manager lan
http_access allow manager localhost
http_access deny manager
http_access deny !Safe_ports
http_access deny CONNECT !SSL_ports
http_access allow PURGE localhost
http_access deny PURGE
http_access allow localhost
http_access allow ncsa_users
http_access allow lan
http_access deny all

cache_mgr iqbal@sekuritionline.net
cache_effective_user squid
cache_effective_group squid

root@boc [/etc/squid]# mkdir /usr/lib/squid/ncsa/ ; htpasswd -c /usr/lib/squid/ncsa/login.auth iqbal
New password:
Re-type new password:
Adding password for user iqbal

restart squid nya



Andy Liany - Sanggupkah

cukup sudah manis, hentikan bicara
tatap mataku baca hatiku
akan terjawab ketakutanmu
percayalah kau tak sendirikalau kau ragu, tinggalkanlah aku
pergilah, aku bisa mengerti
tapi jangan paksa arahya cinta
karena keadaan dan perbedaan

* jalan masih panjang, jangan ucap janji
masih ada cintamu hari ini

reff:

sanggupkah aku hidup bersama denganmu
mungkinkah aku hidup tanpa ada dirimu
hanyalah waktu yang bisa jawab semua itu
sampai kapan aku tak tahu

dengarkanlah manis, kita berbeda
jangan dirubah, biarkan saja
nanti ada badai yang ’kan mengujinya
kita hadapi, kita berbagi

** jalan masih panjang, jangan ucap janji
masih ada kasihmu hari ini

repeat

reff

SILAHKAN DOWNLOAD

Komentar

Postingan populer dari blog ini

Mengatasi error unrecognise request di Linkaja

OJS and Nginx

Tentang Findtoyou.com