Setting up a Primary Domain Controller (PDC) with SAMBA

Submitted by UMBRO
on November 21, 2006 - 11:46pm

firewall settings on server and client side

port 137,138,139 and 445 needs going through the firewall. You can easisy get the port information of NETBIOS over TCP/IP by google.

Server Side (Asianux 1.0)
1. Edit smb.conf

The attatched file named smb.txt is a working example configuration file of SAMBA for me. Change the file name to 'smb.conf' before using it. You may just change the following part:

workgroup = calis.edu.cn
netbios name = pdc


unix charset = GB18030
dos charset = CP936
display charset = GB18030

You may also change the others according to your need after reading the manual of smb.conf ('man smb.conf').

2. Add machine group account,user group account for the OS

[root@localhost root]#groupadd machines
[root@localhost root]#groupadd smbusers

3. Add machine account,user account for the OS

[root@localhost root]#useradd -d /dev/null -s /sbin/nologin -g machines b212$
[root@localhost root]#useradd -d /dev/null -s /sbin/nologin -g smbusers liuxg

Replace 'machines','smbusers','b212$' and 'liuxg' as you like.

4. Add machine account,user account for the SAMBA

[root@localhost root]#smbpasswd -a -m b212$
[root@localhost root]#smbpasswd -a liuxg
[root@localhost root]#smbpasswd -a root

Passwords don't have to be the same as those in the OS.

5. make directories

[root@localhost root]#mkdir -p /home/samba/netlogon
[root@localhost root]#mkdir -p /home/samba/profiles
[root@localhost root]#mkdir -p /home/samba/logs
[root@localhost root]#touch /home/samba/netlogon/liuxg.bat

These directories should vary with your modifications to the example smb.conf. Please read the third one in the 'REFERENCE LINKS' below for an example .bat startup script.

6. Start the smbd and nmbd daemons

[root@localhost root]#/usr/sbin/nmbd
[root@localhost root]#/usr/sbin/smbd

Remember you can not set 'wins support = yes' and 'wins server = w.x.y.z' at the same time. I recommend you choose 'wins support = yes' and run SAMBA act as a WINS server (the nmbd daemon).

Client Side (Asianux 1.0)

1. enable NETBIOS over TCP/IP (SAMBA can not act as a Active Directory PDC)
2. Add the WINS server (the IP address of the SAMBA server in this reference)
3. Change the computer name to 'b212$' join the workgroup 'calis.edu.cn'
4. Join the domain 'calis.edu.cn'

I did not success if I ommit the third step. Join the domain needs domain administrator account of SAMBA PDC which is 'root' here.
If the client is Windows XP, a group policy needs to be set specially. Please read the last one in the 'REFERENCE LINKS' below. By the way, It seems roaming profile settings doesn't working with Windows XP.

FINALLY
You can log in Windows using the domain account 'liuxg' now.

REFERENCE LINKS
http://us4.samba.org/samba/docs/man/smb.conf.5.html
http://www.oreilly.com/catalog/samba/chapter/book/index.html
http://gentoo-wiki.com/HOWTO_Implement_Samba_as_your_PDC
http://www.tweakxp.com/article37073.aspx

AttachmentSize
smb.txt12.1 KB