server# cat smb.conf
[global] workgroup = CORPX os level = 33 domain master = yes security = user domain logons = yes logon path = \\%L\profiles\%U [netlogon] path = /home/samba [profiles] path = /home/ read only = no map hidden = Yes map system = Yes
server# testparm server# mkdir /home/samba
[server:~] # pw groupadd users [server:~] # net groupmap add ntgroup="Domain Admins" unixgroup=wheel rid=512 type=d [server:~] # net groupmap add ntgroup="Domain Users" unixgroup=users rid=513 type=d [server:~] # net groupmap add ntgroup="Domain Guests" unixgroup=nobody rid=514 type=d [server:~] # net groupmap add ntgroup=group1 unixgroup=group1 rid=15001 type=d [server:~] # net groupmap list [server:~] # more /etc/rc.conf
nmbd_enable="YES" smbd_enable="YES" winbindd_enable="YES"
[server:~] # /usr/local/etc/rc.d/samba start
root@server:~# net groupmap add ntgroup="Domain Admins" unixgroup=root rid=512 type=d root@server:~# net groupmap add ntgroup="Domain Users" unixgroup=users rid=513 type=d root@server:~# net groupmap add ntgroup="Domain Guests" unixgroup=nogroup rid=514 type=d root@server:~# net groupmap add ntgroup=group1 unixgroup=group1 rid=15001 type=d root@server:~# net groupmap list root@server:~# restart smbd root@server:~# restart nmbd
server# smbpasswd -a root Smb password: password ... server# pdbedit -w -L
[server:~] # pw usermod root -G users
root@server:~# usermod -G users root
[server:~] # pw useradd client1$ -d /tmp -s /usr/sbin/nologin [server:~] # pw useradd client2$ -d /tmp -s /usr/sbin/nologin
root@server:~# useradd client1$ -d /tmp -s /usr/sbin/nologin root@server:~# useradd client2$ -d /tmp -s /usr/sbin/nologin
Регистрируем в домене CORPX используя учетную запись root
server# smbpasswd -a user1 ... ...Password: spassword1 server# smbpasswd -a user2 ... ...Password: spassword2 server# pdbedit -v -L user1 | grep Domain server# pdbedit -u user1 -I CORPX server# pdbedit -u user2 -I CORPX
[server:~] # pw usermod user1 -G group1,users [server:~] # pw usermod user2 -G group1,users
root@server:~# usermod -G group1,users user1 root@server:~# usermod -G group1,users user2
Зарегистрируйтесь как пользователь user1 в XP, cоздайте папку на рабочем столе и отключитесь от системы
server# ls ~user1
[server:~] # pw useradd gate$ -d /tmp -s /usr/sbin/nologin
root@server:~# useradd gate$ -d /tmp -s /usr/sbin/nologin
server# cat smb.conf
[global] ... logon script = logon.cmd [netlogon] ...
[server:~] # pkg_add -r unix2dos [server:~] # rehash
root@server:~# apt-get install tofrodos
server# cat /home/samba/logon.cmd
net use M: \\gate\share net use N: \\gate\homes
server# unix2dos /home/samba/logon.cmd или server# todos /home/samba/logon.cmd или server# awk '{printf $0"\r\n"}' /home/samba/logon.cmd > /home/samba/logon.cmd