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-ByExample/ drwxr-xr-x |
Viewing file: Select action/file-type: Table of Contents It was a little difficult to select an appropriate title for this chapter. From email messages on the Samba mailing lists it is clear that many people consider the updating and upgrading of Samba to be a migration matter. Others talk about migrating Samba servers when in fact the issue at hand is one of installing a new Samba server to replace an older existing Samba server. There has also been much talk about migration of Samba-3 from an smbpasswd passdb backend to the use of the tdbsam or ldapsam facilities that are new to Samba-3. Clearly, there is not a great deal of clarity in the terminology that various people apply to these modes by which Samba servers are updated. This is further highlighted by an email posting that included the following neat remark:
So in response to the significant request for these situations to be better documented, this chapter has now been added. User contributions and documentation of real-world experiences are a most welcome addition to this chapter. A Windows network administrator explained in an email what changes he was planning to make and followed with the question: “Anyone done this before?” Many of us have upgraded and updated Samba without incident. Others have experienced much pain and user frustration. So it is to be hoped that the notes in this chapter will make a positive difference by assuring that someone will be saved a lot of discomfort. Before anyone commences an upgrade or an update of Samba, the one cardinal rule that must be observed is: Backup all Samba configuration files in case it is necessary to revert to the old version. Even if you do not like this precautionary step, users will punish an administrator who fails to take adequate steps to avoid situations that may inflict lost productivity on them. WarningSamba makes it possible to upgrade and update configuration files, but it is not possible to downgrade the configuration files. Please ensure that all configuration and control files are backed up to permit a down-grade in the rare event that this may be necessary. It is prudent also to backup all data files on the server before attempting to perform a major upgrade. Many administrators have experienced the consequences of failure to take adequate precautions. So what is adequate? That is simple! If data is lost during an upgrade or update and it can not be restored, the precautions taken were inadequate. If a backup was not needed, but was available, caution was on the side of the victor. Someone once said, “It is good to be sorry, but better never to need to be!” These are wise words of advice to those contemplating a Samba upgrade or update.
This is as good a time as any to define the terms
The term While the use of these terms is an exercise in semantics, what needs to be realized is that there are major functional differences between a Samba 2.x release and a Samba 3.0.x release. Such differences may require a significantly different approach to solving the same networking challenge and generally require careful review of the latest documentation to identify precisely how the new installation may need to be modified to preserve prior functionality. There is an old axiom that says, “The greater the volume of the documentation, the greater the risk that noone will read it, but where there is no documentation, noone can read it!” While true, some documentation is an evil necessity. It is hoped that this update to the documentation will avoid both extremes. Before the days of Windows NT and OS/2, every Windows and DOS networking client that used the SMB protocols was an entirely autonomous entity. There was no concept of a security identifier for a machine or a user outside of the username, the machine name, and the workgroup name. In actual fact, these were not security identifiers in the same context as the way that the SID is used since the development of Windows NT 3.10. Versions of Samba prior to 1.9 did not make use of a SID. Instead they make exclusive use of the username that is embedded in the SessionSetUpAndX component of the connection setup process between a Windows client and an SMB/CIFS server.
Around November 1997 support was added to Samba-1.9 to handle the Windows security
RPC-based protocols that implemented support for Samba to store a machine SID. This
information was stored in a file called
Within the lifetime of the early Samba 2.x series, the machine SID information was
relocated into a tdb file called There are two types of SID, those pertaining to the machine itself and the domain to which it may belong, and those pertaining to users and groups within the security context of the local machine, in the case of standalone servers (SAS) and domain member servers (DMS).
When the Samba smbd daemon is first started, if the The SID is the key used by MS Windows networking for all networking operations. This means that when the machine or domain SID changes, all security-encoded objects such as profiles and ACLs may become unusable. NoteIt is of paramount importance that the machine and domain SID be backed up so that in the event of a change of hostname (machine name) or domain name (workgroup) the SID can be restored to its previous value. In Samba-3 on a domain controller (PDC or BDC), the domain name controls the domain SID. On all prior versions the hostname (computer name, or NetBIOS name) controlled the SID. On a standalone server the hostname still controls the SID. The local machine SID can be backed up using this procedure (Samba-3):
The contents of the file SID for domain FRODO is: S-1-5-21-726309263-4128913605-1168186429 This SID can be restored by executing:
Samba 1.9.x stored the machine SID in the the file
Where the
In the course of the Samba 2.0.x series the smbpasswd was modified to
permit the domain SID to be captured to the
The release of the Samba 2.2.x series permitted the SID to be obtained by executing:
from which the SID could be copied to a file and then written to the Samba-2.2.x
Domain security information, which includes the domain SID, can be obtained from Samba-2.2.x systems by executing:
This can also be done with Samba-3 by executing:
It is a very good practice to store this SID information in a safely kept file, just in case it is ever needed at a later date.
Take note that the domain SID is used extensively in Samba. Where LDAP is used for the
When the domain SID has changed, roaming profiles cease to be functional. The recovery
of roaming profiles necessitates resetting of the domain portion of the user SID
that owns the profile. This is encoded in the
Samba uses two methods by which the primary NetBIOS machine name (also known as a computer
name or the hostname) may be determined: If the Many sites have become victims of lost Samba functionality because the UNIX system hostname was changed for one reason or another. Such a change will cause a new machine SID to be generated. If this happens on a domain controller, it will also change the domain SID. These SIDs can be updated (restored) using the procedure outlined previously. Note
Do NOT change the hostname or the
The domain name of a Samba server is identical to the workgroup name and is
set in the Be aware that when the workgroup name is changed, a new SID will be generated. The old domain SID can be reset using the procedure outlined earlier in this chapter. The Samba-Team has maintained a constant default location for all Samba control files throughout the life of the project. People who have produced binary packages of Samba have varied the location of the Samba control files. This has led to some confusion for network administrators.
The Samba 1.9.x
During the life of the Samba 2.x release, the
Samba 2.x introduced the The location at which smbd expects to find all configuration and control files is determined at the time of compilation of Samba. For versions of Samba prior to 3.0, one way to find the expected location of these files is to execute:
Note: The smbd executable may be located in the path
Samba-3 provides a neat new way to track the location of all control files as well as to find the compile-time options used as the Samba package was built. Here is how the dark secrets of the internals of the location of control files within Samba executables can be uncovered:
It is important that both the Samba-2.x had no support for Unicode; instead, all national language character-set support in file names was done using particular locale codepage mapping techniques. Samba-3 supports Unicode in file names, thus providing true internationalization support. Non-English users whose national language character set has special characters and who upgrade naively will find that many files that have the special characters in the file name will see them garbled and jumbled up. This typically happens with umlauts and accents because these characters were particular to the codepage that was in use with Samba-2.x using an 8-bit encoding scheme. Files that are created with Samba-3 will use UTF-8 encoding. Should the file system ever end up with a mix of codepage (unix charset)-encoded file names and UTF-8-encoded file names, the mess will take some effort to set straight. A very helpful tool is available from Bjorn Jacke's convmv work. Convmv is a tool that can be used to convert file and directory names from one encoding method to another. The most common use for this tool is to convert locale-encoded files to UTF-8 Unicode encoding.
The smbldap-tools have been maturing rapidly over the past year. With maturation comes change.
The location of the
The smbldap-tools maintains an entry in the LDAP directory in which it stores the next
values that should be used for UID and GID allocation for POSIX accounts that are created
using this tool. The DIT location of these values has changed recently. The original
Sites that are being upgraded from Samba-2 (or earlier versions) to Samba-3 may experience little difficulty or may require a lot of effort, depending on the complexity of the configuration. Samba-1.9.x upgrades to Samba-3 will generally be simple and straightforward, although no upgrade should be attempted without proper planning and preparation. There are two basic modes of use of Samba versions prior to Samba-3. The first does not use LDAP, the other does. Samba-1.9.x did not provide LDAP support. Samba-2.x could be compiled with LDAP support. Where it is necessary to upgrade an old Samba installation to Samba-3, the following procedure can be followed: Procedure 8.1. Upgrading from a Pre-Samba-3 Version
Samba 2.x servers that were running as a domain controller (PDC) require changes to the configuration of the scripting interface tools that Samba uses to perform OS updates for users, groups, and trust accounts (machines and interdomain). The following parameters are new to Samba-3 and should be correctly configured. Please refer to ??? through ??? in this book for examples of use of the new parameters shown here:
The
Where the
Where the
Samba version 2.x could be compiled for use either with or without LDAP.
The LDAP control settings in the Follow the procedure outlined in ??? to affect a migration of all files to the correct locations. The Samba SAM schema required for Samba-3 is significantly different from that used with Samba 2.x. This means that the LDAP directory must be updated using the procedure outlined in the Samba WHATSNEW.txt file that accompanies all releases of Samba-3. This information is repeated here directly from this file: This is an extract from the Samba-3.0.x WHATSNEW.txt file: ========================================================== Changes in Behavior ------------------- The following issues are known changes in behavior between Samba 2.2 and Samba 3.0 that may affect certain installations of Samba. 1) When operating as a member of a Windows domain, Samba 2.2 would map any users authenticated by the remote DC to the 'guest account' if a uid could not be obtained via the getpwnam() call. Samba 3.0 rejects the connection as NT_STATUS_LOGON_FAILURE. There is no current work around to re-establish the 2.2 behavior. 2) When adding machines to a Samba 2.2 controlled domain, the 'add user script' was used to create the UNIX identity of the machine trust account. Samba 3.0 introduces a new 'add machine script' that must be specified for this purpose. Samba 3.0 will not fall back to using the 'add user script' in the absence of an 'add machine script' ###################################################################### Passdb Backends and Authentication ################################## There have been a few new changes that Samba administrators should be aware of when moving to Samba 3.0. 1) encrypted passwords have been enabled by default in order to inter-operate better with out-of-the-box Windows client installations. This does mean that either (a) a samba account must be created for each user, or (b) 'encrypt passwords = no' must be explicitly defined in smb.conf. 2) Inclusion of new 'security = ads' option for integration with an Active Directory domain using the native Windows Kerberos 5 and LDAP protocols. MIT kerberos 1.3.1 supports the ARCFOUR-HMAC-MD5 encryption type which is necessary for servers on which the administrator password has not been changed, or kerberos-enabled SMB connections to servers that require Kerberos SMB signing. Besides this one difference, either MIT or Heimdal Kerberos distributions are usable by Samba 3.0. Samba 3.0 also includes the possibility of setting up chains of authentication methods (auth methods) and account storage backends (passdb backend). Please refer to the smb.conf(5) man page for details. While both parameters assume sane default values, it is likely that you will need to understand what the values actually mean in order to ensure Samba operates correctly. The recommended passdb backends at this time are * smbpasswd - 2.2 compatible flat file format * tdbsam - attribute rich database intended as an smbpasswd replacement for stand alone servers * ldapsam - attribute rich account storage and retrieval backend utilizing an LDAP directory. * ldapsam_compat - a 2.2 backward compatible LDAP account backend Certain functions of the smbpasswd(8) tool have been split between the new smbpasswd(8) utility, the net(8) tool, and the new pdbedit(8) utility. See the respective man pages for details. ###################################################################### LDAP #### This section outlines the new features affecting Samba / LDAP integration. New Schema ---------- A new object class (sambaSamAccount) has been introduced to replace the old sambaAccount. This change aids us in the renaming of attributes to prevent clashes with attributes from other vendors. There is a conversion script (examples/LDAP/convertSambaAccount) to modify and LDIF file to the new schema. Example: $ ldapsearch .... -b "ou=people,dc=..." > sambaAcct.ldif $ convertSambaAccount --sid=<Domain SID> \ --input=sambaAcct.ldif --output=sambaSamAcct.ldif \ --changetype=[modify|add] The <DOM SID> can be obtained by running 'net getlocalsid <DOMAINNAME>' on the Samba PDC as root. The changetype determines the format of the generated LDIF output--either create new entries or modify existing entries. The old sambaAccount schema may still be used by specifying the "ldapsam_compat" passdb backend. However, the sambaAccount and associated attributes have been moved to the historical section of the schema file and must be uncommented before use if needed. The 2.2 object class declaration for a sambaAccount has not changed in the 3.0 samba.schema file. Other new object classes and their uses include: * sambaDomain - domain information used to allocate rids for users and groups as necessary. The attributes are added in 'ldap suffix' directory entry automatically if an idmap uid/gid range has been set and the 'ldapsam' passdb backend has been selected. * sambaGroupMapping - an object representing the relationship between a posixGroup and a Windows group/SID. These entries are stored in the 'ldap group suffix' and managed by the 'net groupmap' command. * sambaUnixIdPool - created in the 'ldap idmap suffix' entry automatically and contains the next available 'idmap uid' and 'idmap gid' * sambaIdmapEntry - object storing a mapping between a SID and a UNIX uid/gid. These objects are created by the idmap_ldap module as needed. * sambaSidEntry - object representing a SID alone, as a Structural class on which to build the sambaIdmapEntry. New Suffix for Searching ------------------------ The following new smb.conf parameters have been added to aid in directing certain LDAP queries when 'passdb backend = ldapsam://...' has been specified. * ldap suffix - used to search for user and computer accounts * ldap user suffix - used to store user accounts * ldap machine suffix - used to store machine trust accounts * ldap group suffix - location of posixGroup/sambaGroupMapping entries * ldap idmap suffix - location of sambaIdmapEntry objects If an 'ldap suffix' is defined, it will be appended to all of the remaining sub-suffix parameters. In this case, the order of the suffix listings in smb.conf is important. Always place the 'ldap suffix' first in the list. Due to a limitation in Samba's smb.conf parsing, you should not surround the DN's with quotation marks.
The key concern in this section is to deal with the changes that have been affected in Samba-3 between the Samba-3.0.0 release and the current update. Network administrators have expressed concerns over the steps that should be taken to update Samba-3 versions.
The information in ??? would not be necessary if every
person who has ever produced Samba executable (binary) files could agree on
the preferred location of the
Vendors and packagers who produce Samba binary installable packages do not,
as a rule, use the default paths used by the Samba-Team for the location of
the binary files, the The best advice for those lacking in code compilation experience is to use only vendor (or Samba-Team) provided binary packages. The Samba packages that are provided by the Samba-Team are generally built to use file paths that are compatible with the original OS vendor's practices. If you are not sure whether a binary package complies with the OS vendor's practices, it is better to ask the package maintainer via email than to waste much time dealing with the nuances. Alternately, just diagnose the paths specified by the binary files following the procedure outlined above. The guidance in this section deals with updates to an existing Samba-3 server installation.
With the provision that the binary Samba-3 package has been built
with the same path and feature settings as the existing Samba-3
package that is being updated, an update of Samba-3 versions 3.0.0
through 3.0.4 can be updated to 3.0.5 without loss of functionality
and without need to change either the When updating versions of Samba-3 prior to 3.0.6 to 3.0.6 through 3.0.10, it is necessary only to update the LDAP schema (where LDAP is used). Always use the LDAP schema file that is shipped with the latest Samba-3 update.
Samba-3.0.6 introduced the ability to remember the last n number
of passwords a user has used. This information will work only with
the After updating the LDAP schema, do not forget to re-index the LDAP database.
Samba-3.0.8 introduced changes in how the In Samba-3.0.11 a new privileges interface was implemented. Please refer to ??? for information regarding this new feature. It is not necessary to implement the privileges interface, but it is one that has been requested for several years and thus may be of interest at your site.
In Samba-3.0.11 there were some functional changes to the ============ LDAP Changes ============ If "ldap user suffix" or "ldap machine suffix" are defined in smb.conf, all user-accounts must reside below the user suffix, and all machine and inter-domain trust-accounts must be located below the machine suffix. Previous Samba releases would fall back to searching the 'ldap suffix' in some cases.
The two most likely candidates for replacement of a server are domain member servers and domain controllers. Each needs to be handled slightly differently. Replacement of a domain member server should be done using the same procedure as outlined in ???. Usually the new server will be introduced with a temporary name. After the old server data has been migrated to the new server, it is customary that the new server be renamed to that of the old server. This will change its SID and will necessitate rejoining to the domain.
Following a change of hostname (NetBIOS name) it is a good idea on all servers
to shut down the Samba smbd, nmbd, and
winbindd services, delete the
If the old domain member server had local accounts, it is necessary to create
on the new domain member server the same accounts with the same UID and GID
for each account. Where the Where the user accounts for both UNIX and Samba are stored in LDAP, the new target server must be configured to use the nss_ldap tool set. This will automatically ensure that the appropriate user entities are available on the new server. In the past, people who replaced a Windows NT4 domain controller typically installed a new server, created printers and file shares on it, then migrate across all data that was destined to reside on it. The same can of course be done with Samba. From recent mailing list postings it would seem that some administrators have the intent to just replace the old Samba server with a new one with the same name as the old one. In this case, simply follow the same process as for upgrading a Samba 2.x system and do the following:
When replacing a Samba domain controller (PDC or BDC) that uses LDAP, the new server need simply be configured to use the LDAP directory, and for the rest it should just work. The domain SID is obtained from the LDAP directory as part of the first connect to the LDAP directory server.
All Samba servers, other than one that uses LDAP, depend on the tdb files, and
particularly on the Yes, it works. The Windows ADMT tool can be used to migrate Samba accounts to MS Active Directory. There are a few pitfalls to be aware of: Procedure 8.2. Migration to Active Directory
There are some significant benefits of using the ADMT, besides just migrating user accounts. ADMT can be found on the Windows 2003 CD.
|
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0079 ]-- |