Samba NT Domain Controller

By Mayank Sarup <mayank@freeos.com>
Posted: ( 2001-03-27 02:44:59 EST by cnb )

Currently, Samba can go beyond merely emulating Windows shares to actually acting as the Primary Domain Controller for your Windows network. Of course, Samba can also become a NT domain member. In this article we shall look at both these options.

The domain concept is much better than the traditional workgroup concept. One of the primary benefits is having a centralized password database on the Primary Domain Controller. Once authenticated, you can access any of the shares in the domain, without having to re-authenticate yourself.

If you're unfamiliar with Samba, then we've got a couple of good howto's that you can refer to. Look for links to them at the bottom of the article.

Samba as a NT Domain Member

Samba emulates a NT workstation when becoming part of the domain. So, the first thing you need to do is create a machine account for your Samba machine on the domain controller. In NT you would use the program Server Manager for Domains to create the account. Once the account is created, all you need to add are the following lines to your smb.conf file under the global section.

# Your Workgroup or Domain that you want
# to login to
workgroup = FREEOS
 
# Tell Samba to talk to domain controller
# for authentication
security = domain
 
# Specify the server to get authenticate 
# from. You can specify the 
# NetBIOS # names of the servers or simply 
# put in a "*" here to let 
# Samba find the server through broadcast 
password server = PS1 PS2 
 
# Make sure Samba is using encrypted 
# passwords
encrypt passwords = yes
 
Now stop the Samba daemons
 
/etc/rc.d/init.d/smb stop
 
Give the following command to join the 
NT Domain
 
smbpasswd -j DOMAIN -r DOMAINPDC
 

DOMAIN here is the domain that you want to log on to. DOMAINPDC is the primary domain controller for that domain. You will then see a message saying, “Joined domain DOMAIN”.

Now start your SMB and NMB daemons.

/etc/rc.d/init.d/smb start

That was all about joining an NT domain. Setting up Samba as your Primary Domain Controller is not very difficult.

Samba as Primary Domain Controller

Add the following to the global section of your smb.conf file.

# The domain you want to be a PDC for
workgroup = SIMPLE
 
# Tell Samba to use domain logons
domain logons = yes
 
# User-level security. Users must 
# authenticate themselves with
# valid username and password
security = user
 
# Set to yes so that nmbd participates 
# in local master browser
# elections
local master = yes 
 
# Set Os level value to make sure nmbd 
# wins local browse master 
# elections. 65 should beat everyone 
# according to the man page
os level = 65
 
# Give nmbd an advantage in local 
# master browser elections
preferred master = yes
 
# Set so that nmbd claims a unique 
# NetBIOS name identifying it as 
# a domain master
domain master = yes
 
# The following share is required to support
# domain logons. The directory may be 
# created anywhere on your system. Make 
# sure the share is non-writeable and also
# not a public share.
[netlogon]
comment = The domain logon service
path = /usr/local/samba/netlogon
public = no
writeable = no

The next thing to do is create the users on the Samba server that is to act as the domain controller. You can do this using the useradd command.

next >>

1