[Comm] Как настроить самбу?

Slava Dubrovskiy =?iso-8859-1?q?slava_=CE=C1_psv=2Ecom=2Eua?=
Чт Апр 1 12:06:29 MSD 2004


Здравствуйте!

Пытаюсь настроить самбу samba-3.0.3-alt0.1 Опишу последовательность 
действий,  и может уважаемое сообщество  подскажет, что не правильно я 
делаю. Цель - сделать самбу в качестве PDC. В сети есть клиненты и 
Win98, WinXP-Prof, Win2000, Также есть Win server 2003 в качестве 
Terminal server для 1С.
Как я понял из документации, самбу можно так настроить, чтобы при 
добавлении пользователя, автоматически добавлялся и пользователь в 
Linux, при этом ему назначаются соответствующие группы  из  net groupmap 
list и лучше это делать через winbind. Правильно? При этом, если не был 
сделан аккаунт на машину, то он тоже автоматически добавляется.

1. Сначала я сделал smb.conf
Вот что мне выдала # testparm
Load smb config files from /etc/samba/smb.conf
Processing section "[homes]"
Processing section "[netlogon]"
Processing section "[Profiles]"
Processing section "[C$]"
Loaded services file OK.
Server role: ROLE_DOMAIN_PDC
Press enter to see a dump of your service definitions

# Global parameters
[global]
        dos charset = CP866
        unix charset = KOI8-R
        display charset = KOI8-R
        workgroup = PSV
        server string = Samba server on %h (v. %v)
        passwd program = /usr/bin/passwd %u
        passwd chat = *New*UNIX*password* %n\n 
*ReType*new*UNIX*password* %n\n
        unix password sync = Yes
        log file = /var/log/samba/log.%m
        max log size = 50
        add user script = /usr/sbin/useradd -s /bin/false %u
        add group script = /etc/samba/smbgrpadd.sh "%g"
        add machine script = /usr/sbin/useradd -d /dev/null -g machines 
-c 'Machine Account' -s /bin/false -M %u
        logon script = %U.bat
        logon path =
        logon home =
        domain logons = Yes
        os level = 120
        preferred master = Yes
        domain master = Yes
        dns proxy = No
        wins support = Yes
        message command = /usr/bin/linpopup "%f" "%m" %s; rm %s
        idmap uid = 10000-20000
        idmap gid = 10000-20000
        template shell = /bin/bash
        winbind separator = @
        hosts allow = 192.168.1., 127.

[homes]
        comment = Home Directory for '%u'
        read only = No
        browseable = No

[netlogon]
        comment = Network Logon Service
        path = /var/lib/samba/netlogon
        guest ok = Yes
        root preexec = /usr/bin/ntlogon -u %U -g %G -o %a -d 
/var/lib/samba/netlogon
        root postexec = rm -f /var/lib/samba/netlogon/%U.bat

[Profiles]
        path = /var/lib/samba/profiles
        guest ok = Yes
        browseable = No

[C$]
        comment = Administrative share for homes
        path = /home
        valid users = '@DOMAIN\\Domain Admins'
        admin users = '@DOMAIN\\Domain Admins'
        read only = No

2. Дальше я воспользовался примером из SAMBA HOWTO Collection и сделал 
скрипт для автоматического добавления групп и прописал его в команде add 
group script = /etc/samba/smbgrpadd.sh "%g"
Вот сам скрипт:
#!/bin/bash
# Add the group using normal system groupadd tool.
groupadd smbtmpgrp00
thegid= `cat /etc/group | grep smbtmpgrp00 | cut -d ":" -f3`
# Now change the name to what we want for the MS Windows networking end
cp /etc/group /etc/group.bak
cat /etc/group.bak | sed "s/smbtmpgrp00/$1/g" > /etc/group
# Now return the GID as would normally happen.
echo $thegid
exit 0

3. Я хочу делить пользователей на несколько групп и по совету SAMBA 
HOWTO Collection скриптом initgroups.sh их делаю.
#!/bin/bash
net groupmap modify ntgroup="Domain Admins" unixgroup=adm
net groupmap modify ntgroup="Power Users" unixgroup=adm
net groupmap modify ntgroup="Administrators" unixgroup=adm
net groupmap modify ntgroup="Domain Users" unixgroup=users
net groupmap modify ntgroup="Users" unixgroup=users
net groupmap modify ntgroup="Domain Guests" unixgroup=nobody
net groupmap modify ntgroup="Guests" unixgroup=nobody
groupadd menegers
groupadd buhgalters
groupadd sklad
groupadd logistiks
net groupmap add ntgroup="Menegers"   unixgroup=menegers   type=d
net groupmap add ntgroup="Buhgalters"  unixgroup=buhgalters  type=d
net groupmap add ntgroup="Sklad" unixgroup=sklad type=d
net groupmap add ntgroup="Logistiks" unixgroup=logistiks type=d

Теперь net groupmap list вот что выдает:
net groupmap list
Sklad (S-1-5-21-3230216366-3266141554-879821252-2093) -> sklad
System Operators (S-1-5-32-549) -> -1
Logistiks (S-1-5-21-3230216366-3266141554-879821252-2095) -> logistiks
Replicators (S-1-5-32-552) -> -1
Guests (S-1-5-32-546) -> nobody
Menegers (S-1-5-21-3230216366-3266141554-879821252-2089) -> menegers
Power Users (S-1-5-32-547) -> adm
Domain Admins (S-1-5-21-3230216366-3266141554-879821252-512) -> adm
Print Operators (S-1-5-32-550) -> -1
Domain Guests (S-1-5-21-3230216366-3266141554-879821252-514) -> nobody
Administrators (S-1-5-32-544) -> adm
Domain Users (S-1-5-21-3230216366-3266141554-879821252-513) -> users
Account Operators (S-1-5-32-548) -> -1
Backup Operators (S-1-5-32-551) -> -1
Users (S-1-5-32-545) -> users
Buhgalters (S-1-5-21-3230216366-3266141554-879821252-2091) -> buhgalters

4. Следующим шагом, настраиваю netlogon.ру который идет в samba-doc. 
Делаю все так как написано readme и прописываю команды запуска в секцию 
[netlogon]

5. И теперь мне кажется, что все готово к запуску.
# service smb start Starting CIFS services:  NetBIOS over TCP/IP server, 
Samba server                                                  [ DONE ]
# service winbind start Starting Winbind 
services:                                                                                         
[ DONE ]

6. Теперь я создаю пользователя командой pdbedit -a lida а оно не 
создается, пишет, что сначала нужно создать локального пользователя. Но 
тогда в каком случае должна работать команда add user script = 
/usr/sbin/useradd -s /bin/false %u ?

Ну ладно, создам руками.

А вот дальше не знаю что делать. :-(
Во первых в Win98  не может получить список пользователей с сервера,
во вторых в лог сыпется вот это:
Apr  1 10:49:09 server winbindd[13247]: [2004/04/01 10:49:09, 0] 
rpc_client/cli_pipe.c:rpc_api_pipe(424)
Apr  1 10:49:09 server winbindd[13247]:   cli_pipe: return critical 
error. Error was Call timed out: server did not respond after 10000 
milliseconds

Подскажите, что делать дальше?

С уважением,
Дубровский Вячеслав



Подробная информация о списке рассылки community