привет всем, трабл такой
задача - прикрутить к сквиду авторизацию вин. юзерофф.
DC - 192,168,20,11 (2000) /192,168,20,10 (2003)
FreeBSD 4.10-RELEASE-p5
samba Version 3.0.21bмашина стоит в DMZ, отрыты порты
udp
137
138
tcp
139
445когда джойнишься в домен командой
net rpc join -U snoop
получаешь в ответ
Unable to find a suitable serverUnable to find a suitable server
если писать net rpc join -I 192.168.20.10 (т.е.2003) -U snoop
в ответ получаешь
could not initialise lsa pipe
could not obtain sid for domain
error: NT_STATUS_ACCESS_DENIED
(машина не появляется в домене)если писать net rpc join -I 192.168.20.11 (т.е.2000) -U snoop
в ответ получаешь
assword:
[2006/03/23 12:14:22, 0] utils/net_rpc_join.c:net_rpc_join_newstyle(316)
Error in domain join verification (credential setup failed): NT_STATUS_INVALID_COMPUTER_NAME
Unable to join domain ALBUMIN.МАШИНА В ДОМЕНЕ ПОЯВЛЯЕТСЯ! ,НО!!
wbinfo -a snoop%*********
plaintext password authentication failed
error code was NT_STATUS_CANT_ACCESS_DOMAIN_INFO (0xc00000da)
error messsage was: NT_STATUS_CANT_ACCESS_DOMAIN_INFO
Could not authenticate user snoop%lamerspace32 with plaintext password
challenge/response password authentication failed
error code was NT_STATUS_CANT_ACCESS_DOMAIN_INFO (0xc00000da)
error messsage was: NT_STATUS_CANT_ACCESS_DOMAIN_INFO
Could not authenticate user snoop with challenge/responseя и не только я парюсь уже 2й день....подскажите что мона зделать, как победить!???
Тема избитая. Для себя записал все свои шаги, которые предпринимал для настройки данной схемы. Если кому интересно, могу выложить модернизированный вариант для контроля доступа по принадлежности пользователей к разным группам в AD.Пошаговая настройка связки SQUID и Авторизации в Windows 2000 AD для контроля доступа в Интернет.
Используемое программное обеспечение:
==============================================================================FreeBSD 5.3 Minimal install
Windows 2000 Server PDC
Samba 3.0.10
Squid 2.5.STABLE9
Perl v5.8.6
Устанавливаем Samba
==============================================================================
bash-3.00# mkdir /home/winnt/
bash-3.00# tar -zxvf ./samba-3.0.10.tar.gz
bash-3.00# cd ./samba-3.0.10/source/
bash-3.00# ./configure --with-winbind --with-winbind-auth-challenge
bash-3.00# make
bash-3.00# make install
bash-3.00# vi /usr/local/samba/lib/smb.conf
[global]
workgroup = YOU-DOMAIN
netbios name = userproxy
server string = userproxy.you-domain.ru
hosts allow = 10. 127.
winbind separator = \\
winbind use default domain = yes
winbind uid = 10000-20000
winbind gid = 10000-20000
winbind enum users = yes
winbind enum groups = yes
template homedir = /home/winnt/%D/%U
template shell = /usr/local/bin/bash
max log size = 50
security = domain
password server = srv1 srv3
encrypt passwords = yes
with disable netbios = noСоздаем файл /etc/nsswitch.conf следующего содержания:
passwd: files winbind
group: files winbindКопируем библиотеки
cp /home/src/samba-3.0.10/source/nsswitch/libnss_winbind.so /usr/lib/
Создаем ссылки
bash-3.00# ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.1
bash-3.00# ln -s /usr/lib/libnss_winbind.so /usr/lib/libnss_winbind.so.2Вводим в домен:
bash-3.00# /usr/local/samba/bin/net join -S srv1 -w YOU-DOMAIN -U admin-user
Password:
Joined domain YOU-DOMAIN.
bash-3.00#Запускаем:
bash-3.00# /usr/local/samba/sbin/smbd
bash-3.00# /usr/local/samba/sbin/nmbd
bash-3.00# /usr/local/samba/sbin/winbindd -d9
bash-3.00#
Проверяем:
первый пользователь:
bash-3.00# /usr/local/samba/bin/wbinfo -a YOU-DOMAIN \\admin_user%password
plaintext password authentication succeeded
challenge/response password authentication succeeded
bash-3.00#
второй пользователь:
bash-3.00# /usr/local/samba/bin/wbinfo -a YOU-DOMAIN \\test_yser%password
plaintext password authentication succeeded
challenge/response password authentication succeeded
bash-3.00#
Даем права для юзера, из под которого будет работать Squid на пайпу winbind'a:
bash-3.00# chown -R root:nobody /usr/local/samba/var/locks/winbindd_privileged/
bash-3.00# ls -l /usr/local/samba/var/locks/
total 102
-rw-r--r-- 1 root wheel 696 May 18 13:58 brlock.tdb
-rw-r--r-- 1 root wheel 8192 May 18 13:58 connections.tdb
-rw-r--r-- 1 root wheel 8192 May 18 14:53 gencache.tdb
-rw-r--r-- 1 root wheel 696 May 18 13:58 locking.tdb
-rw------- 1 root wheel 696 May 18 13:58 messages.tdb
-rw------- 1 root wheel 8192 May 18 13:59 netsamlogon_cache.tdb
-rw------- 1 root wheel 8192 May 18 13:58 ntdrivers.tdb
-rw------- 1 root wheel 696 May 18 13:58 ntforms.tdb
-rw------- 1 root wheel 8192 May 18 13:58 ntprinters.tdb
drwxr-xr-x 2 root wheel 512 May 18 13:58 printing
-rw------- 1 root wheel 8192 May 18 13:58 registry.tdb
-rw-r--r-- 1 root wheel 696 May 18 13:58 sessionid.tdb
-rw------- 1 root wheel 8192 May 18 13:58 share_info.tdb
-rw-r--r-- 1 root wheel 6 May 18 13:58 smbd.pid
-rw-r--r-- 1 root wheel 6 May 18 13:58 winbindd.pid
-rw------- 1 root wheel 20172 May 18 13:58 winbindd_cache.tdb
-rw-r--r-- 1 root wheel 8192 May 18 13:58 winbindd_idmap.tdb
drwxr-x--- 2 root nobody 512 May 18 13:58 winbindd_privileged
bash-3.00#Делаем вывод, что samba настроена и работает. В домен пускает.
==============================================================================Идем дальше.
Устанавливаем Squid.
==============================================================================
bash-3.00# cd /root/src/
bash-3.00# tar -zxvf ./squid-2.5.STABLE9.tar.gz
bash-3.00# cd ./squid-2.5.STABLE9
Читаем тут http://sams.irc.perm.ru/doc/ru/squid.html
Данный кусок в принцыпе не нужен, если используем хелперы Samba, как у меня
--enable-basic-auth-helpers="winbind"
--enable-ntlm-auth-helpers="winbind"bash-3.00# ./configure --enable-auth="ntlm,basic" --enable-external-acl-helpers="wbinfo_group"
(как вариант)
bash-3.00# ./configure --prefix=/usr/local/squid --enable-basic-auth-helpers="LDAP,wbinfo_group" --enable-external-acl-helpers=ldap_group --enable-auth=basic,ntlm
Сваливается с ошибкой
checking for ar... /usr/bin/ar
Perl is required to compile Squid
Please install Perl and then re-run configure
Оно и понятно, конфигурация инсталяции - минимальна, все, что нужно доустанавливается.
Устанавливает Perl:
bash-3.00# cd ../
bash-3.00# tar -zxvf ./perl-5.8.6.tar.gz
bash-3.00# cd ./perl-5.8.6
Читаем INSTALL
bash-3.00# less INSTALLThe basic steps to build and install perl5 on a Unix system with all
the defaults are:rm -f config.sh Policy.sh
sh Configure -de
make
make test
make install
bash-3.00# rm -f config.sh Policy.sh
bash-3.00# sh Configure -de
bash-3.00# make
Everything is up to date. Type 'make test' to run test suite.
Делаем вывод, что все ОК
bash-3.00# make test
t/pod/podselect...........................ok
t/pod/special_seqs........................ok
t/x2p/s2p.................................ok
All tests successful.
u=1.66406 s=0.976562 cu=154.656 cs=19.5703 scripts=847 tests=87649bash-3.00# rm /usr/bin/perl
bash-3.00# ln -s /usr/local/bin/perl5.8.6 /usr/bin/perl
bash-3.00#
Конфигурируем Squid
bash-3.00# ./configure --enable-auth="ntlm,basic"
Все ОК
Собираем
bash-3.00# make
ys.o -L../lib repl/liblru.a fs/libufs.a auth/libntlm.a auth/libbasic.a -lcrypt -lmiscutil -lm
Making all in icons
Making all in errors
Making all in doc
Making all in helpers
Making all in basic_auth
Making all in ntlm_auth
Making all in digest_auth
Making all in external_acl
bash-3.00#
И тут все ОК
Устанавливаем
bash-3.00# make install
И тут счастье
Making install in doc
/bin/sh ../cfgaux/mkinstalldirs /usr/local/squid/man/man8
mkdir /usr/local/squid/man
mkdir /usr/local/squid/man/man8
/usr/bin/install -c -m 644 ./squid.8 /usr/local/squid/man/man8/squid.8
Making install in helpers
Making install in basic_auth
Making install in ntlm_auth
Making install in digest_auth
Making install in external_acl
bash-3.00#Настраиваем squid на NTLM-аутентификацию:
(здесь не описывается конфигурация Squid -только то, что касается аутентификации по NTLM - по этому много чего написано, например тут: http://bog.pp.ru/work/squid.html)acl you_acl_name proxy_auth REQUIRED
http_access allow you_acl_nameauth_param ntlm children 5
auth_param ntlm program /usr/local/samba/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp
auth_param ntlm max_challenge_reuses 0
auth_param ntlm max_challenge_lifetime 2 minutesauth_param basic children 5
auth_param basic program /usr/local/samba/bin/ntlm_auth --helper-protocol=squid-2.5-basic
auth_param basic realm Squid proxy-caching web server
auth_param basic credentialsttl 2 hoursДаем права на деректорию под кеш (где находится кэш указывается в squid.conf - у меня в /cache):
bash-3.00# chown -R nobody:nobody /cache/
bash-3.00#
Даем права на корневую директорию Squid:
bash-3.00# chown -R nobody:nobody /usr/local/squid/
bash-3.00#
Создаем кеш:
bash-3.00# /usr/local/squid/sbin/squid -z
2005/05/18 14:49:31| Creating Swap Directories
bash-3.00#
Запускаем squid и проверяем, что он запущен:
bash-3.00# /usr/local/squid/sbin/squid
bash-3.00# ps ax | grep sq
45533 ?? Ss 0:00.00 /usr/local/squid/sbin/squid
45535 ?? S 0:00.11 (squid) (squid)
45536 ?? Ss 0:00.02 (ntlm_auth) --helper-protocol=squid-2.5-ntlmssp (ntlm_auth)
45537 ?? Ss 0:00.02 (ntlm_auth) --helper-protocol=squid-2.5-ntlmssp (ntlm_auth)
45538 ?? Ss 0:00.02 (ntlm_auth) --helper-protocol=squid-2.5-ntlmssp (ntlm_auth)
45539 ?? Ss 0:00.02 (ntlm_auth) --helper-protocol=squid-2.5-ntlmssp (ntlm_auth)
45540 ?? Ss 0:00.02 (ntlm_auth) --helper-protocol=squid-2.5-ntlmssp (ntlm_auth)
45541 ?? Ss 0:00.02 (ntlm_auth) --helper-protocol=squid-2.5-basic (ntlm_auth)
45542 ?? Ss 0:00.02 (ntlm_auth) --helper-protocol=squid-2.5-basic (ntlm_auth)
45543 ?? Ss 0:00.02 (ntlm_auth) --helper-protocol=squid-2.5-basic (ntlm_auth)
45544 ?? Ss 0:00.02 (ntlm_auth) --helper-protocol=squid-2.5-basic (ntlm_auth)
45545 ?? Ss 0:00.02 (ntlm_auth) --helper-protocol=squid-2.5-basic (ntlm_auth)
bash-3.00#
Счастье есть :)
Проверяем, как он пускает пользователей:
bash-3.00# tail -f /usr/local/squid/var/logs/access.log1116414129.248 280 10.66.64.166 TCP_MISS/200 2409 GET http://ya.ru/ YOU-DOMAIN \admin-user DEFAULT_PARENT/XXX.XXX.XXX.XXX text/html [Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/x-icq, */*\r\nAccept-Language: ru\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)\r\nHost: ya.ru\r\nProxy-Connection: Keep-Alive\r\n] [HTTP/1.0 200 OK\r\nServer: thttpd/2.25b 29dec2003\r\nContent-Type: text/html; charset=windows-1251\r\nDate: Wed, 18 May 2005 11:01:41 GMT\r\nLast-Modified: Mon, 16 May 2005 11:24:44 GMT\r\nAccept-Ranges: bytes\r\nContent-Length: 2078\r\nX-Cache: MISS from proxy.pspb.ru\r\nProxy-Connection: keep-alive\r\n\r]
О счастье нам пришло :)
Делаем вывод, что squid настроен и работает. В Интернет пускает.
==============================================================================