Software: Apache/2.0.54 (Fedora). PHP/5.0.4 uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/bin/X11/./../../share/doc/python-numeric-23.7/../samba-3.0.23a/htmldocs/Samba3-HOWTO/ drwxr-xr-x |
Viewing file: Select action/file-type: Table of Contents Domain membership is a subject of vital concern. Samba must be able to participate as a member server in a Microsoft domain security context, and Samba must be capable of providing domain machine member trust accounts; otherwise it would not be able to offer a viable option for many users. This chapter covers background information pertaining to domain membership, the Samba configuration for it, and MS Windows client procedures for joining a domain. Why is this necessary? Because both are areas in which there exists within the current MS Windows networking world, and particularly in the UNIX/Linux networking and administration world, a considerable level of misinformation, incorrect understanding, and lack of knowledge. Hopefully this chapter will fill the voids. MS Windows workstations and servers that want to participate in domain security need to be made domain members. Participating in domain security is often called single sign-on, or SSO for short. This chapter describes the process that must be followed to make a workstation (or another server be it an MS Windows NT4/200x server) or a Samba server a member of an MS Windows domain security context. Samba-3 can join an MS Windows NT4-style domain as a native member server, an MS Windows Active Directory domain as a native member server, or a Samba domain control network. Domain membership has many advantages:
A Machine Trust Account is an account that is used to authenticate a client machine (rather than a user) to the domain controller server. In Windows terminology, this is known as a “computer account.” The purpose of the machine trust account is to prevent a rogue user and domain controller from colluding to gain access to a domain member workstation. The password of a Machine Trust Account acts as the shared secret for secure communication with the domain controller. This is a security feature to prevent an unauthorized machine with the same NetBIOS name from joining the domain, participating in domain security operations, and gaining access to domain user/group accounts. Windows NT/200x/XP Professional clients use machine trust accounts, but Windows 9x/Me/XP Home clients do not. Hence, a Windows 9x/Me/XP Home client is never a true member of a domain because it does not possess a Machine Trust Account, and, thus, has no shared secret with the domain controller. A Windows NT4 PDC stores each Machine Trust Account in the Windows Registry. The introduction of MS Windows 2000 saw the introduction of Active Directory, the new repository for Machine Trust Accounts. A Samba PDC, however, stores each Machine Trust Account in two parts, as follows:
There are three ways to create Machine Trust Accounts:
Neither MS Windows NT4/200x/XP Professional, nor Samba, provide any method for enforcing the method of machine trust account creation. This is a matter of the administrator's choice.
The first step in manually creating a Machine Trust Account is to manually
create the corresponding UNIX account in
In the example above there is an existing system group “machines” which is used as the primary group for all machine accounts. In the following examples the “machines” group numeric GID is 100. On *BSD systems, this can be done using the chpass utility:
The
doppy$:x:505:100:
in which Now that the corresponding UNIX account has been created, the next step is to create the Samba account for the client containing the well-known initial Machine Trust Account password. This can be done using the smbpasswd command as shown here:
where Join the client to the domain immediatelyManually creating a Machine Trust Account using this method is the equivalent of creating a Machine Trust Account on a Windows NT PDC using the Server Manager. From the time at which the account is created to the time the client joins the domain and changes the password, your domain is vulnerable to an intruder joining your domain using a machine with the same NetBIOS name. A PDC inherently trusts members of the domain and will serve out a large degree of user information to such clients. You have been warned! A working add machine script is essential for machine trust accounts to be automatically created. This applies no matter whether you use automatic account creation or the NT4 Domain Server Manager. If the machine from which you are trying to manage the domain is an MS Windows NT4 workstation or MS Windows 200x/XP Professional, the tool of choice is the package called SRVTOOLS.EXE. When executed in the target directory it will unpack SrvMgr.exe and UsrMgr.exe (both are domain management tools for MS Windows NT4 workstation). If your workstation is a Microsoft Windows 9x/Me family product, you should download the Nexus.exe package from the Microsoft Web site. When executed from the target directory, it will unpack the same tools but for use on this platform. Further information about these tools may be obtained from Knowledge Base articles 173673, and 172540 Launch the srvmgr.exe (Server Manager for Domains) and follow these steps: Procedure 6.1. Server Manager Account Machine Account Management
The third (and recommended) way of creating Machine Trust Accounts is simply to allow the Samba server to create them as needed when the client is joined to the domain.
Since each Samba Machine Trust Account requires a corresponding UNIX account, a method
for automatically creating the UNIX account is usually supplied; this requires configuration of the
add machine script option in Here is an example for a Red Hat Linux system:
The procedure for making an MS Windows workstation or server a member of the domain varies with the version of Windows.
When the user elects to make the client a domain member, Windows 200x prompts for
an account and password that has privileges to create machine accounts in the domain.
A Samba administrator account (i.e., a Samba account that has
For security reasons, the password for this administrator account should be set
to a password that is other than that used for the root user in
The name of the account that is used to create domain member machine trust accounts can be
anything the network administrator may choose. If it is other than The session key of the Samba administrator account acts as an encryption key for setting the password of the machine trust account. The Machine Trust Account will be created on-the-fly, or updated if it already exists. If the Machine Trust Account was created manually, on the Identification Changes menu enter the domain name, but do not check the box Create a Computer Account in the Domain. In this case, the existing Machine Trust Account is used to join the machine to the domain. If the Machine Trust Account is to be created on the fly, on the Identification Changes menu enter the domain name and check the box Create a Computer Account in the Domain. In this case, joining the domain proceeds as above for Windows 2000 (i.e., you must supply a Samba administrator account when prompted). Joining a Samba client to a domain is documented in the next section. This mode of server operation involves the Samba machine being made a member of a domain security context. This means by definition that all user authentication will be done from a centrally defined authentication regime. The authentication regime may come from an NT3/4-style (old domain technology) server, or it may be provided from an Active Directory server (ADS) running on MS Windows 2000 or later. Of course it should be clear that the authentication backend itself could be from any distributed directory architecture server that is supported by Samba. This can be LDAP (from OpenLDAP), or Sun's iPlanet, or Novell e-Directory Server, and so on. NoteWhen Samba is configured to use an LDAP or other identity management and/or directory service, it is Samba that continues to perform user and machine authentication. It should be noted that the LDAP server does not perform authentication handling in place of what Samba is designed to do. Please refer to Domain Control, for more information regarding how to create a domain machine account for a domain member server as well as for information on how to enable the Samba domain member machine to join the domain and be fully trusted by it. Assumptions lists names that are used in the remainder of this chapter. Table 6.1. Assumptions
First, you must edit your
Change (or add) your security line in the [global] section
of your
Note that if the parameter
Next change the workgroup line in the
This is the name of the domain we are joining.
You must also have the parameter encrypt passwords
set to Finally, add (or modify) a password server line in the [global] section to read:
These are the PDC and BDCs 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. Alternatively, if you want smbd to determine automatically the list of domain controllers to use for authentication, you may set this line to be:
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:
If the
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
Where Active Directory is used, the command used to join the ADS domain is:
And the following output is indicative of a successful outcome:
Refer to the net man page and to the chapter on remote administration for further information. This process joins the server to the domain without separately 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. The trust account information that is needed by the DMS is written into the file
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:
Currently, domain security in Samba does not free you from having to create local UNIX users to represent the
users attaching to your server. This means that if domain user Please refer to Winbind: Use of Domain Accounts, for information on a system to automatically assign UNIX UIDs and GIDs to Windows NT domain users and groups. The advantage of domain-level security is that the authentication in domain-level security is passed down the authenticated RPC channel in exactly the same way that an NT server would do it. This means Samba servers now participate in domain trust relationships in exactly the same way NT servers do (i.e., you can add Samba servers into a resource domain and have the authentication passed on from a resource domain PDC to an account domain PDC). In addition, with security = server, every Samba daemon on a server has to keep a connection open to the authenticating server for as long as that daemon lasts. This can drain the connection resources on a Microsoft NT server and cause it to run out of available connections. With security = domain, however, the Samba daemons connect to the PDC or BDC only for as long as is necessary to authenticate the user and then drop the connection, thus conserving PDC connection resources. Finally, acting in the same manner as an NT server authenticating to a PDC means that as part of the authentication reply, the Samba server gets the user identification information such as the user SID, the list of NT groups the user belongs to, and so on. NoteMuch of the text of this document was first published in the Web magazine LinuxWorld as the article http://www.linuxworld.com/linuxworld/lw-1998-10/lw-10-samba.html Doing the NIS/NT Samba. This is a rough guide to setting up Samba-3 with Kerberos authentication against a Windows 200x KDC. A familiarity with Kerberos is assumed.
You must use at least the following three options in
In case samba cannot correctly identify the appropriate ADS server using the realm name, use the
password server option in
The most common reason for which Samba may not be able to locate the ADS domain controller is a consequence of
sites maintaining some DNS servers on UNIX systems without regard for the DNS requirements of the ADS
infrastructure. There is no harm in specifying a preferred ADS domain controller using the
With both MIT and Heimdal Kerberos, it is unnecessary to configure the
Microsoft ADS automatically create SRV records in the DNS zone
UNIX systems can use kinit and the DES-CBC-MD5 or DES-CBC-CRC encryption types to authenticate to the Windows 2000 KDC. For further information regarding Windows 2000 ADS kerberos interoperability please refer to the Microsoft Windows 2000 Kerberos Interoperability guide. Another very useful document that may be referred to for general information regarding Kerberos interoperability is RFC1510. This RFC explains much of the magic behind the operation of Kerberos.
MIT's, as well as Heimdal's, recent KRB5 libraries default to checking for SRV records, so they will
automatically find the KDCs. In addition,
When manually configuring [libdefaults] default_realm = YOUR.KERBEROS.REALM [realms] YOUR.KERBEROS.REALM = { kdc = your.kerberos.server } [domain_realms] .kerberos.server = YOUR.KERBEROS.REALM
When using Heimdal versions before 0.6, use the following configuration settings: [libdefaults] default_realm = YOUR.KERBEROS.REALM default_etypes = des-cbc-crc des-cbc-md5 default_etypes_des = des-cbc-crc des-cbc-md5 [realms] YOUR.KERBEROS.REALM = { kdc = your.kerberos.server } [domain_realms] .kerberos.server = YOUR.KERBEROS.REALM
Test your config by doing a
With Heimdal versions earlier than 0.6.x you can use only newly created accounts
in ADS or accounts that have had the password changed once after migration, or
in case of NoteThe realm must be in uppercase or you will get a “Cannot find KDC for requested realm while getting initial credentials” error (Kerberos is case-sensitive!). NoteTime between the two servers must be synchronized. You will get a “kinit(v5): Clock skew too great while getting initial credentials” if the time difference (clock skew) is more than five minutes. Clock skew limits are configurable in the Kerberos protocols. The default setting is five minutes. You also must ensure that you can do a reverse DNS lookup on the IP address of your KDC. Also, the name that this reverse lookup maps to must either be the NetBIOS name of the KDC (i.e., the hostname with no domain attached) or it can be the NetBIOS name followed by the realm.
The easiest way to ensure you get this right is to add a If all you want is Kerberos support in smbclient, then you can skip directly to Testing with smbclient now. Create the Computer Account and Testing Server Setup are needed only if you want Kerberos support for smbd and winbindd. As a user who has write permission on the Samba private directory (usually root), run:
The Administrator account can be any account that has been designated in the ADS domain security settings with permission to add machines to the ADS domain. It is, of course, a good idea to use an account other than Administrator. On the UNIX/Linux system, this command must be executed by an account that has UID=0 (root). When making a Windows client a member of an ADS domain within a complex organization, you may want to create the machine trust account within a particular organizational unit. Samba-3 permits this to be done using the following syntax:
Your ADS manager will be able to advise what should be specified for the "organizational_unit" parameter. For example, you may want to create the machine trust account in a container called “Servers” under the organizational directory “Computers\BusinessUnit\Department,” like this:
This command will place the Samba server machine trust account in the container
If the join was successful, you will see a new computer account with the NetBIOS name of your Samba server in Active Directory (in the “Computers” folder under Users and Computers.
On a Windows 2000 client, try
Samba maps UNIX users and groups (identified by UIDs and GIDs) to Windows users and groups (identified by SIDs).
These mappings are done by the In some cases it is useful to share these mappings between Samba domain members, so name->id mapping is identical on all machines. This may be needed in particular when sharing files over both CIFS and NFS.
To use the LDAP
See the
Do not forget to specify also the ldap admin dn
and to make certain to set the LDAP administrative password into the
In place of In the process of adding/deleting/re-adding domain member machine trust accounts, there are many traps for the unwary player and many “little” things that can go wrong. It is particularly interesting how often subscribers on the Samba mailing list have concluded after repeated failed attempts to add a machine account that it is necessary to “reinstall” MS Windows on the machine. In truth, it is seldom necessary to reinstall because of this type of problem. The real solution is often quite simple, and with an understanding of how MS Windows networking functions, it is easy to overcome. “A Windows workstation was reinstalled. The original domain machine trust account was deleted and added immediately. The workstation will not join the domain if I use the same machine name. Attempts to add the machine fail with a message that the machine already exists on the network I know it does not. Why is this failing?” The original name is still in the NetBIOS name cache and must expire after machine account deletion before adding that same name as a domain member again. The best advice is to delete the old account and then add the machine with a new name. Alternately, the name cache can be flushed and reloaded with current data using the nbtstat command on the Windows client:
“Adding a Windows 200x or XP Professional machine to the Samba PDC Domain fails with a message that says, "The machine could not be added at this time, there is a network problem. Please try again later." Why?”
You should check that there is an add machine script in your Possible causes include:
The add machine script does not create the machine account in the Samba backend database; it is there only to create a UNIX system account to which the Samba backend database account can be mapped. Windows 2003 requires SMB signing. Client-side SMB signing has been implemented in Samba-3.0. Set client use spnego = yes when communicating with a Windows 2003 server. This will not interfere with other Windows clients that do not support the more advanced security features of Windows 2003 because the client will simply negotiate a protocol tha both it and the server suppport. This is a well-known fall-back facility that is built into the SMB/CIFS protocols. |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0042 ]-- |