Fix a small but annoying cut-n-pasteo with the net groupmap modify exampled.
[metze/samba/wip.git] / docs / Samba-HOWTO-Collection / NT4Migration.xml
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3                 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
4   <!ENTITY % global_entities SYSTEM '../entities/global.entities'>
5   %global_entities;
6 ]>
7 <chapter id="NT4Migration">
8 <chapterinfo>
9         &author.jht;
10         <pubdate>April 3, 2003</pubdate>
11 </chapterinfo>
12
13 <title>Migration from NT4 PDC to Samba-3 PDC</title>
14
15 <para>
16 This is a rough guide to assist those wishing to migrate from NT4 Domain Control to
17 Samba-3-based Domain Control.
18 </para>
19
20 <sect1>
21 <title>Planning and Getting Started</title>
22
23 <para>
24 In the IT world there is often a saying that all problems are encountered because of
25 poor planning. The corollary to this saying is that not all problems can be anticipated
26 and planned for. Then again, good planning will anticipate most show-stopper-type situations.
27 </para>
28
29 <para>
30 Those wishing to migrate from MS Windows NT4 Domain Control to a Samba-3 Domain Control
31 environment would do well to develop a detailed migration plan. So here are a few pointers to
32 help migration get under way.
33 </para>
34
35 <sect2>
36 <title>Objectives</title>
37
38 <para>
39 The key objective for most organizations will be to make the migration from MS Windows NT4 
40 to Samba-3 Domain Control as painless as possible. One of the challenges you may experience
41 in your migration process may well be one of convincing management that the new environment
42 should remain in place. Many who have introduced open source technologies have experienced
43 pressure to return to a Microsoft-based platform solution at the first sign of trouble. 
44 </para>
45
46 <para>
47 Before attempting a migration to a Samba-3 controlled network, make every possible effort to
48 gain all-round commitment to the change. Know precisely <emphasis>why</emphasis> the change
49 is important for the organization. Possible motivations to make a change include:
50 </para>
51
52 <itemizedlist>
53     <listitem><para>Improve network manageability.</para></listitem>
54     <listitem><para>Obtain better user level functionality.</para></listitem>
55     <listitem><para>Reduce network operating costs.</para></listitem>
56     <listitem><para>Reduce exposure caused by Microsoft withdrawal of NT4 support.</para></listitem>
57     <listitem><para>Avoid MS License 6 implications.</para></listitem>
58     <listitem><para>Reduce organization's dependency on Microsoft.</para></listitem>
59 </itemizedlist>
60
61 <para>
62 Make sure everyone knows that Samba-3 is not MS Windows NT4. Samba-3 offers
63 an alternative solution that is both different from MS Windows NT4 and offers 
64 advantages compared with it. Gain recognition that Samba-3 lacks many of the
65 features that Microsoft has promoted as core values in migration from MS Windows NT4 to 
66 MS Windows 2000 and beyond (with or without Active Directory services).
67 </para>
68
69 <para>
70 What are the features that Samba-3 cannot provide?
71 </para>
72
73 <itemizedlist>
74         <listitem><para>Active Directory Server.</para></listitem>
75         <listitem><para>Group Policy Objects (in Active Directory).</para></listitem>
76         <listitem><para>Machine Policy Objects.</para></listitem>
77         <listitem><para>Logon Scripts in Active Directory.</para></listitem>
78         <listitem><para>Software Application and Access Controls in Active Directory.</para></listitem>
79 </itemizedlist>
80
81 <para>
82 The features that Samba-3 does provide and that may be of compelling interest to your site
83 include:
84 </para>
85
86 <itemizedlist>
87         <listitem><para>Lower cost of ownership.</para></listitem>
88         <listitem><para>Global availability of support with no strings attached.</para></listitem>
89         <listitem><para>Dynamic SMB Servers (can run more than one SMB/CIFS server per UNIX/Linux system).</para></listitem>
90         <listitem><para>Creation of on-the-fly logon scripts.</para></listitem>
91         <listitem><para>Creation of on-the-fly Policy Files.</para></listitem>
92         <listitem><para>Greater stability, reliability, performance and availability.</para></listitem>
93         <listitem><para>Manageability via an ssh connection.</para></listitem>
94         <listitem><para>Flexible choices of back-end authentication technologies (tdbsam, ldapsam, mysqlsam).</para></listitem>
95         <listitem><para>Ability to implement a full single-sign-on architecture.</para></listitem>
96         <listitem><para>Ability to distribute authentication systems for absolute minimum wide area network bandwidth demand.</para></listitem>
97 </itemizedlist>
98
99 <para>
100 Before migrating a network from MS Windows NT4 to Samba-3, consider all necessary factors. Users
101 should be educated about changes they may experience so the change will be a welcome one
102 and not become an obstacle to the work they need to do. The following are factors that will 
103 help ensure a successful migration:
104 </para>
105
106 <sect3>
107 <title>Domain Layout</title>
108
109 <para>
110 Samba-3 can be configured as a Domain Controller, a back-up Domain Controller (probably best called
111 a secondary controller), a Domain Member, or as a stand-alone Server. The Windows network security
112 domain context should be sized and scoped before implementation. Particular attention needs to be
113 paid to the location of the primary Domain Controller (PDC) as well as backup controllers (BDCs).
114 One way in which Samba-3 differs from Microsoft technology is that if one chooses to use an LDAP
115 authentication backend, then the same database can be used by several different domains. In a
116 complex organization, there can be a single LDAP database, which itself can be distributed (have
117 a master server and multiple slave servers) that can simultaneously serve multiple domains.
118 </para>
119
120 <para>
121 From a design perspective, the number of users per server as well as the number of servers per
122 domain should be scaled taking into consideration server capacity and network bandwidth.
123 </para>
124
125 <para>
126 A physical network segment may house several domains. Each may span multiple network segments.
127 Where domains span routed network segments, consider and test the performance implications of
128 the design and layout of a network. A centrally located Domain Controller that is designed to
129 serve multiple routed network segments may result in severe performance problems. Check the
130 response time (ping timing) between the remote segment and the PDC. If
131 it's long (more than 100 ms),
132 locate a backup controller (BDC) on the remote segment to serve as the local authentication and
133 access control server.
134 </para>
135 </sect3>
136
137 <sect3>
138 <title>Server Share and Directory Layout</title>
139
140 <para>
141 There are cardinal rules to effective network design that cannot be broken with impunity.
142 The most important rule: Simplicity is king in every well-controlled network. Every part of
143 the infrastructure must be managed; the more complex it is, the greater will be the demand
144 of keeping systems secure and functional.
145 </para>
146
147 <para>
148 Keep in mind the nature of how data must be shared. Physical disk space layout should be considered
149 carefully. Some data must be backed up. The simpler the disk layout the easier it will be to
150 keep track of backup needs. Identify what backup media will meet your needs; consider backup to tape,
151 CD-ROM or (DVD-ROM), or other offline storage medium. Plan and implement for minimum
152 maintenance. Leave nothing to chance in your design; above all, do not leave backups to chance:
153 Backup, test, and validate every backup, create a disaster recovery plan and prove that it works.
154 </para>
155
156 <para>
157 Users should be grouped according to data access control needs. File and directory access 
158 is best controlled via group permissions and the use of the <quote>sticky bit</quote> on group controlled
159 directories may substantially avoid file access complaints from Samba share users.
160 </para>
161
162 <para>
163 Inexperienced  network administrators often attempt elaborate techniques to set access
164 controls on files, directories, shares, as well as in share definitions.
165 Keep your design and implementation simple and document your design extensively. Have others
166 audit your documentation. Do not create a complex mess that your successor will not understand.
167 Remember, job security through complex design and implementation may cause loss of operations
168 and downtime to users as the new administrator learns to untangle your knots. Keep access
169 controls simple and effective and make sure that users will never be interrupted by obtuse
170 complexity.
171 </para>
172 </sect3>
173
174 <sect3>
175 <title>Logon Scripts</title>
176
177 <para>
178 Logon scripts can help to ensure that all users gain the share and printer connections they need.
179 </para>
180
181 <para>
182 Logon scripts can be created on-the-fly so all commands executed are specific to the
183 rights and privileges granted to the user. The preferred controls should be affected through
184 group membership so group information can be used to create a custom logon script using
185 the <smbconfoption><name>root preexec</name></smbconfoption> parameters to the <smbconfsection>NETLOGON</smbconfsection> share.
186 </para>
187
188 <para>
189 Some sites prefer to use a tool such as <command>kixstart</command> to establish a controlled
190 user environment. In any case, you may wish to do a Google search for logon script process controls.
191 In particular, you may wish to explore the use of the Microsoft Knowledge Base article KB189105 that
192 deals with how to add printers without user intervention via the logon script process.
193 </para>
194 </sect3>
195
196 <sect3>
197 <title>Profile Migration/Creation</title>
198
199 <para>
200 User and Group Profiles may be migrated using the tools described in the section titled Desktop Profile
201 Management.
202 </para>
203
204
205 <para>
206 <indexterm><primary>SID</primary></indexterm>
207 Profiles may also be managed using the Samba-3 tool <command>profiles</command>. This tool allows
208 the MS Windows NT-style security identifiers (SIDs) that are stored inside the profile <filename>NTuser.DAT</filename> file
209 to be changed to the SID of the Samba-3 domain.
210 </para>
211 </sect3>
212
213 <sect3>
214 <title>User and Group Accounts</title>
215
216 <para>
217 It is possible to migrate all account settings from an MS Windows NT4 domain to Samba-3. Before
218 attempting to migrate user and group accounts, it is STRONGLY advised to create in Samba-3 the
219 groups that are present on the MS Windows NT4 domain <emphasis>AND</emphasis> to map them to
220 suitable UNIX/Linux groups. By following this simple advice, all user and group attributes
221 should migrate painlessly.
222 </para>
223 </sect3>
224
225 </sect2>
226
227 <sect2>
228 <title>Steps in Migration Process</title>
229
230 <para>
231 The approximate migration process is described below.
232 </para>
233
234 <itemizedlist>
235 <listitem><para>
236 You have an NT4 PDC that has the users, groups, policies and profiles to be migrated.
237 </para></listitem>
238
239 <listitem><para>
240 Samba-3 set up as a DC with netlogon share, profile share, and so on. Configure the &smb.conf; file
241 to function as a BDC, i.e., <parameter>domain master = No</parameter>.
242 </para></listitem>
243 </itemizedlist>
244
245 <procedure><title>The Account Migration Process</title>
246         <step><para>
247 <indexterm><primary>pdbedit</primary></indexterm>
248                         Create a BDC account in the old NT4 domain for the Samba server using NT Server Manager.</para>
249                 <substeps><step><para>Samba must not be running.</para></step></substeps></step>
250
251
252         <step><para>
253 <indexterm><primary>net</primary><secondary>rpc</secondary></indexterm>
254                         <userinput>net rpc join -S <replaceable>NT4PDC</replaceable> -w <replaceable>DOMNAME</replaceable> -U Administrator%<replaceable>passwd</replaceable></userinput></para></step>
255
256         <step><para><userinput>net rpc vampire -S <replaceable>NT4PDC</replaceable> -U administrator%<replaceable>passwd</replaceable></userinput></para></step>
257
258         <step><para><userinput>pdbedit -L</userinput></para>
259                 <substeps><step><para>Note &smbmdash; did the users migrate?</para></step></substeps>
260         </step>
261
262
263         <step><para>
264 <indexterm><primary>net</primary><secondary>groupmap</secondary></indexterm>
265 <indexterm><primary>initGroups.sh</primary></indexterm>
266         Now assign each of the UNIX groups to NT groups:
267         (It may be useful to copy this text to a script called <filename>initGroups.sh</filename>)
268         <smbfile name="initGroups.sh">
269         <programlisting>
270 #!/bin/bash
271 #### Keep this as a shell script for future re-use
272                         
273 # First assign well known domain global groups
274 net groupmap modify ntgroup="Domain Admins" unixgroup=root
275 net groupmap modify ntgroup="Domain Users"  unixgroup=users
276 net groupmap modify ntgroup="Domain Guests" unixgroup=nobody
277
278 # Now for our added domain global groups
279 net groupmap add ntgroup="Designers" unixgroup=designers type=d rid=3200
280 net groupmap add ntgroup="Engineers" unixgroup=engineers type=d rid=3210
281 net groupmap add ntgroup="QA Team"   unixgroup=qateam    type=d rid=3220
282 </programlisting>
283 </smbfile>
284         </para></step>
285
286         <step><para><userinput>net groupmap list</userinput></para>
287                 <substeps><step><para>Check that all groups are recognized.</para></step></substeps>
288         </step>
289 </procedure>
290
291 <para>
292 Migrate all the profiles, then migrate all policy files.
293 </para>
294
295 </sect2>
296 </sect1>
297
298 <sect1>
299 <title>Migration Options</title>
300
301 <para>
302 Sites that wish to migrate from MS Windows NT4 Domain Control to a Samba-based solution
303 generally fit into three basic categories. <link linkend="majtypes">Following table</link> shows the possibilities.
304 </para>
305
306 <table frame="all" id="majtypes"><title>The Three Major Site Types</title>
307 <tgroup cols="2">
308         <colspec align="left"/>
309         <colspec align="justify" colspec="1*"/>
310         <thead>
311         <row><entry>Number of Users</entry><entry>Description</entry></row>
312         </thead>
313         <tbody>
314         <row><entry>&lt; 50</entry><entry><para>Want simple conversion with no pain.</para></entry></row>
315         <row><entry>50 - 250</entry><entry><para>Want new features, can manage some in-house complexity.</para></entry></row>
316         <row><entry>&gt; 250</entry><entry><para>Solution/Implementation must scale well, complex needs. Cross-departmental decision process. Local expertise in most areas.</para></entry></row>
317         </tbody>
318 </tgroup>
319 </table>
320
321 <sect2>
322 <title>Planning for Success</title>
323
324 <para>
325 There are three basic choices for sites that intend to migrate from MS Windows NT4
326 to Samba-3:
327 </para>
328
329 <itemizedlist>
330         <listitem><para>
331         Simple conversion (total replacement).
332         </para></listitem>
333
334         <listitem><para>
335         Upgraded conversion (could be one of integration).
336         </para></listitem>
337
338         <listitem><para>
339         Complete redesign (completely new solution).
340         </para></listitem>
341 </itemizedlist>
342
343 <para>
344 Minimize down-stream problems by:
345 </para>
346
347 <itemizedlist>
348         <listitem><para>
349         Taking sufficient time.
350         </para></listitem>
351
352         <listitem><para>
353         Avoiding Panic.
354         </para></listitem>
355
356         <listitem><para>
357         Testing all assumptions.
358         </para></listitem>
359
360         <listitem><para>
361         Testing the full roll-out program, including workstation deployment.
362         </para></listitem>
363 </itemizedlist>
364
365 <para><link linkend="natconchoices">Following table</link> lists the conversion choices given the type of migration
366 being contemplated.
367 </para>
368
369 <table frame="all" id="natconchoices"><title>Nature of the Conversion Choices</title>
370 <tgroup cols="3">
371         <colspec align="justify" colwidth="1*"/>
372         <colspec align="justify" colwidth="1*"/>
373         <colspec align="justify" colwidth="1*"/>
374         <thead>
375         <row><entry>Simple</entry><entry>Upgraded</entry><entry>Redesign</entry></row>
376         </thead>
377         <tbody>
378         <row>
379         <entry><para>Make use of minimal OS specific features.</para></entry>
380         <entry><para>Translate NT4 features to new host OS features.</para></entry>
381         <entry><para>Decide:</para></entry>
382         </row>
383         <row>
384         <entry><para>Move all accounts from NT4 into Samba-3</para></entry>
385         <entry><para>Copy and improve</para></entry>
386         <entry><para>Authentication regime (database location and access)</para></entry>
387         </row>
388         <row>
389         <entry><para>Make least number of operational changes</para></entry>
390         <entry><para>Make progressive improvements</para></entry>
391         <entry><para>Desktop management methods</para></entry>
392         </row>
393         <row>
394         <entry><para>Take least amount of time to migrate</para></entry>
395         <entry><para>Minimize user impact</para></entry>
396         <entry><para>Better control of Desktops/Users</para></entry>
397         </row>
398         <row>
399         <entry><para>Live versus isolated conversion</para></entry>
400         <entry><para>Maximize functionality</para></entry>
401         <entry><para>Identify Needs for: <emphasis>Manageability, Scalability, Security, Availability</emphasis></para></entry>
402         </row>
403         <row>
404         <entry><para>Integrate Samba-3 then migrate while users are active, then change of control (swap out)</para></entry>
405         <entry><para>Take advantage of lower maintenance opportunity</para></entry>
406         <entry><para></para></entry>
407         </row>
408         </tbody>
409 </tgroup>
410 </table>
411 </sect2>
412
413 <sect2>
414 <title>Samba-3 Implementation Choices</title>
415
416 <variablelist>
417         <varlistentry><term>Authentication Database/Backend</term><listitem>
418                 <para>
419                 Samba-3 can use an external authentication backend:
420                 </para>
421
422                 <para>
423                 <itemizedlist>
424                         <listitem><para>Winbind (external Samba or NT4/200x server).</para></listitem>
425                         <listitem><para>External server could use Active Directory or NT4 Domain.</para></listitem>
426                         <listitem><para>Can use pam_mkhomedir.so to auto-create home dirs.</para></listitem>
427                         <listitem><para>
428                                         Samba-3 can use a local authentication backend: <parameter>smbpasswd, tdbsam, ldapsam, mysqlsam</parameter></para></listitem>
429         </itemizedlist>
430                 </para>
431         </listitem></varlistentry>
432
433         <varlistentry><term>Access Control Points</term><listitem>
434                 <para>
435                 Samba permits Access Control Points to be set:
436                 </para>
437                 <itemizedlist>
438                         <listitem><para>On the share itself &smbmdash; using Share ACLs.</para></listitem>
439                         <listitem><para>On the file system &smbmdash; using UNIX permissions on files and directories.</para>
440                                 <para>Note: Can enable Posix ACLs in file system also.</para></listitem>
441                         <listitem><para>Through Samba share parameters &smbmdash; not recommended except as last resort.</para></listitem>
442                 </itemizedlist>
443                 </listitem>
444         </varlistentry>
445
446         <varlistentry><term>Policies (migrate or create new ones)</term><listitem>
447                 <para>
448                 Exercise great caution when affecting registry changes, use the right tool and be aware
449                 that changes made through NT4-style <filename>NTConfig.POL</filename> files can leave
450                 permanent changes.
451                 </para>
452                 <itemizedlist>
453                         <listitem><para>Using Group Policy Editor (NT4).</para></listitem>
454                         <listitem><para>Watch out for Tattoo effect.</para></listitem>
455                 </itemizedlist>
456                 </listitem>
457         </varlistentry>
458
459         <varlistentry><term>User and Group Profiles</term><listitem>
460                 <para>
461                 Platform-specific so use platform tool to change from a Local to a Roaming profile.
462                 Can use new profiles tool to change SIDs (<filename>NTUser.DAT</filename>).
463                 </para>
464                 </listitem>
465         </varlistentry>
466
467         <varlistentry><term>Logon Scripts</term><listitem>
468                 <para>
469                 Know how they work.
470                 </para>
471                 </listitem>
472         </varlistentry>
473
474
475         <varlistentry><term>User and Group Mapping to UNIX/Linux</term><listitem>
476                 <para>
477 <indexterm><primary>pdbedit</primary></indexterm>
478                 User and Group mapping code is new. Many problems have been experienced as network administrators
479                 who are familiar with Samba-2.2.x migrate to Samba-3. Carefully study the chapters that document
480                 the new password backend behavior and the new group mapping functionality.
481                 </para>
482                 <itemizedlist>
483                         <listitem><para>The <parameter>username map</parameter> facility may be needed.</para></listitem>
484                         <listitem><para>Use <command>net groupmap</command> to connect NT4 groups to UNIX groups.</para></listitem>
485                         <listitem><para>Use <command>pdbedit</command> to set/change user configuration.</para>
486
487                                 <para>
488                                 When migrating to LDAP backend, it may be easier to dump the initial
489                                 LDAP database to LDIF, edit, then reload into LDAP.
490                                 </para>
491                         </listitem>
492                 </itemizedlist>
493                 </listitem>
494         </varlistentry>
495
496         <varlistentry><term>OS Specific Scripts/Programs may be Needed</term><listitem>
497                 <para>
498                 Every operating system has its peculiarities. These are the result of engineering decisions
499                 that were based on the experience of the designer, and may have side-effects that were not
500                 anticipated. Limitations that may bite the Windows network administrator include:
501                 </para>
502                 <itemizedlist>
503                         <listitem><para>Add/Delete Users: Note OS limits on size of name
504                                 (Linux 8 chars) NT4 up to 254 chars.</para></listitem>
505                         <listitem><para>Add/Delete Machines: Applied only to Domain Members
506                                 (Note: machine names may be limited to 16 characters).</para></listitem>
507                         <listitem><para>Use <command>net groupmap</command> to connect NT4 groups to UNIX groups.</para></listitem>
508                         <listitem><para>Add/Delete Groups: Note OS limits on size and nature.
509                                 Linux limit is 16 char, no spaces and no upper case chars (<command>groupadd</command>).</para></listitem>
510                 </itemizedlist>
511                 </listitem>
512         </varlistentry>
513
514         <varlistentry><term>Migration Tools</term><listitem>
515                 <para>
516 <indexterm><primary>pdbedit</primary></indexterm>
517                 Domain Control (NT4 Style) Profiles, Policies, Access Controls, Security
518                 <itemizedlist>
519                         <listitem><para>Samba: <command>net, rpcclient, smbpasswd, pdbedit, profiles.</command></para></listitem>
520                         <listitem><para>Windows: <command>NT4 Domain User Manager, Server Manager (NEXUS)</command></para></listitem>
521                 </itemizedlist>
522                         </para>
523                 </listitem>
524         </varlistentry>
525 </variablelist>
526
527 </sect2>
528
529 </sect1>
530
531 </chapter>