SAMBA VI: As a Domain Controller
Summary:- Running A Linux Primary Domain Controller
- Joining Windows Machines To The Domain
- Making Your Life Easier
- Going Enterprise1.1
workgroup
Running A Linux Primary Domain Controller
Since early releases of Samba 2, Samba has been able to provide limited domain controlling features, allowing you to get many (and an ever increasing number) of the features for which you would normally need a Windows (Windows NT 4 or Windows 2000) Server. Since Samba-2.2.0, Samba has also been able to be a domain controller for Windows 2000 clients. The features available include:- Domain accounts
- Network profiles
- Login scripts (highly customizable)
- Defining Domain Admins (and Domain Guests in Samba>= 2.2.2
- User and computer policies
- Providing domain authentication services for certain Windows servers such as Microsoft SQL Server
Features not implemented yet
Unfortunately, since Microsoft publishes very little information on how they implement features, the samba team must spend a lot of time reverse-engineering Windows networking. As such the following features are either not implemented at all or under development:- Domain Groups
- Integration with Microsoft Exchange Server (this is however possible with Samba-TNG, which forked from Samba about a year ago).
- PDC-BDC relationships with Windows NT or Samba, and Active Directory replication with Windows 2000.
- Domain Trusts (apparently this might also be possible with Samba-TNG).
Configuration options required
To control a windows domain, you need the following entries in your 'smb.conf' file:smb.conf
domain logons = yes security = user os level = 33
{netlogon}
Joining Machines To The Domain
To access certain features of a domain (for example authentication of network clients and authentication of users at logon), each machine of the domain needs to be set to consult the domain controllers of the domain. For full domain membership, machines need to have an account made for them in the domain.Windows 9x
Windows 9x machines do not implement full domain membership, so joining them to the domain is the easiest. Navigate to the Network section of the control panel (Start ->Settings->Control Panel->Network), select the Configuration tab, highlight "Client for Microsoft Networks" and click the Properties button. Check "Log onto Windows NT Domain", and enter the domain name in the text field. Click all the OK buttons and reboot1.1Windows NT 4
Windows NT machines have a full domain implementation, and better default security. Each machine keeps its own password, which controls which machines may authenticate from the domain. Thus each machine needs its own entry in the 'smbpasswd' file. At present, Samba needs to have a Unix account for every entry in the 'smbpasswd' file, so this means that each computer needs a Unix account on the Domain Controller. Machine accounts are differentiated from user accounts by appending a $ to the end of the machine's name. For Windows NT clients, you can create these accounts manually.See the Windows 2000 section for how you can make this simpler1.1 To make a domain machine account, issue the following commands on the Domain Controller as 'root':service smb reload
| http://ranger.dnsalias.com, a slow machine somewhere in Africa. |
useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M <NETBIOS_NAME>$ smbpasswd -am <NETBIOS_NAME>
smbpasswd -a
|
Windows XP
As of Samba-2.2.2 Windows XP is supported as a domain member, after applying this change to the registry? on Windows XP boxes. If you have set your Samba PDC up to allow Windows 2000 to join, it should work. To join the domain, follow the steps below:![]() | ![]() | ![]() |
| Start->Settings->Control Panel. Click "Network and Internet Connections" | Click "Network Connections" | Select "Advanced" -> "Network Identification" |
![]() | ![]() | ![]() | ![]() |
| Click the "Change" button | Select the "Domain" button, and enter your domain name | Enter "root" and root's smbpasswd | Welcome to your domain Warning, larger images go offsite to http://ranger.dnsalias.com, a slow machine somewhere in Africa. |
Making Your Life Easier
There are some features of Windows networking which make life as a Windows Admin bearable, and allow you to get some of the functionality a decent Unix-only network would provide. The three easy ones to implement are Network profiles, home directories and login scripts. Computer and User policies can also be applied, but that is left as an exercise. Hint: See the Samba-HOWTO-Collection for more info.Network Profiles and Home Directories
Network profiles are similar to the dot-files in your home directory, allowing you to keep you desktop and application settings between machines joined to a domain. Note that the entire contents of the profile is copied across the network at logon time, so you should take care that the profile does not get too large. Also, Windows NT has been known to corrupt profiles, so care is suggested Hint: never choose "Use local profile" under Windows NT The home directory is often made available and can be set to be automatically mapped by Windows NT and Windows 2000 using theadd user script = /usr/sbin/useradd -d /dev/null -g machines -c 'Machine Account' -s /bin/false -M %u
logon path
logon drive
Login Scripts
Login scripts are a powerful way of ensuring that certain things happen on your client machines when users log in. The scripts are standard DOS-type batch scripts, and are typically used to:- Map network drives to shares
- Set registry entries
- Copy configuration files
- Perform computer maintenance
logon path = <UNC> #Path where windows NT stores user profiles logon home = <UNC> #Path where windows 9x stores user profiles logon drive = <Drive_name>: #The drive name mapped to the share section of logon path
logon script = <FILE_NAME>
{netlogon}
login script
logon script = %U.bat
{netlogon}
Domain Groups
There is very limited support for domain groups in Samba, only sufficient to be able to run a domain. Theroot preexec = /usr/bin/ntlogon -u %U -g %G -o %a -d /var/lib/samba/netlogon \ && chmod 644 /var/lib/samba/netlogon/%U.bat; root postexec = rm -f /var/lib/samba/netlogon/%U.bat
domain admin group
Going Enterprise1.1
Although Samba does not support Domain Trusts at the moment, it is possible (if you are using only Samba PDCs) to create an environment which would appear use Domain Trusts. By implementing a Lightweight Directory Access Protocol (LDAP) server, you can provide consistent user names, UIDs, GIDs, and group memberships across many different Unix machines. It is also possible to export and import the smbpasswd's Samba uses to/from LDAP (via Perl scripts which can be run as cron jobs). All the Domain Controllers can then update the smbpasswd's from the LDAP server. For WAN setups, you can use LDAP's replication protocol to replicate the directory between locations, and run Domain Controllers on either side. In future, Samba will be able directly store its passwords in LDAP. section indexRelated Resources:
Samba: An IntroductionJust what is SMB?
Samba HOWTO Collection
Using SAMBA
domain admin group = <USER1> <USER2> @<GROUP>
Author: Buchan Milne Legal: This page is covered by the GNU Free Documentation License. Standard disclaimers of warranty apply. Copyright LSTB and Mandrakesoft.
SAMBA VI: As a Domain Controller
Version 1.3 last modified by AdminWiki on 22/03/2004 at 09:44
Version 1.3 last modified by AdminWiki on 22/03/2004 at 09:44
Document data
- Lost account?
- Join the community, be part of the Club: it's free!
- Get the PWP Download Subscription!
Mandriva.com
Store
Club










