From 08d364c5169f48a4b1e88296ba6628ffec9217a4 Mon Sep 17 00:00:00 2001 From: John Terpstra Date: Mon, 20 Jun 2005 21:22:43 +0000 Subject: [PATCH] Another progress update. (This used to be commit 9525a2dcab0374da020a912bd7c6239f8397e368) --- docs/Samba3-HOWTO/TOSHARG-AccessControls.xml | 3 +- docs/Samba3-HOWTO/TOSHARG-BDC.xml | 116 +++-- docs/Samba3-HOWTO/TOSHARG-DomainMember.xml | 663 ++++++++++++++++++++------- docs/Samba3-HOWTO/TOSHARG-TheNetCommand.xml | 2 +- 4 files changed, 580 insertions(+), 204 deletions(-) diff --git a/docs/Samba3-HOWTO/TOSHARG-AccessControls.xml b/docs/Samba3-HOWTO/TOSHARG-AccessControls.xml index 51f08c2f57d..df124ac4de9 100644 --- a/docs/Samba3-HOWTO/TOSHARG-AccessControls.xml +++ b/docs/Samba3-HOWTO/TOSHARG-AccessControls.xml @@ -408,7 +408,8 @@ drwsrwsrwx 2 maryo gnomes 48 2003-05-12 22:29 muchado08 For example, Windows NT/2K/XP provides the capacity to set access controls on a directory into which people can write files but not delete them. It is possible to set an ACL on a Windows file that permits the file to be written to but not deleted. Such concepts are foreign to the UNIX operating system file space. Within the UNIX file system - anyone who has the ability to create a file can write to it and has the capability to delete it. + anyone who has the ability to create a file can write to it and anyone who has write permission on the + directory that contains a file and has write permission for it has the capability to delete it. diff --git a/docs/Samba3-HOWTO/TOSHARG-BDC.xml b/docs/Samba3-HOWTO/TOSHARG-BDC.xml index 1bd6db90289..dfd82814089 100644 --- a/docs/Samba3-HOWTO/TOSHARG-BDC.xml +++ b/docs/Samba3-HOWTO/TOSHARG-BDC.xml @@ -317,16 +317,25 @@ section for an example of the minimum required settings. ldapsam://localhost:389 yes yes +dc=quenya,dc=org +ou=Users +ou=Groups +ou=Computers +ou=Idmap +cn=Manager,dc=quenya,dc=org profile path home drive -Several other things like a and a - share also need to be set along with -settings for the profile path, the user's home drive, and so on. This is not covered in this -chapter; for more information please refer to Domain Control. +Several other things like a and a share +also need to be set along with settings for the profile path, the user's home drive, and so on. This is not +covered in this chapter; for more information please refer to Domain Control. +Refer to the Domain Control chapter for specific recommendations for PDC +configuration. Alternately, fully documented working example network configurations using OpenLDAP and Samba +as available in the book Samba-3 +by Example that may be obtained from local and on-line book stores. @@ -507,7 +516,7 @@ environment all machines require appropriate DNS entries. More information may b credentials validation An MS Windows NT4/200x/XP Professional workstation in the domain MIDEARTH that wants a local user to be authenticated has to find the domain controller for MIDEARTH. It does this -by doing a NetBIOS name query for the group name MIDEARTH<#1c>. It assumes that each +by doing a NetBIOS name query for the group name MIDEARTH<#1C>. It assumes that each of the machines it gets back from the queries is a domain controller and can answer logon requests. To not open security holes, both the workstation and the selected domain controller authenticate each other. After that the workstation sends the user's credentials (name and @@ -551,12 +560,12 @@ The creation of a BDC requires some steps to prepare the Samba server before private/secrets.tdb private/MACHINE.SID domain SID - The domain SID has to be the same on the PDC and the BDC. In Samba versions - pre-2.2.5, the domain SID was stored in the file private/MACHINE.SID. - The domain SID is now stored in the file private/secrets.tdb. This file - is unique to each server and cannot be copied from a PDC to a BDC; the BDC will generate - a new SID at startup. It will overwrite the PDC domain SID with the newly created BDC SID. - There is a procedure that will allow the BDC to aquire the domain SID. This is described here. + The domain SID has to be the same on the PDC and the BDC. In Samba versions pre-2.2.5, the domain SID was + stored in the file private/MACHINE.SID. For all versions of Samba released since 2.2.5 + the domain SID is stored in the file private/secrets.tdb. This file is unique to each + server and cannot be copied from a PDC to a BDC; the BDC will generate a new SID at startup. It will overwrite + the PDC domain SID with the newly created BDC SID. There is a procedure that will allow the BDC to aquire the + domain SID. This is described here. @@ -583,9 +592,8 @@ The creation of a BDC requires some steps to prepare the Samba server before - Either or - must be specified in - the &smb.conf; file. + The parameter and the + parameter must be specified in the &smb.conf; file. @@ -619,6 +627,25 @@ The creation of a BDC requires some steps to prepare the Samba server before file with rsync and ssh, this method is broken and flawed, and is therefore not recommended. A better solution is to set up slave LDAP servers for each BDC and a master LDAP server for the PDC. + The use of rsync is inherently flawed by the fact that the data will be replicated + at timed intervals. There is no guarantee that the BDC will be operating at all + times with correct and current machine and user account information. This means that + this method runs the risk of users being inconvenienced by discontinuity of access + to network services due to inconsistent security data. It must be born in mind that + Windows workstations update (change) the machine trust account password at regular + intervals &smbmdash; administrators are not normally aware that this is happening + or when it takes place. + + + + POSIX + LDAP + SambaSAMAccount + synchronize + The use of LDAP for both the POSIX (UNIX user and group) accounts and for the + SambaSAMAccount data automatically ensures that all account change information + will be written to the shared directory. This eliminates the need for any special + action to synchronize account information because LDAP will meet that requirement. @@ -628,11 +655,12 @@ The creation of a BDC requires some steps to prepare the Samba server before BDC cron rsync - The netlogon share has to be replicated from the PDC to the - BDC. This can be done manually whenever login scripts are changed, - or it can be done automatically using a cron job - that will replicate the directory structure in this share using a tool - like rsync. + The netlogon share has to be replicated from the PDC to the BDC. This can be done manually whenever login + scripts are changed, or it can be done automatically using a cron job that will replicate + the directory structure in this share using a tool like rsync. The use of + rsync for replication of the netlogon data is not critical to network security and is one + that can be manually managed given that the administrator will make all changes to the netlogon share as part + of a conscious move. @@ -640,9 +668,10 @@ The creation of a BDC requires some steps to prepare the Samba server before Example Configuration - Finally, the BDC has to be found by the workstations. This can be -done by configuring the Samba &smb.conf; file section -as shown in Minimal Setup for Being a BDC. + +Finally, the BDC has to be capable of being found by the workstations. This can be done by configuring the +Samba &smb.conf; file section as shown in Minimal +Setup for Being a BDC. @@ -652,21 +681,33 @@ as shown in Minimal Setup for Being a BDC. ldapsam:ldap://slave-ldap.quenya.org no yes -ldap:ldap://slave-ldap.quenya.org +dc=abmas,dc=biz +ou=Users +ou=Groups +ou=Computers +ou=Idmap +cn=Manager,dc=quenya,dc=org +ldap:ldap://master-ldap.quenya.org +10000-20000 +10000-20000 +Fully documented working example network configurations using OpenLDAP and Samba +as available in the book Samba-3 +by Example that may be obtained from local and on-line book stores. + + + BDC NetBIOS group PDC -This configuration causes the BDC to register only the name MIDEARTH<#1C> with the -WINS server. This is not a problem, as the name MIDEARTH<#1C> is a NetBIOS group name -that is meant to be registered by more than one machine. The parameter -no -forces the BDC not to register MIDEARTH<#1B>, which is a unique NetBIOS name that -is reserved for the PDC. +This configuration causes the BDC to register only the name MIDEARTH<#1C> with the WINS server. This is +not a problem, as the name MIDEARTH<#1C> is a NetBIOS group name that is meant to be registered by more +than one machine. The parameter no forces the BDC not to +register MIDEARTH<#1B>, which is a unique NetBIOS name that is reserved for the PDC. @@ -677,8 +718,12 @@ is reserved for the PDC. LDAP database UID GID -The idmap backend will redirect the winbindd utility to -use the LDAP database to resolve all UIDs and GIDs for UNIX accounts. +SID +nss_ldap +The idmap backend will redirect the winbindd utility to use the LDAP +database to store all mappings for Windows SIDs to UIDs and GIDs for UNIX accounts in a repository that is +shared. The BDC will however depend on local resolution of UIDs and GIDs via NSS and the +nss_ldap utility. @@ -713,9 +758,12 @@ member servers. domain control -As domain control is a rather new area for Samba, there are not many examples that we may refer to. -Updates will be published as they become available and may be found in later Samba releases or -from the Samba Web site. +Domain control was a new area for Samba, but there are now many examples that we may refer to. +Updated information will be published as they become available and may be found in later Samba releases or +from the Samba Web site; refer in particular to the +WHATSNEW.txt in the Samba release tarball. The book, Samba-3 by Example +documents well tested and proven configuration examples. You can obtain a copy of this +book for the Samba web site. diff --git a/docs/Samba3-HOWTO/TOSHARG-DomainMember.xml b/docs/Samba3-HOWTO/TOSHARG-DomainMember.xml index b35160cad1b..d3f7f77d3c0 100644 --- a/docs/Samba3-HOWTO/TOSHARG-DomainMember.xml +++ b/docs/Samba3-HOWTO/TOSHARG-DomainMember.xml @@ -14,6 +14,9 @@ Domain Membership +domain member +machine trust account +domain security 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; @@ -21,6 +24,8 @@ otherwise it would not be able to offer a viable option for many users. +domain membership +misinformation 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 @@ -34,6 +39,9 @@ this chapter will fill the voids. Features and Benefits +domain security +single sign-on +SSO 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 @@ -43,6 +51,9 @@ server) or a Samba server a member of an MS Windows domain security context. +native member +ADS +domain control Server TypeDomain Member 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 @@ -51,11 +62,15 @@ control network. Domain membership has many advantages: -SAM + SAM MS Windows workstation users get the benefit of SSO. + access rights + file ownership + access controls + SAM Domain user access rights and file ownership/access controls can be set from the single Domain Security Account Manager (SAM) database (works with domain member servers as well as with MS Windows workstations @@ -63,21 +78,34 @@ control network. Domain membership has many advantages: + domain members + network logon Only MS Windows NT4/200x/XP Professional workstations that are domain members can use network logon facilities. + domain member + policy files + NTConfig.POL + desktop profiles Domain member workstations can be better controlled through the use of policy files (NTConfig.POL) and desktop profiles. + logon script + transparent access + application servers Through the use of logon scripts, users can be given transparent access to network applications that run off application servers. + user access management + SAM + LDAP + ADS Network administrators gain better application and user access management abilities because there is no need to maintain user accounts on any network client or server other than the central domain database @@ -93,26 +121,34 @@ control network. Domain membership has many advantages: Machine Trust Accounts -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 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 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. - - - +authenticate +domain controller +rogue user +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. + + + +machine trust accountpassword +shared secret +unauthorized +Windows NT/200x/XP Professional +Windows 9x/Me/XP Home +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. + + + +Windows Registry +PDC +ADS +Machine Trust Account 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 @@ -121,13 +157,21 @@ as follows: - A domain security account (stored in the - ) that has been configured in the - &smb.conf; file. The precise nature of the account information that is - stored depends on the type of backend database that has been chosen. + domain security account + account information + backend database + A domain security account (stored in the ) that has been configured in + the &smb.conf; file. The precise nature of the account information that is stored depends on the type of + backend database that has been chosen. + smbpasswd + UNIX login ID + UID + LanMan + NT-encrypted password + UNIX user identifierUID The older format of this data is the smbpasswd database that contains the UNIX login ID, the UNIX user identifier (UID), and the LanMan and NT-encrypted passwords. There is also some other information in @@ -135,17 +179,21 @@ as follows: - The two newer database types are called ldapsam and - tdbsam. Both store considerably more data than the - older smbpasswd file did. The extra information - enables new user account controls to be implemented. + database + ldapsam + smbpasswd + account controls + The two newer database types are called ldapsam and tdbsam. Both store considerably more data than the older + smbpasswd file did. The extra information enables new user account controls to be + implemented. - A corresponding UNIX account, typically stored in - /etc/passwd. Work is in progress to allow a - simplified mode of operation that does not require UNIX user accounts, but - this may not be a feature of the early releases of Samba-3. + UNIX account + /etc/passwd + A corresponding UNIX account, typically stored in /etc/passwd. Work is in progress to + allow a simplified mode of operation that does not require UNIX user accounts, but this has not been a feature + of the early releases of Samba-3, and is not currently planned for release either. @@ -157,12 +205,14 @@ There are three ways to create Machine Trust Accounts: + manual UNIX account creation Manual creation from the UNIX/Linux command line. Here, both the Samba and corresponding UNIX account are created by hand. Server Manager + Nexus toolkit Using the MS Windows NT4 Server Manager, either from an NT4 domain member server or using the Nexus toolkit available from the Microsoft Web site. This tool can be run from any MS Windows machine as long as the user is @@ -170,6 +220,8 @@ There are three ways to create Machine Trust Accounts: + Machine Trust Account + joined client On-the-fly creation. The Samba Machine Trust Account is automatically created by Samba at the time the client is joined to the domain. (For security, this is the recommended method.) The corresponding UNIX @@ -177,20 +229,26 @@ There are three ways to create Machine Trust Accounts: + +enforcing +machine trust accountcreation +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 for the administrator's choice. + + Manual Creation of Machine Trust Accounts +/etc/passwd + +useradd +vipw The first step in manually creating a Machine Trust Account is to manually create the corresponding UNIX account in /etc/passwd. -This can be done using vipw or another add user command +This can be done using vipw or another adduser command that is normally used to create new UNIX accounts. The following is an example for a Linux-based Samba server: - - - -useradd -vipw &rootprompt;/usr/sbin/useradd -g machines -d /var/lib/nobody -c "machine nickname" \ -s /bin/false machine_name$ @@ -199,16 +257,19 @@ a Linux-based Samba server: -In the example above there is an existing system group machines which is used + +primary group +GID +machine accounts +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. +numeric GID is 100. + chpass +BSD On *BSD systems, this can be done using the chpass utility: - - - &rootprompt;chpass -a \ 'machine_name$:*:101:100::0:0:Windows machine_name:/dev/null:/sbin/nologin' @@ -216,17 +277,23 @@ On *BSD systems, this can be done using the chpass utility: +/etc/passwd +$ +null shell +home directory The /etc/passwd entry will list the machine name with a $ appended, and will not have a password, will have a null shell and no home directory. For example, a machine named doppy would have an /etc/passwd entry like this: - - doppy$:x:505:100:machine_nickname:/dev/null:/bin/false + +machine_nickname +machine_name +Machine Trust Account in which machine_nickname can be any descriptive name for the client, such as BasementComputer. machine_name absolutely must be the NetBIOS @@ -236,20 +303,24 @@ this as a Machine Trust Account. +UNIX account +Samba account +Machine Trust Accountpassword 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: - - - &rootprompt;smbpasswd -a -m machine_name +machine_name +NetBIOS name +RID +UID where machine_name is the machine's NetBIOS name. The RID of the new machine account is generated from the UID of the corresponding UNIX account. @@ -259,6 +330,11 @@ the corresponding UNIX account. Join the client to the domain immediately +Machine Trust Account +PDC +Server Manager +changes password +NetBIOS name Manually creating a Machine Trust Account using this method is the equivalent of creating a Machine Trust Account on a Windows NT PDC using Server Manager @@ -276,6 +352,9 @@ information to such clients. You have been warned! Managing Domain Machine Accounts using NT4 Server Manager +machine trust accounts +automatic account creation +Server Manager A working 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. @@ -283,6 +362,9 @@ you use automatic account creation or the NT4 Domain Server Manager. SRVTOOLS.EXE +SrvMgr.exe +UsrMgr.exe +domain management tools 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. @@ -292,6 +374,7 @@ and UsrMgr.exe (both are domain management tools for MS Windo Nexus.exe +Microsoft Windows 9x/Me 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 @@ -312,6 +395,8 @@ Base article 172540 +srvmgr.exe +Server Manager for Domains Launch the srvmgr.exe (Server Manager for Domains) and follow these steps: @@ -353,12 +438,16 @@ Launch the srvmgr.exe (Server Manager for Domains) and follow On-the-Fly Creation of Machine Trust Accounts -The second (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. +Machine Trust Accountcreation +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 + +Machine Trust AccountUNIX account +UNIX account +add machine script +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 &smb.conf;. This method is not required; however, corresponding UNIX accounts may also be created manually. @@ -366,19 +455,17 @@ accounts may also be created manually. -Here is an example for a Red Hat Linux system. - - +useradd +Red Hat Linux +Here is an example for a Red Hat Linux system: -<...remainder of parameters...> /usr/sbin/useradd -d /var/lib/nobody -g 100 -s /bin/false -M %u - + - Making an MS Windows Workstation or Server a Domain Member @@ -390,6 +477,10 @@ with the version of Windows. Windows 200x/XP Professional Client +domain member +machine trust accountcreate privilege +privileges +root 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 root privileges on the @@ -398,18 +489,27 @@ with the version of Windows. +administrator account +/etc/passwd 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 /etc/passwd. - The name of the account that is used to create domain member machine accounts can be +account +create domain member +root +map + 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 root, then this is easily mapped to root in the file named in the &smb.conf; parameter /etc/samba/smbusers. +administrator account +encryption key +machine trust account 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. @@ -419,6 +519,9 @@ with the version of Windows. Windows NT4 Client +Machine Trust Account +Create a Computer Account +join the machine 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. @@ -427,6 +530,10 @@ with the version of Windows. +Machine Trust Account +on the fly +Computer Account +administrator account 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 @@ -437,8 +544,9 @@ with the version of Windows. Samba Client - Joining a Samba client to a domain is documented in - the next section. + + + Joining a Samba client to a domain is documented in the next section. @@ -449,6 +557,10 @@ with the version of Windows. Domain Member Server +domain security +security context +authentication regime +ADS 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. @@ -459,14 +571,25 @@ MS Windows 2000 or later. +authenticationbackend +distributed directory +LDAP +OpenLDAP +iPlanet +Sun +Novell +e-Directory 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 NetWare Directory +This can be LDAP (from OpenLDAP), or Sun's iPlanet, or Novell e-Directory Server, and so on. +LDAP +identity management +machine authentication When 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 @@ -474,6 +597,9 @@ authentication handling in place of what Samba is designed to do. +create a domain machine account +domain member server +join the domain 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 @@ -483,7 +609,7 @@ and be fully trusted by it. Joining an NT4-type Domain with Samba-3 -Assumptions lists names that have been used in the remainder of this chapter. +Assumptions lists names that are used in the remainder of this chapter. Assumptions @@ -491,7 +617,7 @@ and be fully trusted by it. - NetBIOS name:SERV1 + Samba DMS NetBIOS name:SERV1 Windows 200x/NT domain name:&example.workgroup; @@ -507,32 +633,37 @@ and be fully trusted by it.
+ First, you must edit your &smb.conf; file to tell Samba it should now use domain security. +security = user +standalone server +domain member server +domain security Change (or add) your line in the [global] section of your &smb.conf; to read: - - domain +Note that if the parameter security = user is used this machine would function as a +standalone server and not as a domain member server. Domain security mode causes Samba to work within the +domain security context. +
Next change the line in the section to read: - - &example.workgroup; - - This is the name of the domain we are joining. +authenticate +PDC You must also have the parameter 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 @@ -540,15 +671,15 @@ parameter, but if it is specified in the &smb.conf; file, it must be set to +PDC +BDC +authenticate users +domain controllers Finally, add (or modify) a line in the [global] section to read: - - DOMPDC DOMBDC1 DOMBDC2 - - 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 @@ -557,16 +688,16 @@ 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: - - +list of domain controllers +mechanism +broadcast-based name resolution +DNS name resolution +Alternately, if you want smbd to determine automatically the list of domain controllers to use for +authentication, you may set this line to be: * - - +WINS 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, @@ -575,19 +706,27 @@ or locates the domain controller using DNS name resolution. To join the domain, run this command: - - - +netrpcjoin -&rootprompt;net join -S DOMPDC -UAdministrator%password +&rootprompt;net rpc join -S DOMPDC -UAdministrator%password -If the argument is not given, the domain name will be obtained from &smb.conf;. +NetBIOS name +PDC +WINS lookup +NetBIOS broadcast +If the argument is not given, the domain name will be obtained from &smb.conf; and +the NetBIOS name of the PDC will be obtained either using a WINS lookup or via NetBIOS broadcast based name +look up. +joining the domain +PDC +Administrator%password +Joined domain 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 option. The Administrator%password is the login name and @@ -600,39 +739,55 @@ Where the older NT4-style domain architecture is used: -Where Active Directory is used: +netadsjoin +ADS +join the ADS domain +Where Active Directory is used the command used to join the ADS domain is: + +&rootprompt; net ads join -UAdministrator%password + +And the following output is indicative of a successful outcome: Joined SERV1 to realm MYREALM. -Refer to the net man page for further information. +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 having to create the machine +join the domain +create machine trust account +PDC +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: - -/usr/local/samba/private/secrets.tdb -or -/etc/samba/secrets.tdb. - +machine account passwordchange protocol +random machine account password +/usr/local/samba/private/secrets.tdb +/etc/samba/secrets.tdb +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 +/usr/local/samba/private/secrets.tdb or /etc/samba/secrets.tdb. +domain-level security +shadow password 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. +Samba daemons +distribution +/etc/init.d/samba 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: @@ -647,48 +802,56 @@ but in most cases the following will suffice: Why Is This Better Than <parameter>security = server</parameter>? -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 DOM\fred - attaches to your domain security Samba server, there needs -to be a local UNIX user fred to represent that user in the UNIX -file system. This is similar to the older Samba security mode -server, -where Samba would pass through the authentication request to a Windows +domain security +UNIX users +authentication +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 DOM\fred attaches to your +domain security Samba server, there needs to be a local UNIX user fred to represent that user in the UNIX file +system. This is similar to the older Samba security mode server, where Samba would pass through the authentication request to a Windows NT server in the same way as a Windows 95 or Windows 98 server would. +winbind +UID +GID 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). +domain-level +authentication +RPC +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 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 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. +PDC +BDC +connection resources +In addition, with 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 +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. +PDC +authentication reply +SID +NT groups +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. @@ -726,20 +889,30 @@ You must use at least the following three options in &smb.conf;: your.kerberos.REALM ADS The following parameter need only be specified if present. -The default setting is not present is Yes. +The default setting if not present is Yes. yes +ADS +realm +DNS +ADS DC +password server In case samba cannot correctly identify the appropriate ADS server using the realm name, use the option in &smb.conf;: - - your.kerberos.server +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 DC using the password +server. + +smbpasswd +authenticated You do not need an smbpasswd file, and older clients will be authenticated as if domain, although it will not do any harm and allows you to have local users not in the domain. @@ -753,17 +926,48 @@ allows you to have local users not in the domain. /etc/krb5.conf Kerberos/etc/krb5.conf -With both MIT and Heimdal Kerberos, it is unnecessary to configure the -/etc/krb5.conf, and it may be detrimental. +MIT +Heimdal +With both MIT and Heimdal Kerberos, it is unnecessary to configure the /etc/krb5.conf, +and it may be detrimental. +ADS +SRV records +DNS zon +KDC +_kerberos.REALM.NAME Microsoft ADS automatically create SRV records in the DNS zone _kerberos.REALM.NAME for each KDC in the realm. This is part of the installation and configuration process used to create an Active Directory domain. +A KDC is a Kerberos Key Distribution Center and forms an integral part of the Microsoft +active directory infrastructure. +kinit +DES-CBC-MD5 +DES-CBC-CRC +encryption types +kerberos +Windows 2000 +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 +KRB5 +SRV records +krb5.conf +DNS lookup +libraries 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, krb5.conf only allows specifying a single KDC, even there if there may be more than one. Using the DNS lookup allows the KRB5 @@ -771,6 +975,7 @@ libraries to use whichever KDCs are available. +krb5.conf When manually configuring krb5.conf, the minimal configuration is: [libdefaults] @@ -787,6 +992,7 @@ When manually configuring krb5.conf, the minimal configurat +Heimdal When using Heimdal versions before 0.6, use the following configuration settings: [libdefaults] @@ -805,6 +1011,7 @@ When using Heimdal versions before 0.6, use the following configuration settings +KDC kinit Test your config by doing a kinit USERNAME@REALM and @@ -812,6 +1019,10 @@ making sure that your password is accepted by the Win2000 KDC. +Heimdal +ADS +KDC +Windows 2003 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 Administrator after installation. At the @@ -821,42 +1032,58 @@ in a state of flux. +realm +uppercase +KDC The 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!). -Time 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 is more than five minutes. +synchronize +credentials +time difference +clock skew +Time 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. +clock skew +Kerberos +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. +DNS +KDC +hostname +realm +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 -/etc/hosts entry mapping the IP address of your KDC to -its NetBIOS name. If you do not get this correct, then you will get a -local error when you try to join the realm. +/etc/hosts +KDC +realm +The easiest way to ensure you get this right is to add a /etc/hosts entry mapping the IP +address of your KDC to its NetBIOS name. If you do not get this correct, then you will get a local +error when you try to join the realm. -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;. +Kerberos +Create the Computer Account +Testing Server Setup + +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;.
@@ -865,28 +1092,49 @@ are needed only if you want Kerberos support for &smbd; and &winbindd;. Create the Computer Account +write permission +Samba private directory +Administrator account +ADS As a user who has write permission on the Samba private directory (usually root), run: &rootprompt; net ads join -U Administrator%password +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). +ADS +machine trust account +organizational unit +ADS manager +kinit +netadsjoin When making a Windows client a member of an ADS domain within a complex organization, you -may want to create the machine account within a particular organizational unit. Samba-3 permits +may want to create the machine trust account within a particular organizational unit. Samba-3 permits this to be done using the following syntax: &rootprompt; kinit Administrator@your.kerberos.REALM &rootprompt; net ads join "organizational_unit" +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 account in a container called Servers +organizational directory +machine trust account +container +ADS +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: &rootprompt; net ads join "Computers\BusinessUnit\Department\Servers" +This command will place the Samba server machine trust account in the container +Computers\BusinessUnit\Department\Servers. The container should exist in the ADS directory +before executing this command. @@ -895,18 +1143,28 @@ under the organizational directory Computers\BusinessUnit\Department, ADS support not compiled in - Samba must be reconfigured (remove config.cache) and recompiled - (make clean all install) after the Kerberos libraries and headers files are installed. + + config.cache + Kerberos + headers files + Samba must be reconfigured (remove config.cache) and recompiled (make clean all install) after the + Kerberos libraries and headers files are installed. net ads join prompts for user name - You need to log in to the domain using kinit + + kinit + rights + You need to log in to the domain using kinit USERNAME@REALM. - USERNAME must be a user who has rights to add a machine - to the domain. + USERNAME must be a user who has rights to add a machine to the domain. +
Unsupported encryption/or checksum types + /etc/krb5.conf + unsupported encryption + Kerberos Make sure that the /etc/krb5.conf is correctly configured for the type and version of Kerberos installed on the system. @@ -921,12 +1179,18 @@ under the organizational directory Computers\BusinessUnit\Department,Testing Server Setup +successful join +computer account +ADS 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. +Windows 2000 +netuse +DES-CBC-MD5 On a Windows 2000 client, try net use * \\server\share. You should be logged in with Kerberos without needing to know a password. If this fails, then run klist tickets. Did you get a ticket for the server? Does it have @@ -934,6 +1198,9 @@ an encryption type of DES-CBC-MD5? +DES-CBC-MD5 +ARCFOUR-HMAC-MD5 +encoding Samba can use both DES-CBC-MD5 encryption as well as ARCFOUR-HMAC-MD5 encoding. @@ -942,10 +1209,11 @@ Samba can use both DES-CBC-MD5 encryption as well as ARCFOUR-HMAC-MD5 encoding. Testing with &smbclient; - smbclient -On your Samba server try to log in to a Win2000 server or your Samba +Kerberos +Kerberos authentication +On your Samba server try to log in to a Windows 2000 server or your Samba server using &smbclient; and Kerberos. Use &smbclient; as usual, but specify the option to choose Kerberos authentication. @@ -956,13 +1224,19 @@ specify the option to choose Kerberos authentication. Notes +administrator password +change password +encryption types You must change the administrator password at least once after installing a domain controller, to create the right encryption types. -Windows 200x does not seem to create the _kerberos._udp and _ldap._tcp in -the default DNS setup. Perhaps this will be fixed later in service packs. +_kerberos._udp +_ldap._tcp +default DNS setup +Windows 200x does not seem to create the _kerberos._udp and +_ldap._tcp in the default DNS setup. Perhaps this will be fixed later in service packs. @@ -972,31 +1246,50 @@ the default DNS setup. Perhaps this will be fixed later in service packs. Sharing User ID Mappings between Samba Domain Members +maps UNIX users and groups +UID +GID +SID 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 idmap subsystem of Samba. +mappings +CIFS +NFS 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 ldap idmap suffix, set: + +LDAP +ldap idmap suffix +To use the LDAP ldap idmap suffix, set: + ou=Idmap,dc=quenya,dc=org -See the &smb.conf; man page entry for the -parameter for further information. + +See the &smb.conf; man page entry for the +parameter for further information. + +smbpasswd +LDAP administrative password +secrets.tdb Do not forget to specify also the and to make certain to set the LDAP administrative password into the secrets.tdb using: &rootprompt; smbpasswd -w ldap-admin-password - + +In place of ldap-admin-password, substitute the LDAP administration password for your +system. +
@@ -1004,7 +1297,9 @@ and to make certain to set the LDAP administrative password into the s Common Errors -In the process of adding/deleting/re-adding domain member machine accounts, there are +domain member +machine trust accounts +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 @@ -1017,16 +1312,24 @@ networking functions, it is easy to overcome. Cannot Add Machine Back to Domain -A Windows workstation was reinstalled. The original domain machine +machine trust account +already exists +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 &smbmdash; I know it does not. Why is this failing? +NetBIOS name cache +nbtstat 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. +the old account and then add the machine with a new name. Alternately, the name cache can be flished and +reloaded with current data using the nbtstat command on the Windows client: + +&dosprompt; nbtstat -R +
@@ -1035,12 +1338,15 @@ the old account and then add the machine with a new name. Adding Machine to Domain Fails +PDC +fails 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? +check logs You should check that there is an in your &smb.conf; file. If there is not, please add one that is appropriate for your OS platform. If a script has been defined, you will need to debug its operation. Increase the @@ -1054,19 +1360,27 @@ Possible causes include: +script +path specified The script does not actually exist, or could not be located in the path specified. +UNIX system account +Samba SAM account Corrective action: Fix it. Make sure when run manually that the script will add both the UNIX system account and the Samba SAM account. +UNIX system account +/etc/passwd The machine could not be added to the UNIX system accounts file /etc/passwd. +legal UNIX system account name +uppercase Corrective action: Check that the machine name is a legal UNIX system account name. If the UNIX utility useradd is called, then make sure that the machine name you are trying to add can be added using this @@ -1076,6 +1390,9 @@ Possible causes include: +backend database +UNIX system account +Samba backend database The 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. @@ -1086,9 +1403,19 @@ account to which the Samba backend database account can be mapped. I Can't Join a Windows 2003 PDC - Windows 2003 requires SMB signing. Client-side SMB signing has been implemented in Samba-3.0. + +SMB signing +SMB +Windows 2003 +SMB/CIFS + Windows 2003 requires SMB signing. Client-side SMB signing has been implemented in Samba-3.0. Set yes when communicating - with a Windows 2003 server. + 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-know fall-back facility + that is built into the SMB/CIFS protocols. + + diff --git a/docs/Samba3-HOWTO/TOSHARG-TheNetCommand.xml b/docs/Samba3-HOWTO/TOSHARG-TheNetCommand.xml index 7231bdaf21c..3856e5744a1 100644 --- a/docs/Samba3-HOWTO/TOSHARG-TheNetCommand.xml +++ b/docs/Samba3-HOWTO/TOSHARG-TheNetCommand.xml @@ -890,7 +890,7 @@ Deleted user account. The volume of information is extensive. Please refer to the book Samba-3 by Example, Chapter 7 for more information regarding its use. This book may be obtained either in print or online from -the Samba-Guide. +the Samba-3 by Example. -- 2.11.4.GIT