歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Unix知識 >> 關於Unix >> Linux設置Squid的用戶認證存取控制

Linux設置Squid的用戶認證存取控制

日期:2017/3/6 15:50:00   编辑:關於Unix
內核版本: Linux 2.2 Squid版本: Squid-2.3.stable2 ( http://www.squid-cache.org/Versions/v2/2.3/squid-2.3.STABLE2-src.tar.gz ) 發行版本: Redhat Linux 6.0 1. 下載,編譯,安裝Squid略 注意:運行squid作為nobody,不能用root. 假定squid home目錄
  內核版本: Linux 2.2
  Squid版本: Squid-2.3.stable2
  (http://www.squid-cache.org/Versions/v2/2.3/squid-2.3.STABLE2-src.tar.gz)
  發行版本: Redhat Linux 6.0
  
  1. 下載,編譯,安裝Squid略
  注意:運行squid作為nobody,不能用root.
  
  假定squid home目錄為/usr/local/squid/
  假定squid source目錄在/tmp/squid-2.3.STABLE2
  
  2. # cd /tmp/squid-2.3.STABLE2/auth_modules/NCSA
  # make ncsa_auth
  
  3. 拷貝生成的執行文件ncsa_auth到squid執行文件目錄
  # cp ncsa_auth /usr/local/squid/bin
  
  4. 從Apache軟件包中得到程序htpasswd
  
  5.用htpasswd生成供Squid利用的用戶名和密碼認證數據庫文件
  
  #htpasswd -c /usr/local/squid/etc/passwd
  
  6. 加其它更多的用戶
  #htpasswd /usr/loal/squid/etc/passwd
  
  7. 修改squid.conf,enable ncsa_auth用戶認證功能
  [root@linux etc]# more squid.conf | grep ncsa_auth
  authenticate_program /usr/local/squid/bin/ncsa_auth /usr/local/squid/etc/passwd
  
  8.修改ACL部分,象下面這樣:
  [root@linux etc]# more squid.conf | grep jephe
  acl isd proxy_auth jephe bob jicon
  http_aclearcase/" target="_blank" >ccess allow isd

Copyright © Linux教程網 All Rights Reserved