Tuesday, May 26, 2009

Samba - Act as a domain controller

Tested on Samba - Samba Version 3.0.10-1.4E.9


1)Put in the following changes in Samba

workgroup = MYGROUP # This will be the Domain Name
netbios name = HOSTNAME
server string = Samba Server %v %h
security = user
encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
unix password sync = yes

passwd program = /usr/bin/passwd %u
passwd chat = *New*password* %n\n *Please*retype*new*password* %n\n *password*successfully*updated*


local master = yes

os level = 64

domain master = yes

preferred master = yes

domain logons = yes

logon drive = P:

logon script = netlogon.bat

#=== shares ===
[homes]
comment = Home Directories
browseable = no
writable = yes
valid users = %S
create mode = 0664
directory mode = 0775

[netlogon]
comment = Network Logon Service
path = /home/samba/netlogon
writable = no
share modes = no

[Profiles]
path = /home/samba/profiles
browseable = no


2)Adding the appropriate directories

groupadd -g 300 admins
groupadd -g 301 machines

groupadd -g 302 users

mkdir -m 0775 -p /home/samba/netlogon
chown root.admins /home/samba/netlogon
mkdir /home/samba/profiles

3)Add machine + User accounts

Change the default shell in /etc/default/useradd and change the SHELL=/sbin/nologin

useradd -g machines -d /dev/null computer$

passwd -l computer$

smbpasswd -a -m computer

useradd -g users -d /home/samba/profiles/userx userx

passwd userx

smbpasswd -a userx


Add a Samba account for root , used to join the network

smbpasswd -a root


4)Run testparm -v , and if OK restart

No comments:

Post a Comment

Followers