File: Samba4-HOWTO.tex

package info (click to toggle)
samba 2%3A3.2.5-4lenny15
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 124,704 kB
  • ctags: 69,181
  • sloc: ansic: 564,153; xml: 219,271; sh: 11,039; perl: 4,458; makefile: 4,301; python: 1,975; cpp: 1,224; exp: 1,147; yacc: 881; awk: 557; csh: 58; sed: 45
file content (753 lines) | stat: -rw-r--r-- 31,235 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
% ------------------------------------------------------------	
% Autogenerated LaTeX file for books	
% ------------------------------------------------------------	
\ifx\pdfoutput\undefined
\documentclass[,letterpaper,11pt,openright,twoside,]{sambadoc}
\else
\documentclass[pdftex,,letterpaper,11pt,openright,twoside,]{sambadoc}
\fi
\label{Samba-HOWTO}\usepackage{ifthen}
% --------------------------------------------
% Check for PDFLaTeX/LaTeX 
% --------------------------------------------
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse % we are not running PDFLaTeX
\else
\pdfoutput=1 % we are running PDFLaTeX
\pdftrue
\fi
% --------------------------------------------
% Load graphicx package with pdf if needed 
% --------------------------------------------
\ifpdf
\usepackage[pdftex]{graphicx}
\pdfcompresslevel=9
\else
\usepackage{graphicx}
\fi

\makeatletter
% redefine the listoffigures and listoftables so that the name of the chapter
% is printed whenever there are figures or tables from that chapter. encourage
% pagebreak prior to the name of the chapter (discourage orphans).
\let\save@@chapter\@chapter
\let\save@@l@figure\l@figure
\let\the@l@figure@leader\relax
\def\@chapter[#1]#2{\save@@chapter[{#1}]{#2}%
\addtocontents{lof}{\protect\def\the@l@figure@leader{\protect\pagebreak[0]\protect\contentsline{chapter}{\protect\numberline{\thechapter}#1}{}{\thepage}}}%
\addtocontents{lot}{\protect\def\the@l@figure@leader{\protect\pagebreak[0]\protect\contentsline{chapter}{\protect\numberline{\thechapter}#1}{}{\thepage}}}%
}
\renewcommand*\l@figure{\the@l@figure@leader\let\the@l@figure@leader\relax\save@@l@figure}
\let\l@table\l@figure
\makeatother
% ---------------------- 
% Most Common Packages   
% ---------------------- 
\usepackage{latexsym}         
\usepackage{enumerate}         
\usepackage{fancybox}      
\usepackage{float}       
\usepackage{ragged2e}       
\usepackage{fancyvrb}         
\makeatletter\@namedef{FV@fontfamily@default}{\def\FV@FontScanPrep{}\def\FV@FontFamily{}}\makeatother
\fvset{obeytabs=true,tabsize=3}
\usepackage{parskip}         
\usepackage{rotating}         
\usepackage{subfigure}         
\usepackage{tabularx}         
\usepackage{url}         
% --------------------------------------------
% Math support                                
% --------------------------------------------
\usepackage{amsmath,amsthm, amsfonts, amssymb, amsxtra,amsopn}
%\newtheorem{thm}{Theorem}[section]
%\newtheorem{cor}[section]{Corollary}
%\newtheorem{lem}[section]{Lemma}
%\newtheorem{defn}[section]{Definition}
%\newtheorem{prop}[section]{Proposition}
%\newtheorem{ax}{Axiom}
%\newtheorem{theorem}[section]{Theorem}
%\newtheorem{corollary}{Corollary}
%\newtheorem{lemma}{Lemma}
%\newtheorem{proposition}{Proposition}
%\theoremstyle{definition}
%\newtheorem{definition}{Definition}
%\theoremstyle{remark}
%\newtheorem{rem}{Remark}
%\newtheorem*{notation}{Notation}
%\newcommand{\ntt}{\normalfont\ttfamily}
%\newcommand{\thmref}[1]{Theorem~\ref{#1}}
%\newcommand{\secref}[1]{\S\ref{#1}}
%\newcommand{\lemref}[1]{Lemma~\ref{#1}}
 \newcommand{\bysame}{\mbox{\rule{3em}{.4pt}}\,}
 \newcommand{\A}{\mathcal{A}}
 \newcommand{\B}{\mathcal{B}}
 \newcommand{\XcY}{{(X,Y)}}
 \newcommand{\SX}{{S_X}}
 \newcommand{\SY}{{S_Y}}
 \newcommand{\SXY}{{S_{X,Y}}}
 \newcommand{\SXgYy}{{S_{X|Y}(y)}}
 \newcommand{\Cw}[1]{{\hat C_#1(X|Y)}}
 \newcommand{\G}{{G(X|Y)}}
 \newcommand{\PY}{{P_{\mathcal{Y}}}}
 \newcommand{\X}{\mathcal{X}}
 \newcommand{\wt}{\widetilde}
 \newcommand{\wh}{\widehat}
 % --------------------------------------------
 %\DeclareMathOperator{\per}{per}
 \DeclareMathOperator{\cov}{cov}
 \DeclareMathOperator{\non}{non}
 \DeclareMathOperator{\cf}{cf}
 \DeclareMathOperator{\add}{add}
 \DeclareMathOperator{\Cham}{Cham}
 \DeclareMathOperator{\IM}{Im}
 \DeclareMathOperator{\esssup}{ess\,sup}
 \DeclareMathOperator{\meas}{meas}
 \DeclareMathOperator{\seg}{seg}
% --------------------------------------------
% --------------------------------------------
% Load hyperref package with pdf if needed 
% --------------------------------------------
\ifpdf
\usepackage[pdftex,bookmarksnumbered,colorlinks,backref,bookmarks,breaklinks,linktocpage,plainpages=false,hyperfigures,hyperindex,citecolor=black,urlcolor=black,filecolor=black,linkcolor=black,menucolor=red,pagecolor=black]{hyperref}
\else
\usepackage[bookmarksnumbered,colorlinks,backref,bookmarks,breaklinks,linktocpage,plainpages=false,]{hyperref}
\fi
% --------------------------------------------
% ----------------------------------------------
% Define a new LaTeX environment (adminipage)
% ----------------------------------------------
\newenvironment{admminipage}%
{ % this code corresponds to the \begin{adminipage} command
 \begin{Sbox}%
 \begin{minipage}%
} %done
{ % this code corresponds to the \end{adminipage} command
 \end{minipage}
 \end{Sbox}
 \fbox{\TheSbox}
} %done
% ----------------------------------------------
% Define a new LaTeX length (admlength)
% ----------------------------------------------
\newlength{\admlength}
% ----------------------------------------------
% Define a new LaTeX environment (admonition)
% With 2 parameters:
% #1 The file (e.g. note.pdf)
% #2 The caption
% ----------------------------------------------
\newenvironment{admonition}[2] 
{ % this code corresponds to the \begin{admonition} command
 \hspace{0mm}\newline\hspace*\fill\newline
 \noindent
 \setlength{\fboxsep}{5pt}
 \setlength{\admlength}{\linewidth}
 \addtolength{\admlength}{-10\fboxsep}
 \addtolength{\admlength}{-10\fboxrule}
 \admminipage{\admlength}
 {\bfseries \sc\large{#2}} \newline
 \\[1mm]
 \sffamily
 \includegraphics[width=1cm]{#1}
 \addtolength{\admlength}{-1cm}
 \addtolength{\admlength}{-20pt}
 \begin{minipage}[lt]{\admlength}
 \parskip=0.5\baselineskip \advance\parskip by 0pt plus 2pt
} %done
{ % this code corresponds to the \end{admonition} command
 \vspace{5mm} 
 \end{minipage}
 \endadmminipage
 \vspace{.5em}
 \par
}
% --------------------------------------------
% Commands to manage/style/create floats      
% figures, tables, algorithms, examples, eqn  
% --------------------------------------------
 \floatstyle{ruled}
 \restylefloat{figure}
 \floatstyle{ruled}
 \restylefloat{table}
 \floatstyle{ruled}
 \newfloat{program}{ht}{lop}[section]
 \floatstyle{ruled}
 \newfloat{example}{ht}{loe}[section]
 \floatname{example}{Example}
 \floatstyle{ruled}
 \newfloat{dbequation}{ht}{loe}[section]
 \makeatletter\def\toclevel@dbequation{0}\makeatother
 \floatname{dbequation}{Equation}
 \floatstyle{boxed}
 \newfloat{algorithm}{ht}{loa}[section]
 \floatname{algorithm}{Algorithm}
\ifpdf
\DeclareGraphicsExtensions{.pdf,.png,.jpg}
\else
\DeclareGraphicsExtensions{.eps}
\fi
% --------------------------------------------
% $latex.caption.swapskip enabled for $formal.title.placement support
\newlength{\docbooktolatextempskip}
\newcommand{\captionswapskip}{\setlength{\docbooktolatextempskip}{\abovecaptionskip}\setlength{\abovecaptionskip}{\belowcaptionskip}\setlength{\belowcaptionskip}{\docbooktolatextempskip}}
% --------------------------------------------
% Better linebreaks
\newcommand{\docbookhyphenatedot}[1]{{\hyphenchar\font=`\.\relax #1\hyphenchar\font=`\-}}
\newcommand{\docbookhyphenatefilename}[1]{{\hyphenchar\font=`\.\relax #1\hyphenchar\font=`\-}}
\newcommand{\docbookhyphenateurl}[1]{{\hyphenchar\font=`\/\relax #1\hyphenchar\font=`\-}}
\usepackage[english]{babel} 
% Guard against a problem with old package versions.
\makeatletter
\AtBeginDocument{
\DeclareRobustCommand\ref{\@refstar}
\DeclareRobustCommand\pageref{\@pagerefstar}
}
\makeatother
% --------------------------------------------
\makeatletter
\newcommand{\dbz}{\penalty \z@}
\newcommand{\docbooktolatexpipe}{\ensuremath{|}\dbz}
\newskip\docbooktolatexoldparskip
\newcommand{\docbooktolatexnoparskip}{\docbooktolatexoldparskip=\parskip\parskip=0pt plus 1pt}
\newcommand{\docbooktolatexrestoreparskip}{\parskip=\docbooktolatexoldparskip}
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else\hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
\usepackage[]{ucs}
\usepackage[utf8]{inputenc}

\ifx\dblatex@chaptersmark\@undefined\def\dblatex@chaptersmark#1{\markboth{\MakeUppercase{#1}}{}}\fi
\let\save@makeschapterhead\@makeschapterhead
\def\dblatex@makeschapterhead#1{\vspace*{-80pt}\save@makeschapterhead{#1}}
\def\@makeschapterhead#1{\dblatex@makeschapterhead{#1}\dblatex@chaptersmark{#1}}

			
\AtBeginDocument{\ifx\refname\@undefined\let\docbooktolatexbibname\bibname\def\docbooktolatexbibnamex{\bibname}\else\let\docbooktolatexbibname\refname\def\docbooktolatexbibnamex{\refname}\fi}
% Facilitate use of \cite with \label
\newcommand{\docbooktolatexbibaux}[2]{%
  \protected@write\@auxout{}{\string\global\string\@namedef{docbooktolatexcite@#1}{#2}}
}
% Provide support for bibliography `subsection' environments with titles
\newenvironment{docbooktolatexbibliography}[3]{
   \begingroup
   \let\save@@chapter\chapter
   \let\save@@section\section
   \let\save@@@mkboth\@mkboth
   \let\save@@bibname\bibname
   \let\save@@refname\refname
   \let\@mkboth\@gobbletwo
   \def\@tempa{#3}
   \def\@tempb{}
   \ifx\@tempa\@tempb
      \let\chapter\@gobbletwo
      \let\section\@gobbletwo
      \let\bibname\relax
   \else
      \let\chapter#2
      \let\section#2
      \let\bibname\@tempa
   \fi
   \let\refname\bibname
   \begin{thebibliography}{#1}
}{
   \end{thebibliography}
   \let\chapter\save@@chapter
   \let\section\save@@section
   \let\@mkboth\save@@@mkboth
   \let\bibname\save@@bibname
   \let\refname\save@@refname
   \endgroup
}

		
			
%\usepackage{cite}
%\renewcommand\citeleft{(}  % parentheses around list
%\renewcommand\citeright{)} % parentheses around list
\newcommand{\docbooktolatexcite}[2]{%
  \@ifundefined{docbooktolatexcite@#1}%
  {\cite{#1}}%
  {\def\@docbooktolatextemp{#2}\ifx\@docbooktolatextemp\@empty%
   \cite{\@nameuse{docbooktolatexcite@#1}}%
   \else\cite[#2]{\@nameuse{docbooktolatexcite@#1}}%
   \fi%
  }%
}
\newcommand{\docbooktolatexbackcite}[1]{%
  \ifx\Hy@backout\@undefined\else%
    \@ifundefined{docbooktolatexcite@#1}{%
      % emit warning?
    }{%
      \ifBR@verbose%
        \PackageInfo{backref}{back cite \string`#1\string' as \string`\@nameuse{docbooktolatexcite@#1}\string'}%
      \fi%
      \Hy@backout{\@nameuse{docbooktolatexcite@#1}}%
    }%
  \fi%
}

		
			
% --------------------------------------------
% A way to honour <footnoteref>s
% Blame j-devenish (at) users.sourceforge.net
% In any other LaTeX context, this would probably go into a style file.
\newcommand{\docbooktolatexusefootnoteref}[1]{\@ifundefined{@fn@label@#1}%
  {\hbox{\@textsuperscript{\normalfont ?}}%
    \@latex@warning{Footnote label `#1' was not defined}}%
  {\@nameuse{@fn@label@#1}}}
\newcommand{\docbooktolatexmakefootnoteref}[1]{%
  \protected@write\@auxout{}%
    {\global\string\@namedef{@fn@label@#1}{\@makefnmark}}%
  \@namedef{@fn@label@#1}{\hbox{\@textsuperscript{\normalfont ?}}}%
  }

		
			
% index labeling helper
\newif\ifdocbooktolatexprintindex\docbooktolatexprintindextrue
\let\dbtolatex@@theindex\theindex
\let\dbtolatex@@endtheindex\endtheindex
\def\theindex{\relax}
\def\endtheindex{\relax}
\newenvironment{dbtolatexindex}[1]
   {
\if@openright\cleardoublepage\else\clearpage\fi
\let\dbtolatex@@indexname\indexname
\def\dbtolatex@indexlabel{%
 \ifnum \c@secnumdepth >\m@ne \refstepcounter{chapter}\fi%
 \label{#1}\hypertarget{#1}{\dbtolatex@@indexname}%
 \global\docbooktolatexprintindexfalse}
\def\indexname{\ifdocbooktolatexprintindex\dbtolatex@indexlabel\else\dbtolatex@@indexname\fi}
\dbtolatex@@theindex
   }
   {
\dbtolatex@@endtheindex\let\indexname\dbtolatex@@indexname
   }

\newlength\saveparskip \newlength\saveparindent
\newlength\tempparskip \newlength\tempparindent

		
\def\docbooktolatexgobble{\expandafter\@gobble}
% Prevent multiple openings of the same aux file
% (happens when backref is used with multiple bibliography environments)
\ifx\AfterBeginDocument\undefined\let\AfterBeginDocument\AtBeginDocument\fi
\AfterBeginDocument{
   \let\latex@@starttoc\@starttoc
   \def\@starttoc#1{%
      \@ifundefined{docbooktolatex@aux#1}{%
         \global\@namedef{docbooktolatex@aux#1}{}%
         \latex@@starttoc{#1}%
      }{}
   }
}
% --------------------------------------------
% Hacks for honouring row/entry/@align
% (\hspace not effective when in paragraph mode)
% Naming convention for these macros is:
% 'docbooktolatex' 'align' {alignment-type} {position-within-entry}
% where r = right, l = left, c = centre
\newcommand{\docbooktolatex@align}[2]{\protect\ifvmode#1\else\ifx\LT@@tabarray\@undefined#2\else#1\fi\fi}
\newcommand{\docbooktolatexalignll}{\docbooktolatex@align{\raggedright}{}}
\newcommand{\docbooktolatexalignlr}{\docbooktolatex@align{}{\hspace*\fill}}
\newcommand{\docbooktolatexaligncl}{\docbooktolatex@align{\centering}{\hfill}}
\newcommand{\docbooktolatexaligncr}{\docbooktolatex@align{}{\hspace*\fill}}
\newcommand{\docbooktolatexalignrl}{\protect\ifvmode\raggedleft\else\hfill\fi}
\newcommand{\docbooktolatexalignrr}{}
\ifx\captionswapskip\@undefined\newcommand{\captionswapskip}{}\fi
\makeatother
\title{\bfseries The Official Samba-4 HOWTO}
\author{Jelmer R. Vernooij}
% --------------------------------------------
\makeindex
\makeglossary
% --------------------------------------------

\setcounter{tocdepth}{4}

\setcounter{secnumdepth}{4}
\begin{document}
{\maketitle\pagestyle{plain}
\thispagestyle{empty}}
\setcounter{page}{5} % -------------------------------------------------------------
% Preface 
% -------------------------------------------------------------
\chapter*{Attribution}%
\label{id2406721}\hypertarget{id2406721}{}%

% -------------------------------------------------------------
% Preface 
% -------------------------------------------------------------
\chapter*{Attribution}%
\label{id2438514}\hypertarget{id2438514}{}%

\cleardoublepage 
\docbooktolatexnoparskip

\makeatletter
\def\dbtolatex@contentsid{id2408201}
\let\dbtolatex@@contentsname\contentsname
\newif\ifdocbooktolatexcontentsname\docbooktolatexcontentsnametrue
\def\dbtolatex@contentslabel{%
 \label{\dbtolatex@contentsid}\hypertarget{\dbtolatex@contentsid}{\dbtolatex@@contentsname}%
 \global\docbooktolatexcontentsnamefalse}
\def\contentsname{\ifdocbooktolatexcontentsname\dbtolatex@contentslabel\else\dbtolatex@@contentsname\fi}
\tableofcontents
\let\contentsname\dbtolatex@@contentsname
\Hy@writebookmark{}{\dbtolatex@@contentsname}{\dbtolatex@contentsid}{0}{toc}%
\makeatother
				\docbooktolatexrestoreparskip
\cleardoublepage % ------------------------------------------------------------- 
% 
% PART Introduction to SMB networks
% 
% ------------------------------------------------------------- 
\part{Introduction to SMB networks}
\label{id2408206}\hypertarget{id2408206}{}%

Not everybody is already familiar with SMB networks and the jargon used in such networks. This part describes the evolution of SMB, how the protocol is structured and what Samba can be used for.

NT admins, already familiar with SMB networks, are probably only interested in the chapter about Samba itself.

% -------------------------------------------------------------
% Chapter The SMB/CIFS protocol 
% ------------------------------------------------------------- 	
\chapter{The SMB/CIFS protocol}
\label{protocol}\hypertarget{protocol}{}%

"SMB" (also known as "CIFS") is a file-sharing protocol that has been used since the mid-eighties. Most people know SMB as the protocol behind the "Network Neighbourhood" and remote printing in Windows.

Several parts of the protocol are not discussed in this chapter, such as mailslots, browsing and dfs, to prevent it from getting too complex. CIFS internals are documented in detail in \docbooktolatexcite{Hertel, 2003}{}.

% ------------------------   
% Section 
\section{History}
\label{id2408693}\hypertarget{id2408693}{}%
\subsection{Invention by IBM}
\label{id2408700}\hypertarget{id2408700}{}%

SMB is not very old, but it has a long history of modifications and extensions. The original protocol was meant to run over ``NetBIOS'', which was the name of the DOS interface to a very simple LAN system developed by IBM. NetBIOS was developed because SNA, IBM's other main protocol at the time, was much too advanced for use in DOS.

The NetBIOS API in these days (early eighties) was nothing more then the interface to a very simple link-layer protocol over which several protocols, including SMB, were used. It could do reads and writes to services on remote hosts, which were identified by case-insensitive names, and discover all available hosts and services.

Dr. Barry Feigenbau, an IBM employee, invented the core of the original SMB protocol, which he initially named after himself: ``BAF''. He later changed the name to be ``SMB'' (for ``Server Message Block''). Every packet in the protocol starts with a byte \$0xFF\$ and these three letters.

IBM, Microsoft, 3Com and Intel made up the rest of the initial protocol together. The commands the protocol supported at this stage were basically a mirror of the DOS File IO API calls, which meant the protocol wasn't very efficient. The protocol also lacked authentication support. Everybody on the network could do reads and writes, which meant this protocol wasn't very suitable for large enterprises.

NetBIOS is an API that has had various implementations; there is NetBIOS over TCP/IP (NBT), NetBIOS over IPX, NetBIOS over SNA and even NetBIOS over DECNEt. Mostly used these days is NetBIOS over TCP (NBT).

This is also were things are starting to get hairy. Since NetBIOS identifies hosts by their name, NetBIOS clients had to start doing IP broadcasts to figure out the IP of the host they had to connect to. Several schemes were introduced to do name lookups crossing subnet boundaries, using name servers, etc. We're basically emulating a NetBIOS LAN in order to be able to run SMB.

Doing NetBIOS over IP is not very sane, however, the NBT implementation itself in Windows isn't very nice either. It has horrible limits, special exceptions, several broken schemes for looking up names (including two kinds of name servers). NetBIOS and NetBIOS over TCP/IP are described in RFC1001 and RFC1002.
\subsection{The various incarnations of SMB}
\label{id2408773}\hypertarget{id2408773}{}%

Over the years, several usage models for SMB have been developed. While SMB originally started out as a file sharing protocol, it was later extended to include support for network management and other network services as well.

One of the reasons for the various "upgrades" of the SMB protocol is the fact that networks have become larger and larger and with them the need for privilege separation and scalability has increased.
\subsubsection{DOS}
\label{id2483569}\hypertarget{id2483569}{}%

The original model in which SMB was used was as a simple file-sharing service in a NetBIOS-environment.

File sharing worked basically by specifying a list of directories that had to be shared and what name they had to be shared under ("shares"). Eventually, one could password-protect a share. At most one password per share could be set.
\subsubsection{Windows For Workgroups}
\label{id2483590}\hypertarget{id2483590}{}%

After the ``CORE'' dialect, IBM and Microsoft implemented a new dialect known as ``LANMAN''. This dialect was used by Windows for Workgroups, OS/2 and Windows 9x which all know it under a different name. A 'virtual' file system was also added, which was used for doing remote function calls (RAP, for ``Remote Administration Protocol'').

Computers are grouped into "Workgroups" in this model. Everybody is equal to the others and there is no central point of control.
\subsubsection{Windows NT}
\label{id2483613}\hypertarget{id2483613}{}%

For Windows NT, yet another dialect was added, named 'NT'. The NT dialect had it's own set of file I/O functions (similar to the NT File I/O API) and it had support for yet another way of doing remote function calls: DCE/RPC. RPC's are used for DCOM and several of the subsystems in NT that can be accessed remotely (registry, printing, user management, logging on, etc).

Windows NT works with a new concept for grouping computers called ``domains''\label{id2483633}\begingroup\catcode`\#=12\footnote{In the protocol, domains are actually an upgraded version of a workgroup}\endgroup\docbooktolatexmakefootnoteref{id2483633}. Each computer is member of exactly one domain. There are several roles a computer can have in the domain: PDC (primary domain controller, the "manager" of the domain, that coordinates all authentication and authorization), BDC (Backup domain controller, in case the PDC goes down) or just a regular domain member. The PDC decides who is to be a member of the domain.
\subsubsection{Windows 2000}
\label{id2483647}\hypertarget{id2483647}{}%

In Windows NT 5 (marketing name: Windows 2000), NetBIOS-less SMB was introduced. This means SMB is used directly over TCP port 445 instead of via NetBIOS over TCP/IP. DNS is used for looking up machine names.

Windows 2000 was also the first operating system from Microsoft that had support for Active Directory. Active Directory is very similar to the "domain" concept used by NT4, though it is implemented differently (using modified open protocols), and has some additional features (one of the most important ones being decentralized).

Active directory no longer uses a central point of authority and there are fewer limits to the size of a domain. Several DC's can exist, so there is no longer a single point of failure as well as better scalability.
\subsection{Samba versions and their support for the SMB models}
\label{id2483680}\hypertarget{id2483680}{}%
\subsubsection{Samba 2.2}
\label{id2483686}\hypertarget{id2483686}{}%

Full CORE and Workgroup support. Somewhat basic NT4-style support.
\subsubsection{Samba 3.0}
\label{id2483698}\hypertarget{id2483698}{}%

Full CORE and Workgroup support. Almost complete NT4-style support.
\subsubsection{Samba 3.2}
\label{id2406536}\hypertarget{id2406536}{}%

FIXME
\subsubsection{Samba 4.0}
\label{id2406548}\hypertarget{id2406548}{}%

Full CORE, Workgroup, NT4 and ADS support.

% -------------------------------------------------------------
% Chapter Samba 
% ------------------------------------------------------------- 	
\chapter{Samba}
\label{samba}\hypertarget{samba}{}%

Samba is an Open Source application that provides an SMB implementation for POSIX-compatible operating systems.

Providing support for a Windows-based file-sharing protocol on POSIX servers sometimes requires mapping Windows semantics to POSIX semantics.

Samba has always been catching up with Microsoft. Here is a list of Samba releases and what they support (or will support).

% ------------------------   
% Section 
\section{Samba 2.2}
\label{id2408671}\hypertarget{id2408671}{}%

Full CORE and Workgroup support. Somewhat basic NT4-style support.

% ------------------------   
% Section 
\section{Samba 3.0}
\label{id2483530}\hypertarget{id2483530}{}%

Full CORE and Workgroup support. Almost complete NT4-style support.

% ------------------------   
% Section 
\section{Samba 3.2}
\label{id2483542}\hypertarget{id2483542}{}%

FIXME

% ------------------------   
% Section 
\section{Samba 4.0}
\label{id2483553}\hypertarget{id2483553}{}%

Full CORE, Workgroup, NT4 and ADS support.
% ------------------------------------------------------------- 
% 
% PART Samba 4 Basics
% 
% ------------------------------------------------------------- 
\part{Samba 4 Basics}
\label{id2408487}\hypertarget{id2408487}{}%

FIXME

% -------------------------------------------------------------
% Chapter Configuration 
% ------------------------------------------------------------- 	
\chapter{Configuration}
\label{config}\hypertarget{config}{}%

Chapter describing Samba's configuration in detail.

% -------------------------------------------------------------
% Chapter chapter 
% ------------------------------------------------------------- 	
\chapter{chapter}
\label{ldb}\hypertarget{ldb}{}%
% ------------------------------------------------------------- 
% 
% PART Network model
% 
% ------------------------------------------------------------- 
\part{Network model}
\label{id2408505}\hypertarget{id2408505}{}%

A SMB server is used in a certain network type (workgroup, domain, active directory) with a specific role (stand-alone, primary domain controller, backup domain controller, etc) in that network. Samba has to be configured according to that role. Each of the chapters in this part describes how to configure Samba for a specific role.
% ------------------------------------------------------------- 
% 
% PART Network Model: Share-based security
% 
% ------------------------------------------------------------- 
\part{Network Model: Share-based security}
\label{id2408521}\hypertarget{id2408521}{}%

% -------------------------------------------------------------
% Chapter Share-based stand-alone server 
% ------------------------------------------------------------- 	
\chapter{Share-based stand-alone server}
\label{security=share}\hypertarget{security=share}{}%

One of the simplest
% ------------------------------------------------------------- 
% 
% PART Network Model: User-based security
% 
% ------------------------------------------------------------- 
\part{Network Model: User-based security}
\label{id2408532}\hypertarget{id2408532}{}%

% -------------------------------------------------------------
% Chapter User-based Stand-alone server 
% ------------------------------------------------------------- 	
\chapter{User-based Stand-alone server}
\label{security=user}\hypertarget{security=user}{}%


% ------------------------------------------------------------- 
% 
% PART Network Model: NT4-style domains
% 
% ------------------------------------------------------------- 
\part{Network Model: NT4-style domains}
\label{domain}\hypertarget{domain}{}%

% -------------------------------------------------------------
% Chapter chapter 
% ------------------------------------------------------------- 	
\chapter{chapter}
\label{domain-pdc}\hypertarget{domain-pdc}{}%

% -------------------------------------------------------------
% Chapter Backup Domain Controller 
% ------------------------------------------------------------- 	
\chapter{Backup Domain Controller}
\label{bdc}\hypertarget{bdc}{}%

% -------------------------------------------------------------
% Chapter chapter 
% ------------------------------------------------------------- 	
\chapter{chapter}
\label{domain-member}\hypertarget{domain-member}{}%
% ------------------------------------------------------------- 
% 
% PART Network Model - Active Directory
% 
% ------------------------------------------------------------- 
\part{Network Model - Active Directory}
\label{ad}\hypertarget{ad}{}%

% -------------------------------------------------------------
% Chapter Active Directory - Domain Controller 
% ------------------------------------------------------------- 	
\chapter{Active Directory - Domain Controller}
\label{ad-dc}\hypertarget{ad-dc}{}%

% -------------------------------------------------------------
% Chapter Active Directory - Member 
% ------------------------------------------------------------- 	
\chapter{Active Directory - Member}
\label{ad-member}\hypertarget{ad-member}{}%
% ------------------------------------------------------------- 
% 
% PART Common services
% 
% ------------------------------------------------------------- 
\part{Common services}
\label{id2408582}\hypertarget{id2408582}{}%

Independent of the role the server has, it can provide services. Examples of services are printing, user management, authentication, etc.

% -------------------------------------------------------------
% Chapter chapter 
% ------------------------------------------------------------- 	
\chapter{chapter}
\label{shares}\hypertarget{shares}{}%

% -------------------------------------------------------------
% Chapter Printing 
% ------------------------------------------------------------- 	
\chapter{Printing}
\label{printing}\hypertarget{printing}{}%

% ------------------------   
% Section 
\section{Unix printing types}
\label{unix}\hypertarget{unix}{}%

% -------------------------------------------------------------
% Chapter Authentication 
% ------------------------------------------------------------- 	
\chapter{Authentication}
\label{authentication}\hypertarget{authentication}{}%

% -------------------------------------------------------------
% Chapter Registry 
% ------------------------------------------------------------- 	
\chapter{Registry}
\label{registry}\hypertarget{registry}{}%
% ------------------------------------------------------------- 
% 
% PART Clients
% 
% ------------------------------------------------------------- 
\part{Clients}
\label{id2408613}\hypertarget{id2408613}{}%

Samba includes a number of different clients for accessing SMB file, print and other services. Pretty much every service can be access using a command-line utility, though there are several GUI clients available as well.

% -------------------------------------------------------------
% Chapter smbclient 
% ------------------------------------------------------------- 	
\chapter{smbclient}
\label{smbclient}\hypertarget{smbclient}{}%

% -------------------------------------------------------------
% Chapter CIFSFS 
% ------------------------------------------------------------- 	
\chapter{CIFSFS}
\label{cifsfs}\hypertarget{cifsfs}{}%

% -------------------------------------------------------------
% Chapter chapter 
% ------------------------------------------------------------- 	
\chapter{chapter}
\label{gui-clients}\hypertarget{gui-clients}{}%
% ------------------------------------------------------------- 
% 
% PART Appendices
% 
% ------------------------------------------------------------- 
\part{Appendices}
\label{id2408640}\hypertarget{id2408640}{}%

% -------------------------------------------------------------
% Chapter Compiling 
% ------------------------------------------------------------- 	
\chapter{Compiling}
\label{compiling}\hypertarget{compiling}{}%

% ------------------------   
% Section 
\section{Downloading the source - Tar Ball}
\label{id2455874}\hypertarget{id2455874}{}%

% ------------------------   
% Section 
\section{Downloading the source - Subversion}
\label{id2455882}\hypertarget{id2455882}{}%

% ------------------------   
% Section 
\section{Compiling the source}
\label{id2483446}\hypertarget{id2483446}{}%

% ------------------------   
% Section 
\section{Installing}
\label{id2483454}\hypertarget{id2483454}{}%
\docbooktolatexnoparskip
\listoffigures
\listoftables
\docbooktolatexrestoreparskip
\include{gpl}\chaptermark{Subject index} \setlength\saveparskip\parskip
\setlength\saveparindent\parindent
\begin{dbtolatexindex}{id2408661}
\setlength\tempparskip\parskip \setlength\tempparindent\parindent
\parskip\saveparskip \parindent\saveparindent
\noindent \indexspace
\parskip\tempparskip
\parindent\tempparindent
\makeatletter\@input@{\jobname.ind}\makeatother
\end{dbtolatexindex}

\end{document}