For When You Can't Have The Real Thing
[ start | index | login ]
start > samba > Joining an NT4 style domain

Joining an NT4 style domain

Created by dave. Last edited by dave, 18 years and 337 days ago. Viewed 5,093 times. #4
[diff] [history] [edit] [rdf]
labels
attachments

Joining an NT4 style domain (NT4/Win2K)

Assumptions for this section:

ParameterValue
NetBIOS nameSERV1
Windows 200x/NT domain nameMIDEARTH
Domain's PDC NetBIOS nameDOMPDC
Domain's BDC NetBIOS namesDOMBDC1 and DOMBDC2

First, you must edit your smb.conf file to tell Samba it should now use domain security.

Change (or add) your security line in the [global] section of your smb.conf to read:

security = domain

Next change the workgroup line in the [global] section to read:

workgroup = MIDEARTH
This is the name of the domain we are joining.

You must also have the parameter encrypt passwords set to yes in order for your users to authenticate to the NT PDC. This is the default setting if this parameter is not specified. There is no need to specify this parameter, but if it is specified in the smb.conf file, it must be set to Yes.

Finally, add (or modify) a password server line in the [global] section to read:

password server = DOMPDC DOMBDC1 DOMBDC2
These are the primary and backup Domain Controllers Samba will attempt to contact in order to authenticate users. Samba will try to contact each of these servers in order, so you may want to rearrange this list in order to spread out the authentication load among Domain Controllers.

Alternately, if you want smbd to automatically determine the list of Domain Controllers to use for authentication, you may set this line to be:

password server = *
This method allows Samba to use exactly the same mechanism that NT does. The method either uses broadcast-based name resolution, performs a WINS database lookup in order to find a Domain Controller against which to authenticate, or locates the Domain Controller using DNS name resolution.

To join the domain, run this command:

root# net join -S DOMPDC -UAdministrator%password
If the -S DOMPDC argument is not given, the domain name will be obtained from smb.conf. (NOTE: this is rather tricky -- it is safest to always specify the name of the domain controller.)

The machine is joining the domain DOM, and the PDC for that domain (the only machine that has write access to the domain SAM database) is DOMPDC, therefore use the -S option. The Administrator%password is the login name and password for an account that has the necessary privilege to add machines to the domain. If this is successful, you will see the message in your terminal window the text shown below. Where the older NT4 style domain architecture is used:

Joined domain DOM.
Where Active Directory is used:
Joined SERV1 to realm MYREALM.
Refer to the net man page for further information.

This process joins the server to the domain without having to create the machine trust account on the PDC beforehand.

This command goes through the machine account password change protocol, then writes the new (random) machine account password for this Samba server into a file in the same directory in which a smbpasswd file would be normally stored: /usr/local/samba/private/secrets.tdb or /etc/samba/secrets.tdb.

This file is created and owned by root and is not readable by any other user. It is the key to the Domain-level security for your system, and should be treated as carefully as a shadow password file.

Finally, restart your Samba daemons and get ready for clients to begin using domain security. The way you can restart your Samba daemons depends on your distribution, but in most cases the following will suffice:

root# /etc/init.d/samba restart

(>>source)

Other Things
Tried this on Solaris 8 with samba 3.0.10 (source build, the package install collided with an older samba already in the network-shared /usr/local). Naturally, this didn't quite work as advertised. Things which I did in my fumbling around which might have helped:

  • built $SAMBAROOT/lib/lmhosts containing IP-to-name mappings for the PDC and the two BDC systems I knew about
  • manually "added" the samba computer to the domain from the PDC
  • explicitly specified the PDC name on the net join command (see note above)
  • smbcontrol $daemon reload-config did not appear to do jack; I had to stop and then restart the daemons explicitly
no comments | post comment
This is a collection of techical information, much of it learned the hard way. Consider it a lab book or a /info directory. I doubt much of it will be of use to anyone else.

Useful:


snipsnap.org | Copyright 2000-2002 Matthias L. Jugel and Stephan J. Schmidt