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
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
|
<html>
<body bgcolor="#ffffff">
<img src="samba2_xs.gif" border="0" alt=" " height="100" width="76"
hspace="10" align="left" />
<h1 class="head0">Chapter 1. Learning the Samba</h1>
<p><a name="INDEX-1"/>Samba
is an extremely useful networking tool for anyone who has both
Windows and Unix systems on his network. Running on a Unix system, it
allows Windows to share files and printers on the Unix host, and it
also allows Unix users to access resources shared by Windows systems.</p>
<p>Although it might seem natural to use a Windows server to serve files
and printers to a network containing Windows clients, there are good
reasons for preferring a Samba server for this duty. Samba is
reliable software that runs on reliable Unix operating systems,
resulting in fewer problems and a low cost of maintenance. Samba also
offers better performance under heavy loads, outperforming Windows
2000 Server by a factor of 2 to 1 on identical PC hardware, according
to published third-party benchmarks. When common, inexpensive PC
hardware fails to meet the demands of a huge client load, the Samba
server can easily be moved to a proprietary "big
iron" Unix mainframe, which can outperform Windows
running on a PC many times. If all that weren't
enough, Samba has a very nice cost advantage: it's
free. Not only is the software itself freely available, but also no
client licenses are required, and it runs on high-quality, free
operating systems such as Linux and FreeBSD.</p>
<p>After reading the previous paragraph, you might come to the
conclusion that Samba is commonly used by large organizations with
thousands of users on their networks—and you'd
be right! But Samba's user base includes
organizations all over the planet, of all types and sizes: from
international corporations, to medium and small businesses, to
individuals who run Samba on their Linux laptops. In the last case, a
tool such as VMware is used to run Windows on the same computer, with
Samba enabling the two operating systems to share files.</p>
<p>The types of users vary even more—Samba is used by
corporations, banks and other financial institutions, government and
military organizations, schools, public libraries, art galleries,
families, and even authors! This book was developed on a Linux system
running VMware and Windows 2000, with Adobe FrameMaker running on
Windows and the document files served by Samba from the Linux
filesystem.</p>
<p>Does all this whet your technological appetite? If so, we encourage
you to keep reading, learn about Samba, and follow our examples to
set up a Samba server of your own. In this and upcoming chapters, we
will tell you exactly how to get started.</p>
<div class="sect1"><a name="samba2-CHP-1-SECT-1"/>
<h2 class="head1">What Is Samba?</h2>
<p><a name="INDEX-2"/>Samba
is a suite of Unix applications that speak the
<a name="INDEX-3"/><a name="INDEX-4"/>Server
Message Block (SMB) protocol. Microsoft Windows operating systems and
the OS/2 operating system use SMB to perform client-server networking
for file and printer sharing and associated operations. By supporting
this protocol, Samba enables computers running Unix to get in on the
action, communicating with the same networking protocol as Microsoft
Windows and appearing as another Windows system on the network from
the perspective of a Windows client. A <a name="INDEX-5"/>Samba
server offers the following services:</p>
<ul><li>
<p>Share one or more directory trees</p>
</li><li>
<p>Share one or more Distributed filesystem (Dfs) trees</p>
</li><li>
<p>Share printers installed on the server among Windows clients on the
network</p>
</li><li>
<p>Assist clients with network browsing</p>
</li><li>
<p>Authenticate clients logging onto a Windows domain</p>
</li><li>
<p>Provide or assist with Windows Internet Name Service (WINS)
name-server resolution</p>
</li></ul>
<p>The Samba suite also includes client tools that allow users on a Unix
system to access folders and printers that Windows systems and Samba
servers offer on the network.</p>
<p>Samba is the brainchild of Andrew <a name="INDEX-6"/>Tridgell, who currently heads the Samba
development team. Andrew started the project in 1991, while working
with a Digital Equipment Corporation (DEC) software suite called
Pathworks, created for connecting DEC VAX computers to computers made
by other companies. Without knowing the significance of what he was
doing, Andrew created a file-server program for an odd protocol that
was part of Pathworks. That protocol later turned out to be SMB. A
few years later, he expanded upon his custom-made SMB server and
began distributing it as a product on the Internet under the name
"SMB Server." However, Andrew
couldn't keep that name—it already belonged to
another company's product—so he tried the
following Unix renaming approach:</p>
<blockquote><pre class="code">$ <tt class="userinput"><b>grep -i '^s.*m.*b' /usr/dict/words</b></tt></pre></blockquote>
<p>And the response was:</p>
<blockquote><pre class="code">salmonberry
samba
sawtimber
scramble</pre></blockquote>
<p>Thus, the name "Samba" was born.</p>
<p>Today, the Samba suite revolves around a pair of Unix daemons that
provide shared resources—called <em class="firstterm">shares
</em>or s<em class="firstterm">ervices</em>—to SMB clients
on the network. These are:</p>
<dl>
<dt><b><a name="INDEX-7"/>smbd</b></dt>
<dd>
<p>A daemon that handles file and printer sharing and provides
authentication and authorization for SMB clients.</p>
</dd>
<dt><b><a name="INDEX-8"/>nmbd</b></dt>
<dd>
<p>A daemon that supports NetBIOS Name Service and WINS, which is
Microsoft's implementation of a NetBIOS Name Server
(NBNS). It also assists with network browsing.</p>
</dd>
</dl>
<p>Samba is currently maintained and extended by a group of volunteers
under the active supervision of Andrew Tridgell. Like the Linux
operating system, Samba is distributed as open source software
(<a href="http://opensource.org">http://opensource.org</a>) by its
authors and is distributed under the GNU General Public License
(GPL). Since its inception, development of Samba has been sponsored
in part by the Australian National University, where Andrew Tridgell
earned his Ph.D. Since then, many other organizations have sponsored
Samba developers, including LinuxCare, VA Linux Systems,
Hewlett-Packard, and IBM. It is a true testament to Samba that both
commercial and noncommercial entities are prepared to spend money to
support an open source effort.</p>
<p>Microsoft has also contributed by offering its definition of the SMB
protocol to the Internet Engineering Task Force (IETF) in 1996 as the
<a name="INDEX-9"/><a name="INDEX-10"/>Common
Internet File System (CIFS). Although we prefer to use the term
"SMB" in this book, you will also
often find the protocol being referred to as
"CIFS." This is especially true on
Microsoft's web site.</p>
</div>
<div class="sect1"><a name="samba2-CHP-1-SECT-2"/>
<h2 class="head1">What Can Samba Do for Me?</h2>
<p><a name="INDEX-11"/>As explained earlier, Samba can help
Windows and Unix computers coexist in the same network. However,
there are some specific reasons why you might want to set up a Samba
server on your network:</p>
<ul><li>
<p>You don't want to pay for—or
can't afford—a full-fledged Windows server,
yet you still need the functionality that one provides.</p>
</li><li>
<p>The Client Access Licenses (CALs) that Microsoft requires for each
Windows client to access a Windows server are unaffordable.</p>
</li><li>
<p>You want to provide a common area for data or user directories to
transition from a Windows server to a Unix one, or vice versa.</p>
</li><li>
<p>You want to share printers among Windows and Unix workstations.</p>
</li><li>
<p>You are supporting a group of computer users who have a mixture of
Windows and Unix computers.</p>
</li><li>
<p>You want to integrate Unix and Windows authentication, maintaining a
single database of user accounts that works with both systems.</p>
</li><li>
<p>You want to network Unix, Windows, Macintosh (OS X), and other
systems using a single protocol.</p>
</li></ul>
<p>Let's take a quick tour of
<a name="INDEX-12"/>Samba in action. Assume that we have
the following basic network configuration: a Samba-enabled Unix
system, to which we will assign the name <tt class="literal">toltec</tt>,
and a pair of Windows clients, to which we will assign the names
<tt class="literal">maya</tt> and <tt class="literal">aztec</tt>, all connected
via a local area network (LAN). Let's also assume
that <tt class="literal">toltec</tt> also has a local inkjet printer
connected to it, <tt class="literal">lp</tt>, and a disk share named
<tt class="literal">spirit</tt>—both of which it can offer to the
other two computers. A graphic of this network is shown in <a href="ch01.html#samba2-CHP-1-FIG-1">Figure 1-1</a>.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-1"/><img src="figs/sam2_0101.gif"/></div><h4 class="head4">Figure 1-1. A simple network set up with a Samba server</h4>
<p>In this network, each computer listed shares the same
<em class="firstterm">workgroup</em>. A workgroup is a group name tag
that identifies an arbitrary collection of computers and their
resources on an SMB network. Several workgroups can be on the network
at any time, but for our basic network example,
we'll have only one: the METRAN workgroup.</p>
<div class="sect2"><a name="samba2-CHP-1-SECT-2.1"/>
<h3 class="head2">Sharing a Disk Service</h3>
<p><a name="INDEX-13"/><a name="INDEX-14"/><a name="INDEX-15"/>If everything is properly
configured, we should be able to see the Samba server,
<tt class="literal">toltec</tt>, through the Network Neighborhood of the
<tt class="literal">maya</tt> Windows desktop. In fact, <a href="ch01.html#samba2-CHP-1-FIG-2">Figure 1-2</a> shows the Network Neighborhood of the
<tt class="literal">maya</tt> computer, including <tt class="literal">toltec</tt>
and each computer that resides in the METRAN workgroup. Note the
Entire Network icon at the top of the list. As we just mentioned,
more than one workgroup can be on an SMB network at any given time.
If a user clicks the Entire Network icon, she will see a list of all
the workgroups that currently exist on the network.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-2"/><img src="figs/sam2_0102.gif"/></div><h4 class="head4">Figure 1-2. The Network Neighborhood directory</h4>
<p>We can take a closer look at the <tt class="literal">toltec</tt> server by
double-clicking its icon. This contacts <tt class="literal">toltec</tt>
itself and requests a list of its
<em class="firstterm">shares</em>—the file and printer
resources—that the computer provides. In this case, a printer
named <tt class="literal">lp</tt>, a home directory named
<tt class="literal">jay</tt>, and a disk share named
<tt class="literal">spirit</tt> are on the server, as shown in <a href="ch01.html#samba2-CHP-1-FIG-3">Figure 1-3</a>. Note that the Windows display shows hostnames
in mixed case (Toltec). Case is irrelevant in hostnames, so you might
see toltec, Toltec, and TOLTEC in various displays or command output,
but they all refer to a single system. Thanks to Samba, Windows 98
sees the Unix server as a valid SMB server and can access the
<tt class="literal">spirit</tt> folder as if it were just another system
folder.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-3"/><img src="figs/sam2_0103.gif"/></div><h4 class="head4">Figure 1-3. Shares available on the Toltec server as viewed from maya</h4>
<p>One popular Windows feature is the ability to map a drive letter
(such as E:, F:, or Z:) to a shared directory on the network using
the Map Network Drive option in Windows Explorer.<a name="FNPTR-1"/><a href="#FOOTNOTE-1">[1]</a>
Once you do so, your applications can access the folder across the
network using the drive letter. You can store data on it, install and
run programs from it, and even password-protect it against unwanted
visitors. See <a href="ch01.html#samba2-CHP-1-FIG-4">Figure 1-4</a> for an example of mapping
a <a name="INDEX-16"/><a name="INDEX-17"/>drive letter to a network
directory.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-4"/><img src="figs/sam2_0104.gif"/></div><h4 class="head4">Figure 1-4. Mapping a network drive to a Windows drive letter</h4>
<p>Take a look at the Path: entry in the dialog box of <a href="ch01.html#samba2-CHP-1-FIG-4">Figure 1-4</a>. An equivalent way to represent a directory on
a network computer is by using two backslashes, followed by the name
of the networked computer, another backslash, and the networked
directory of the computer, as shown here:</p>
<blockquote><pre class="code">\\<em class="replaceable">network-computer</em>\<em class="replaceable">directory</em></pre></blockquote>
<p>This is known as the <em class="firstterm"/><a name="INDEX-18"/>Universal
Naming Convention (UNC)</em> in the Windows world. For example, the dialog
box in <a href="ch01.html#samba2-CHP-1-FIG-4">Figure 1-4</a> represents the network directory
on the <tt class="literal">toltec</tt> server as:</p>
<blockquote><pre class="code">\\toltec\spirit</pre></blockquote>
<p>If this looks somewhat familiar to you, you're
probably thinking of <em class="firstterm">uniform resource
locators</em><a name="INDEX-19"/><a name="INDEX-20"/> (URLs), which are addresses that web
browsers such as Netscape Navigator and Internet Explorer use to
resolve systems across the Internet. Be sure not to confuse the two:
URLs such as <a href="http://www.oreilly.com">http://www.oreilly.com</a> use forward slashes
instead of backslashes, and they precede the initial slashes with the
data transfer protocol (i.e., ftp, http) and a colon (:). In reality,
URLs and UNCs are two completely separate things, although sometimes
you can specify an SMB share using a URL rather than a UNC. As a URL,
the <em class="filename">\\toltec\spirit</em> share would be specified as
<em class="filename">smb://toltec/spirit</em>.</p>
<p>Once the network drive is set up, Windows and its programs behave as
if the networked directory were a local disk. If you have any
applications that support multiuser functionality on a network, you
can install those programs on the network drive.<a name="FNPTR-2"/><a href="#FOOTNOTE-2">[2]</a> <a href="ch01.html#samba2-CHP-1-FIG-5">Figure 1-5</a> shows the
resulting network drive as it would appear with other storage devices
in the Windows 98 client. Note the pipeline attachment in the icon
for the J: drive; this indicates that it is a network drive rather
than a fixed drive.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-5"/><img src="figs/sam2_0105.gif"/></div><h4 class="head4">Figure 1-5. The Network directory mapped to the client drive letter J</h4>
<p>My Network Places, found in Windows Me, 2000, and XP, works
differently from Network Neighborhood. It is necessary to click a few
more icons, but eventually we can get to the view of the
<tt class="literal">toltec</tt> server as shown in <a href="ch01.html#samba2-CHP-1-FIG-6">Figure 1-6</a>. This is from a Windows 2000 system. Setting
up the network drive using the Map Network Drive option in Windows
2000 works similarly to other Windows versions. <a name="INDEX-21"/><a name="INDEX-22"/><a name="INDEX-23"/></p>
<div class="figure"><a name="samba2-CHP-1-FIG-6"/><img src="figs/sam2_0106.gif"/></div><h4 class="head4">Figure 1-6. Shares available on Toltec (viewed from dine)</h4>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-2.2"/>
<h3 class="head2">Sharing a Printer</h3>
<p><a name="INDEX-24"/><a name="INDEX-25"/><a name="INDEX-26"/>You probably noticed that the printer
<tt class="literal">lp</tt> appeared under the available shares for
<tt class="literal">toltec</tt> in <a href="ch01.html#samba2-CHP-1-FIG-3">Figure 1-3</a>. This
indicates that the Unix server has a printer that can be shared by
the various SMB clients in the workgroup. Data sent to the printer
from any of the clients will be spooled on the Unix server and
printed in the order in which it is received.</p>
<p><a name="INDEX-27"/><a name="INDEX-28"/>Setting up a Samba-enabled
printer on the Windows side is even easier than setting up a disk
share. By double-clicking the printer and identifying the
manufacturer and model, you can install a driver for this printer on
the Windows client. Windows can then properly format any information
sent to the network printer and access it as if it were a local
printer. On Windows 98, double-clicking the Printers icon in the
Control Panel opens the Printers window shown in <a href="ch01.html#samba2-CHP-1-FIG-7">Figure 1-7</a>. Again, note the pipeline attachment below the
printer, which identifies it as being on a network.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-7"/><img src="figs/sam2_0107.gif"/></div><h4 class="head4">Figure 1-7. A network printer available on Toltec</h4>
<div class="sect3"><a name="samba2-CHP-1-SECT-2.2.1"/>
<h3 class="head3">Seeing things from the Unix side</h3>
<p><a name="INDEX-29"/><a name="INDEX-30"/>As mentioned earlier, Samba
appears in Unix as a set of daemon programs. You can view them with
the Unix <a name="INDEX-31"/><em class="emphasis">ps</em> command; you can
read any messages they generate through custom debug files or the
Unix <em class="emphasis">syslog</em> (depending on how Samba is set up);
and you can configure them from a single Samba configuration file:
<em class="emphasis">smb.conf</em>. In addition, if you want to get an idea of
what the daemons are doing, Samba has a program called
<em class="emphasis">smbstatus</em><a name="INDEX-32"/> that will lay it all on the line. Here
is how it works:</p>
<blockquote><pre class="code"># <tt class="userinput"><b>smbstatus</b></tt>
Processing section "[homes]"
Processing section "[printers]"
Processing section "[spirit]"
Samba version 2.2.6
Service uid gid pid machine
-----------------------------------------
spirit jay jay 7735 maya (172.16.1.6) Sun Aug 12 12:17:14 2002
spirit jay jay 7779 aztec (172.16.1.2) Sun Aug 12 12:49:11 2002
jay jay jay 7735 maya (172.16.1.6) Sun Aug 12 12:56:19 2002
Locked files:
Pid DenyMode R/W Oplock Name
--------------------------------------------------
7735 DENY_WRITE RDONLY NONE /u/RegClean.exe Sun Aug 12 13:01:22 2002
Share mode memory usage (bytes):
1048368(99%) free + 136(0%) used + 72(0%) overhead = 1048576(100%) total</pre></blockquote>
<p>The Samba status from this output provides three sets of data, each
divided into separate sections. The first section tells which systems
have connected to the Samba server, identifying each client by its
machine name (<tt class="literal">maya</tt> and <tt class="literal">aztec</tt>)
and IP (Internet Protocol) address. The second section reports the
name and status of the files that are currently in use on a share on
the server, including the read/write status and any locks on the
files. Finally, Samba reports the amount of memory it has currently
allocated to the shares that it administers, including the amount
actively used by the shares plus additional overhead. (Note that this
is not the same as the total amount of memory that the
<em class="emphasis">smbd</em> or <em class="emphasis">nmbd</em> processes are
using.)</p>
<p>Don't worry if you don't understand
these statistics; they will become easier to understand as you move
through the book.</p>
</div>
</div>
</div>
<div class="sect1"><a name="samba2-CHP-1-SECT-3"/>
<h2 class="head1">Getting Familiar with an SMB Network</h2>
<p><a name="INDEX-33"/>Now that you have had a brief tour of
Samba, let's take some time to get familiar with
Samba's adopted environment: an SMB network.
Networking with SMB is significantly different from working with
common TCP/IP protocols such as FTP and Telnet because there are
several new concepts to learn and a lot of information to cover.
First, we will discuss the basic concepts behind an SMB network,
followed by some Microsoft implementations of it, and finally we will
show you where a Samba server can and cannot fit into the picture.</p>
<div class="sect2"><a name="samba2-CHP-1-SECT-3.1"/>
<h3 class="head2">Understanding NetBIOS</h3>
<p>To begin, let's step back in time. In 1984, IBM
authored a simple application programming interface (API) for
networking its computers, called the <em class="firstterm">Network Basic
Input/Output System
</em>(<a name="INDEX-34"/>NetBIOS).
The NetBIOS API provided a rudimentary design for an application to
connect and share data with other computers.</p>
<p>It's helpful to think of the NetBIOS API as
networking extensions to the standard BIOS API calls. The BIOS
contains low-level code for performing filesystem operations on the
local computer. NetBIOS originally had to exchange instructions with
computers across IBM PC or Token Ring networks. It therefore required
a low-level transport protocol to carry its requests from one
computer to the next.</p>
<p>In late 1985, IBM released one such protocol, which it merged with
the NetBIOS API to become the <em class="firstterm">NetBIOS Extended User
Interface</em> (<em class="emphasis">NetBEUI</em> ).
<a name="INDEX-35"/>NetBEUI was
designed for small LANs, and it let each computer claim a name (up to
15 characters) that wasn't already in use on the
network. By a "small LAN," we mean
fewer than 255 nodes on the network—which was considered a
generous number in 1985!</p>
<p>The NetBEUI protocol was very popular with networking applications,
including those running under Windows for Workgroups. Later,
implementations of NetBIOS over Novell's IPX
networking protocols also emerged, which competed with NetBEUI.
However, the networking protocols of choice for the burgeoning
Internet community were TCP/IP and UDP/IP, and implementing the
NetBIOS APIs over those protocols soon became a necessity.</p>
<p>Recall that TCP/IP uses numbers to represent computer addresses
(192.168.220.100, for instance) while NetBIOS uses only names. This
was a major issue when trying to mesh the two protocols together. In
1987, the IETF published standardization documents, titled RFC 1001
and 1002, that outlined how NetBIOS would work over a TCP/UDP
network. This set of documents still governs each implementation that
exists today, including those provided by Microsoft with its Windows
operating systems, as well as the Samba suite.</p>
<p>Since then, the standard that this document governs has become known
as <em class="firstterm">NetBIOS over
TCP/IP</em><a name="INDEX-36"/><a name="INDEX-37"/><a name="INDEX-38"/>, or NBT for short.<a name="FNPTR-3"/><a href="#FOOTNOTE-3">[3]</a> </p>
<p>The NBT standard (RFC 1001/1002)
currently outlines a trio of services on a network:</p>
<ul><li>
<p>A name service</p>
</li><li>
<p>Two communication services:</p>
<ul><li>
<p>Datagrams</p>
</li>
<li>
<p>Sessions</p>
</li></ul>
</li>
</ul>
<p>The <a name="INDEX-39"/>name
service solves the name-to-address problem mentioned earlier; it
allows each computer to declare a specific name on the network that
can be translated to a machine-readable IP address, much like
today's Domain Name System (DNS) on the Internet.
The <a name="INDEX-40"/>datagram and <a name="INDEX-41"/>session services are both
secondary communication protocols used to transmit data back and
forth from NetBIOS computers across the network.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-3.2"/>
<h3 class="head2">Getting a Name</h3>
<p><a name="INDEX-42"/><a name="INDEX-43"/>In the NetBIOS world, when each
computer comes online, it wants to claim a name for itself; this is
called <em class="firstterm">name registration</em>. However, no two
computers in the same workgroup should be able to claim the same
name; this would cause endless confusion for any computer that wanted
to communicate with either of them. There are two different
approaches to ensuring that this doesn't happen:</p>
<ul><li>
<p>Use an <em class="firstterm"/>NBNS</em> to keep track of which hosts have
registered a NetBIOS name.</p>
</li><li>
<p>Allow each computer on the network to defend its name in the event
that another computer attempts to use it.</p>
</li></ul>
<p><a href="ch01.html#samba2-CHP-1-FIG-8">Figure 1-8</a> illustrates a (failed) name
registration, with and without an NBNS.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-8"/><img src="figs/sam2_0108.gif"/></div><h4 class="head4">Figure 1-8. Broadcast versus NBNS name registration</h4>
<p><a name="INDEX-44"/><a name="INDEX-45"/>As mentioned earlier,
there must be a way to resolve a NetBIOS name to a specific IP
address; this is known as <em class="firstterm">name resolution</em>.
There are two different approaches with NBT here as well:</p>
<ul><li>
<p>Have each computer report back its IP address when it
"hears" a broadcast request for its
NetBIOS name.</p>
</li><li>
<p>Use an NBNS to help resolve NetBIOS names to IP addresses.</p>
</li></ul>
<p><a href="ch01.html#samba2-CHP-1-FIG-9">Figure 1-9</a> illustrates the two types of name
resolution.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-9"/><img src="figs/sam2_0109.gif"/></div><h4 class="head4">Figure 1-9. Broadcast versus NBNS name resolution</h4>
<p>As you might expect, having an NBNS on your network can help out
tremendously. To see exactly why, let's look at the
broadcast method.</p>
<p>Here, when a client computer boots, it will
<a name="INDEX-46"/>broadcast a
message declaring that it wishes to register a specified NetBIOS name
as its own. If nobody objects to the use of the name, it keeps the
name. On the other hand, if another computer on the local subnet is
currently using the requested name, it will send a message back to
the requesting client that the name is already taken. This is known
as <em class="firstterm">defending</em><a name="INDEX-47"/><a name="INDEX-48"/> the hostname. This type of system
comes in handy when one client has unexpectedly dropped off the
network—another can take its name unchallenged—but it
does incur an inordinate amount of traffic on the network for
something as simple as name registration.</p>
<p>With an NBNS, the same thing occurs, except the communication is
confined to the requesting computer and the NBNS. No broadcasting
occurs when the computer wishes to register the name; the
registration message is simply sent directly from the client to the
NBNS, and the NBNS replies regardless of whether the name is already
taken. This is known as <em class="firstterm">point-to-point
communication</em><a name="INDEX-49"/>, and it is often beneficial on
networks with more than one subnet. This is because routers are
generally configured to block incoming packets that are broadcast to
all computers in the subnet.</p>
<p>The same principles apply to name resolution. Without an NBNS,
NetBIOS name resolution would also be done with a broadcast
mechanism. All request packets would be sent to each computer in the
network, with the hope that one computer that might be affected will
respond directly back to the computer that asked. Using an NBNS and
point-to-point communication for this purpose is far less taxing on
the network than flooding the network with broadcasts for every
name-resolution request.</p>
<p>It can be argued that broadcast packets do not cause significant
problems in modern, high-bandwidth networks of hosts with fast CPUs,
if only a small number of hosts are on the network, or the demand for
bandwidth is low. There are certainly cases where this is true;
however, our advice throughout this book is to avoid relying on
broadcasts as much as possible. This is a good rule to follow for
large, busy networks, and if you follow our advice when configuring a
small network, your network will be able to grow without encountering
problems later on that might be difficult to diagnose. <a name="INDEX-50"/><a name="INDEX-51"/></p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-3.3"/>
<h3 class="head2">Node Types</h3>
<p><a name="INDEX-52"/><a name="INDEX-53"/>How can you tell what strategy each
client on your network will use when performing name registration and
resolution? Each computer on an NBT network earns one of the
following designations, depending on how it handles name registration
and resolution: <a name="INDEX-54"/><a name="INDEX-55"/><a name="INDEX-56"/><a name="INDEX-57"/>b-node, p-node, m-node, and h-node. The
behaviors of each type of node are summarized in <a href="ch01.html#samba2-CHP-1-TABLE-1">Table 1-1</a>.</p>
<a name="samba2-CHP-1-TABLE-1"/><h4 class="head4">Table 1-1. NetBIOS node types</h4><table border="1">
<tr>
<th>
<p>Role</p>
</th>
<th>
<p>Value</p>
</th>
</tr>
<tr>
<td>
<p>b-node</p>
</td>
<td>
<p>Uses broadcast registration and resolution only.</p>
</td>
</tr>
<tr>
<td>
<p>p-node</p>
</td>
<td>
<p>Uses point-to-point registration and resolution only.</p>
</td>
</tr>
<tr>
<td>
<p>m-node (mixed)</p>
</td>
<td>
<p>Uses broadcast for registration. If successful, it notifies the NBNS
of the result. Uses broadcast for resolution; uses the NBNS if
broadcast is unsuccessful.</p>
</td>
</tr>
<tr>
<td>
<p>h-node (hybrid)</p>
</td>
<td>
<p>Uses the NBNS for registration and resolution; uses broadcast if the
NBNS is unresponsive or inoperative.</p>
</td>
</tr>
</table>
<p>In the case of Windows clients, you will usually find them listed as
h-nodes or hybrid nodes. The first three node types appear in RFC
1001/1002, and h-nodes were invented later by Microsoft, as a more
fault-tolerant method.</p>
<p>You can find the node type of a Windows 95/98/Me computer by running
the <em class="emphasis">winipcfg</em><a name="INDEX-58"/><a name="INDEX-59"/> command from the Start
→ Run dialog (or from an MS-DOS prompt) and clicking
the More Info>> button. On Windows NT/2000/XP, you can use the
<tt class="literal">ipconfig</tt><a name="INDEX-60"/><a name="INDEX-61"/><a name="INDEX-62"/><a name="INDEX-63"/>
<tt class="literal">/all</tt> command in a command-prompt window. In either
case, search for the line that says <tt class="literal">Node Type</tt>.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-3.4"/>
<h3 class="head2">What's in a Name?</h3>
<p>The names <a name="INDEX-64"/><a name="INDEX-65"/>NetBIOS uses are quite different
from the DNS hostnames you might be familiar with. First, NetBIOS
names exist in a flat namespace. In other words, there are no
hierarchical levels, such as in <tt class="literal">oreilly.com</tt> (two
levels) or <em class="emphasis">ftp</em><em class="emphasis">.samba.org</em> (three
levels). NetBIOS names consist of a single unique string such as
<tt class="literal">navaho</tt> or <tt class="literal">hopi</tt> within each
workgroup or domain. Second, NetBIOS names are allowed to be only 15
characters and can consist only of standard alphanumeric characters
(a-z, A-Z, 0-9) and the following:</p>
<blockquote><pre class="code">! @ # $ % ^ & ( ) - ' { } . ~</pre></blockquote>
<p>Although you are allowed to use a <a name="INDEX-66"/><a name="INDEX-67"/><a name="INDEX-68"/>period (.) in a NetBIOS name, we recommend
against it because those names are not guaranteed to work in future
versions of NBT.</p>
<p>It's not a coincidence that all valid DNS names are
also valid NetBIOS names. In fact, the unqualified DNS name for a
Samba server is often reused as its NetBIOS name. For example, if you
had a system with a hostname of <tt class="literal">mixtec.ora.com</tt> ,
its NetBIOS name would likely be MIXTEC (followed by 9 spaces).</p>
<div class="sect3"><a name="samba2-CHP-1-SECT-3.4.1"/>
<h3 class="head3">Resource names and types</h3>
<p><a name="INDEX-69"/><a name="INDEX-70"/>With NetBIOS, a computer not
only advertises its presence, but also tells others what types of
services it offers. For example, <tt class="literal">mixtec</tt> can
indicate that it's not just a workstation, but that
it's also a file server and can receive Windows
Messenger messages. This is done by adding a 16th byte to the end of
the machine (resource) name, called the <em class="firstterm">resource
type</em>, and registering the name multiple times, once for
each service that it offers. See <a href="ch01.html#samba2-CHP-1-FIG-10">Figure 1-10</a>.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-10"/><img src="figs/sam2_0110.gif"/></div><h4 class="head4">Figure 1-10. The structure of NetBIOS names</h4>
<p>The 1-byte resource type indicates a unique service that the named
computer provides. In this book, you will often see the resource type
shown in angled brackets (<>) after the NetBIOS name, such as:</p>
<blockquote><pre class="code">MIXTEC<00></pre></blockquote>
<p>You can see which names are registered for a particular NBT computer
using the Windows command-line
<em class="emphasis">nbtstat</em><a name="INDEX-71"/> utility.
Because these services are unique (i.e., there cannot be more than
one registered), you will see them listed as type UNIQUE in the
output. For example, the following partial output describes the
<tt class="literal">toltec</tt> server:</p>
<blockquote><pre class="code">C:\><tt class="userinput"><b>nbtstat -a toltec</b></tt>
NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
TOLTEC <00> UNIQUE Registered
TOLTEC <03> UNIQUE Registered
TOLTEC <20> UNIQUE Registered
...</pre></blockquote>
<p>This says the server has registered the NetBIOS name
<tt class="literal">toltec</tt> as a machine (computer) name, as a
recipient of messages from the Windows Messenger service, and as a
file server. Some possible attributes a name can have are listed in
<a href="ch01.html#samba2-CHP-1-TABLE-2">Table 1-2</a>.</p>
<a name="samba2-CHP-1-TABLE-2"/><h4 class="head4">Table 1-2. NetBIOS unique resource types</h4><table border="1">
<tr>
<th>
<p>Named resource</p>
</th>
<th>
<p>Hexadecimal byte value</p>
</th>
</tr>
<tr>
<td>
<p>Standard Workstation Service</p>
</td>
<td>
<p>00</p>
</td>
</tr>
<tr>
<td>
<p>Messenger Service</p>
</td>
<td>
<p>03</p>
</td>
</tr>
<tr>
<td>
<p>RAS Server Service</p>
</td>
<td>
<p>06</p>
</td>
</tr>
<tr>
<td>
<p>Domain Master Browser Service (associated with primary domain controller)</p>
</td>
<td>
<p>1B</p>
</td>
</tr>
<tr>
<td>
<p>Master Browser name</p>
</td>
<td>
<p>1D</p>
</td>
</tr>
<tr>
<td>
<p>NetDDE Service</p>
</td>
<td>
<p>1F</p>
</td>
</tr>
<tr>
<td>
<p>Fileserver (including printer server)</p>
</td>
<td>
<p>20</p>
</td>
</tr>
<tr>
<td>
<p>RAS Client Service</p>
</td>
<td>
<p>21</p>
</td>
</tr>
<tr>
<td>
<p>Network Monitor Agent</p>
</td>
<td>
<p>BE</p>
</td>
</tr>
<tr>
<td>
<p>Network Monitor Utility</p>
</td>
<td>
<p>BF</p>
</td>
</tr>
</table>
</div>
<div class="sect3"><a name="samba2-CHP-1-SECT-3.4.2"/>
<h3 class="head3">Group names and types</h3>
<p>SMB also uses the concept of groups, with which computers can
register themselves. Earlier we mentioned that the computers in our
example belonged to a
<em class="firstterm">workgroup</em><a name="INDEX-73"/>,
which is a partition of computers on the same network. For example, a
business might very easily have an ACCOUNTING and a SALES workgroup,
each with different servers and printers. In the Windows world, a
workgroup and an
<a name="INDEX-74"/>SMB
group are the same thing.</p>
<p>Continuing our
<em class="emphasis">nbtstat</em><a name="INDEX-75"/> example,
the <tt class="literal">toltec</tt> Samba server is also a member of the
METRAN workgroup (the GROUP attribute hex 00) and will participate in
elections for the browse master (GROUP attribute 1E). Here is the
remainder of the <em class="emphasis">nbtstat</em> output:</p>
<blockquote><pre class="code"> NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
METRAN <00> GROUP Registered
METRAN <1E> GROUP Registered
..__MSBROWSE__.<01> GROUP Registered</pre></blockquote>
<p>The possible group attributes a computer can have are illustrated in
<a href="ch01.html#samba2-CHP-1-TABLE-3">Table 1-3</a>. More
<a name="INDEX-76"/><a name="INDEX-77"/>information
is available in <em class="emphasis">Windows NT in a Nutshell</em> by Eric
<a name="INDEX-78"/>Pearce, also
published by O'Reilly.</p>
<a name="samba2-CHP-1-TABLE-3"/><h4 class="head4">Table 1-3. NetBIOS group resource types</h4><table border="1">
<tr>
<th>
<p>Named resource</p>
</th>
<th>
<p>Hexadecimal byte value</p>
</th>
</tr>
<tr>
<td>
<p>Standard Workstation group</p>
</td>
<td>
<p>00</p>
</td>
</tr>
<tr>
<td>
<p>Logon server</p>
</td>
<td>
<p>1C</p>
</td>
</tr>
<tr>
<td>
<p>Master Browser name</p>
</td>
<td>
<p>1D</p>
</td>
</tr>
<tr>
<td>
<p>Normal Group name (used in browser elections)</p>
</td>
<td>
<p>1E</p>
</td>
</tr>
<tr>
<td>
<p>Internet Group name (administrative)</p>
</td>
<td>
<p>20</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal"><01><02>_ _MSBROWSE_ _<02></tt></p>
</td>
<td>
<p>01</p>
</td>
</tr>
</table>
<p>The final entry, <tt class="literal">_ _ MSBROWSE _ _</tt>
<a name="INDEX-80"/>, is used to announce a group to other
master browsers. The nonprinting characters in the name show up as
dots in an <em class="emphasis">nbtstat</em> printout.
Don't worry if you don't understand
all of the resource or group types. Some of them you will not need
with Samba, and others you will pick up as you move through the rest
of the chapter. The important thing to remember here is the logistics
of the naming mechanism.</p>
</div>
<div class="sect3"><a name="samba2-CHP-1-SECT-3.4.3"/>
<h3 class="head3">Scope ID</h3>
<p>In the dark ages of SMB networking before NetBIOS groups were
introduced, you could use a very primitive method to isolate groups
of computers from the rest of the network. Each SMB packet contains a
field called the <em class="firstterm">scope
ID</em><a name="INDEX-81"/><a name="INDEX-82"/>, with the idea being that
systems on the network could be configured to accept only packets
with a scope ID matching that of their configuration. This feature
was hardly ever used and unfortunately lingers in modern
implementations. Some of the utilities included in the Samba
distribution allow the scope ID to be set. Setting the scope ID in a
network is likely to cause problems, and we are mentioning scope ID
only so that you will not be confused by it when you later encounter
it in various places.</p>
</div>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-3.5"/>
<h3 class="head2">Datagrams and Sessions</h3>
<p>At this point, let's digress to discuss the
responsibility of NBT: to provide connection services between two
NetBIOS computers.
<a name="INDEX-83"/>NBT
offers two services: the <em class="firstterm">session
service</em><a name="INDEX-84"/> and the
<em class="firstterm">datagram service</em><a name="INDEX-85"/>.
Understanding how these two services work is not essential to using
Samba, but it does give you an idea of how NBT works and how to
troubleshoot Samba when it doesn't work.</p>
<p>The datagram service has no stable connection between computers.
Packets of data are simply sent or broadcast from one computer to
another, without regard to the order in which they arrive at the
destination, or even if they arrive at all. The use of datagrams
requires less processing overhead than sessions, although the
reliability of the connection can suffer. Datagrams, therefore, are
used for quickly sending nonvital blocks of data to one or more
computers. The datagram service communicates using the simple
primitives shown in <a href="ch01.html#samba2-CHP-1-TABLE-4">Table 1-4</a>.</p>
<a name="samba2-CHP-1-TABLE-4"/><h4 class="head4">Table 1-4. Datagram primitives</h4><table border="1">
<tr>
<th>
<p>Primitive</p>
</th>
<th>
<p>Description</p>
</th>
</tr>
<tr>
<td>
<p>Send Datagram</p>
</td>
<td>
<p>Send datagram packet to computer or groups of computers.</p>
</td>
</tr>
<tr>
<td>
<p>Send Broadcast Datagram</p>
</td>
<td>
<p>Broadcast datagram to any computer waiting with a Receive Broadcast
datagram.</p>
</td>
</tr>
<tr>
<td>
<p>Receive Datagram</p>
</td>
<td>
<p>Receive a datagram from a computer.</p>
</td>
</tr>
<tr>
<td>
<p>Receive Broadcast Datagram</p>
</td>
<td>
<p>Wait for a Broadcast datagram.</p>
</td>
</tr>
</table>
<p>The session service is more complex. Sessions are a communication
method that, in theory, offers the ability to detect problematic or
inoperable connections between two NetBIOS applications. It helps to
think of an NBT session as being similar to a telephone call, an
analogy that obviously influenced the design of the CIFS standard.</p>
<p>Once the connection is made, it remains open throughout the duration
of the conversation, each side knows who the caller and the called
computer are, and each can communicate with the simple primitives
shown in <a href="ch01.html#samba2-CHP-1-TABLE-5">Table 1-5</a>.</p>
<a name="samba2-CHP-1-TABLE-5"/><h4 class="head4">Table 1-5. Session primitives</h4><table border="1">
<tr>
<th>
<p>Primitive</p>
</th>
<th>
<p>Description</p>
</th>
</tr>
<tr>
<td>
<p>Call</p>
</td>
<td>
<p>Initiate a session with a computer listening under a specified name.</p>
</td>
</tr>
<tr>
<td>
<p>Listen</p>
</td>
<td>
<p>Wait for a call from a known caller or any caller.</p>
</td>
</tr>
<tr>
<td>
<p>Hang-up</p>
</td>
<td>
<p>Exit a call.</p>
</td>
</tr>
<tr>
<td>
<p>Send</p>
</td>
<td>
<p>Send data to the other computer.</p>
</td>
</tr>
<tr>
<td>
<p>Receive</p>
</td>
<td>
<p>Receive data from the other computer.</p>
</td>
</tr>
<tr>
<td>
<p>Session Status</p>
</td>
<td>
<p>Get information on requested sessions.</p>
</td>
</tr>
</table>
<p>Sessions are the backbone of resource sharing on an NBT network. They
are typically used for establishing stable connections from client
computers to disk or printer shares on a server. The client
"calls" the server and starts
trading information such as which files it wishes to open, which data
it wishes to exchange, etc. These calls can last a long
time—hours, even days—and all of this occurs within the
context of a single connection. If there is an error, the session
software (TCP) will retransmit until the data is received properly,
unlike the "punt-and-pray" approach
of the datagram service (UDP).</p>
<p>In truth, while sessions are supposed to handle problematic
communications, they sometimes don't. If the
connection is interrupted, session information that is open between
the two computers might become invalid. If that happens, the only way
to regain the session information is for the same two computers to
call each other again and start over.</p>
<p>If you want more information on each service, we recommend you look
at RFC 1001. However, there are two important things to remember
here:</p>
<ul><li>
<p><a name="INDEX-88"/>Sessions always
occur between two NetBIOS computers. If a session service is
interrupted, the client is supposed to store sufficient state
information for it to reestablish the connection. However, in
practice, this often does not happen.</p>
</li><li>
<p><a name="INDEX-89"/>Datagrams can
be broadcast to multiple computers, but they are unreliable. In other
words, there is no way for the source to know that the datagrams it
sent have indeed arrived at their destinations. <a name="INDEX-90"/></p>
</li></ul>
</div>
</div>
<div class="sect1"><a name="samba2-CHP-1-SECT-4"/>
<h2 class="head1">An Introduction to the SMB Protocol</h2>
<p><a name="INDEX-91"/>Now
we're going to cover some low-level technical
details and explore the elementals of the SMB protocol. You probably
don't need to know much about this to implement a
simple Samba network, and therefore you might want to skip or skim
over this section and go on to the next one
("Windows Workgroups and Domains")
on your first reading. However, assuming you are going to be
responsible for long-term maintenance of a Samba network, it will
help if you understand how it actually works. You will more easily be
able to diagnose and correct any odd problems that pop up.</p>
<p>At a high level, the SMB protocol suite is relatively simple. It
includes commands for all the file and print operations that you
might perform on a local disk or printer, such as:</p>
<ul><li>
<p>Opening and closing files</p>
</li><li>
<p>Creating and deleting files and directories</p>
</li><li>
<p>Reading and writing files</p>
</li><li>
<p>Searching for files</p>
</li><li>
<p>Queueing and dequeueing files in a print spool</p>
</li></ul>
<p>Each operation can be encoded into an SMB message and transmitted to
and from a server. The original name
"SMB" comes from the way in which
the commands are formatted: they are versions of the standard DOS
system-call data structures, or <em class="firstterm">Server Message
Blocks</em>, redesigned for transmitting to another computer
across a network.</p>
<div class="sect2"><a name="samba2-CHP-1-SECT-4.1"/>
<h3 class="head2">SMB Format</h3>
<p>Richard <a name="INDEX-92"/>Sharpe of the Samba team defines SMB as
a <em class="firstterm">request-response</em> protocol.<a name="FNPTR-4"/><a href="#FOOTNOTE-4">[4]</a> In effect,
this means that a client sends an SMB request to a server and the
server sends an SMB response back to the client. In only one rare
circumstance does a server send a message that is not in response to
a client.</p>
<p>An <a name="INDEX-94"/>SMB message is not as complex as you
might think. Let's take a closer look at the
internal structure of such a message. It can be broken down into two
parts: the <em class="firstterm">header</em>, which is a fixed size, and
the <em class="firstterm">command string</em>, whose size can vary
dramatically based on the contents of the message.</p>
<div class="sect3"><a name="samba2-CHP-1-SECT-4.1.1"/>
<h3 class="head3">SMB header format</h3>
<p><a href="ch01.html#samba2-CHP-1-TABLE-6">Table 1-6</a> shows the format of an
<a name="INDEX-95"/>SMB header. The COM field identifies
the command being performed. SMB commands are not required to use all
the fields in the SMB header. For example, when a client first
attempts to connect to a server, it does not yet have a tree
identifier (TID) value—one is assigned after it successfully
connects—so a null TID is placed in its header field. Other
fields can be padded with zeros when not used.</p>
<p>The <a name="INDEX-96"/>SMB header fields are listed in <a href="ch01.html#samba2-CHP-1-TABLE-6">Table 1-6</a>.</p>
<a name="samba2-CHP-1-TABLE-6"/><h4 class="head4">Table 1-6. SMB header fields</h4><table border="1">
<tr>
<th>
<p>Field</p>
</th>
<th>
<p>Size (bytes)</p>
</th>
<th>
<p>Description</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">0xFF 'SMB</tt>'</p>
</td>
<td>
<p><tt class="literal">1</tt></p>
</td>
<td>
<p>Protocol identifier</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">COM</tt></p>
</td>
<td>
<p><tt class="literal">1</tt></p>
</td>
<td>
<p>Command code, from 0x00 to 0xFF</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">RCLS</tt></p>
</td>
<td>
<p><tt class="literal">1</tt></p>
</td>
<td>
<p>Error class</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">REH</tt></p>
</td>
<td>
<p><tt class="literal">1</tt></p>
</td>
<td>
<p>Reserved</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">ERR</tt></p>
</td>
<td>
<p><tt class="literal">2</tt></p>
</td>
<td>
<p>Error code</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">REB</tt></p>
</td>
<td>
<p><tt class="literal">1</tt></p>
</td>
<td>
<p>Reserved</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">RES</tt></p>
</td>
<td>
<p><tt class="literal">14</tt></p>
</td>
<td>
<p>Reserved</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">TID</tt></p>
</td>
<td>
<p><tt class="literal">2</tt></p>
</td>
<td>
<p>TID; a unique ID for a resource in use by the client</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">PID</tt></p>
</td>
<td>
<p><tt class="literal">2</tt></p>
</td>
<td>
<p>Caller process ID</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">UID</tt></p>
</td>
<td>
<p><tt class="literal">2</tt></p>
</td>
<td>
<p>User identifier</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">MID</tt></p>
</td>
<td>
<p><tt class="literal">2</tt></p>
</td>
<td>
<p>Multiplex identifier; used to route requests inside a process</p>
</td>
</tr>
</table>
</div>
<div class="sect3"><a name="samba2-CHP-1-SECT-4.1.2"/>
<h3 class="head3">SMB command format</h3>
<p>Immediately after the header is a variable number of bytes that
constitute an <a name="INDEX-97"/>SMB command or reply. Each command,
such as Open File (COM field identifier: <tt class="literal">SMBopen</tt>)
or Get Print Queue (<tt class="literal">SMBsplretq</tt> ), has its own set
of parameters and data. Like the SMB header fields, not all of the
command fields need to be filled, depending on the specific command.
For example, the Get Server Attributes
(<tt class="literal">SMBdskattr</tt>) command sets the WCT and BCC fields
to zero. The fields of the command segment are shown in <a href="ch01.html#samba2-CHP-1-TABLE-7">Table 1-7</a>.</p>
<a name="samba2-CHP-1-TABLE-7"/><h4 class="head4">Table 1-7. SMB command contents</h4><table border="1">
<tr>
<th>
<p>Field</p>
</th>
<th>
<p>Size (bytes)</p>
</th>
<th>
<p>Description</p>
</th>
</tr>
<tr>
<td>
<p><tt class="literal">WCT</tt></p>
</td>
<td>
<p><tt class="literal">1</tt></p>
</td>
<td>
<p>Word count</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">VWV</tt></p>
</td>
<td>
<p>Variable</p>
</td>
<td>
<p>Parameter words (size given by WCT)</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">BCC</tt></p>
</td>
<td>
<p><tt class="literal">2</tt></p>
</td>
<td>
<p>Parameter byte count</p>
</td>
</tr>
<tr>
<td>
<p><tt class="literal">DATA</tt></p>
</td>
<td>
<p>Variable</p>
</td>
<td>
<p>Data (size given by BCC)</p>
</td>
</tr>
</table>
<p>Don't worry if you don't understand
each field; they are not necessary for using Samba at an
administrator level. However, they do come in handy when debugging
system messages. We will show you some of the more common SMB
messages that clients and servers send using a modified version of
<em class="filename">tcpdump</em> later in this section. (If you prefer an
<a name="INDEX-98"/><a name="INDEX-99"/>SMB sniffer with a graphical
interface, try Ethereal, which uses the GTK libraries; see
<a href="http://www.ethereal.com">http://www.ethereal.com</a> for more
information on this tool.)</p>
<a name="samba2-CHP-1-NOTE-84"/><blockquote class="note"><h4 class="objtitle">TIP</h4>
<p>For more information on each command in the
<a name="INDEX-100"/>SMB protocol, see the
<em class="citetitle">CIFS Technical
Reference</em><a name="INDEX-101"/> at <a href="http://www.snia.org/tech_activities/CIFS">http://www.snia.org/tech_activities/CIFS</a>.</p>
</blockquote>
</div>
<div class="sect3"><a name="samba2-CHP-1-SECT-4.1.3"/>
<h3 class="head3">SMB variations</h3>
<p>The SMB protocol has been extended with new commands several times
since its inception. Each new version is backward-compatible with the
previous versions, so it is possible for a LAN to have clients and
servers concurrently running different versions of the SMB protocol.</p>
<p><a href="ch01.html#samba2-CHP-1-TABLE-8">Table 1-8</a> outlines the major versions of the
<a name="INDEX-102"/>SMB
protocol. Within each "dialect" of
SMB are many sub-versions that include commands supporting particular
releases of major operating systems. The ID string in column 2 is
used by clients and servers to determine in which level of the
protocol they will speak to each other.</p>
<a name="samba2-CHP-1-TABLE-8"/><h4 class="head4">Table 1-8. SMB protocol dialects</h4><table border="1">
<tr>
<th>
<p>Protocol name</p>
</th>
<th>
<p>ID string</p>
</th>
<th>
<p>Used by</p>
</th>
</tr>
<tr>
<td>
<p>Core</p>
</td>
<td>
<p><tt class="literal">PC NETWORK PROGRAM 1.0</tt></p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p><a name="INDEX-103"/>Core Plus</p>
</td>
<td>
<p><tt class="literal">MICROSOFT NETWORKS 1.03</tt></p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p><a name="INDEX-104"/>LAN Manager 1.0</p>
</td>
<td>
<p><tt class="literal">LANMAN1.0</tt></p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>LAN Manager 2.0</p>
</td>
<td>
<p><tt class="literal">LM1.2X002</tt></p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p>LAN Manager 2.1</p>
</td>
<td>
<p><tt class="literal">LANMAN2.1</tt></p>
</td>
<td>
</td>
</tr>
<tr>
<td>
<p><a name="INDEX-105"/>NT LAN
Manager 1.0</p>
</td>
<td>
<p><tt class="literal">NT LM 0.12</tt></p>
</td>
<td>
<p>Windows NT 4.0</p>
</td>
</tr>
<tr>
<td>
<p><a name="INDEX-106"/>Samba's NT LM 0.12</p>
</td>
<td>
<p><tt class="literal">Samba</tt></p>
</td>
<td>
<p>Samba</p>
</td>
</tr>
<tr>
<td>
<p><a name="INDEX-107"/><a name="INDEX-108"/>Common
Internet File System</p>
</td>
<td>
<p><tt class="literal">CIFS 1.0</tt></p>
</td>
<td>
<p>Windows 2000/XP</p>
</td>
</tr>
</table>
<p>Samba implements the NT LM 0.12 specification for NT LAN Manager 1.0.
It is backward-compatible with all the other SMB variants. The CIFS
specification is, in reality, LAN Manager 0.12 with a few specific
additions.</p>
</div>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-4.2"/>
<h3 class="head2">SMB Clients and Servers</h3>
<p><a name="INDEX-109"/><a name="INDEX-110"/>As
mentioned earlier, SMB is a client/server protocol. In the purest
sense, this means that a client sends a request to a server, which
acts on the request and returns a reply. However, the client/server
roles can often be reversed, sometimes within the context of a single
SMB session. For example, consider the two Windows 95/98/Me computers
in <a href="ch01.html#samba2-CHP-1-FIG-11">Figure 1-11</a>. The computer named
<tt class="literal">maya</tt> shares a printer to the network, and the
computer named <tt class="literal">toltec</tt> shares a disk directory.
<tt class="literal">maya</tt> is in the client role when accessing
<tt class="literal">toltec</tt>'s network drive and in the
server role when printing a job for <tt class="literal">toltec</tt>.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-11"/><img src="figs/sam2_0111.gif"/></div><h4 class="head4">Figure 1-11. Two computers that both have resources to share</h4>
<p>This brings out an important point in Samba terminology:</p>
<ul><li>
<p>A <em class="firstterm">server</em> is a computer with a resource to
share.</p>
</li><li>
<p>A <em class="firstterm">client</em> is a computer that wishes to use that
resource.</p>
</li><li>
<p>A computer can be a client, a server, or both, or it can be neither
at any given time.</p>
</li></ul>
<p>Microsoft Windows products have both the SMB client and server built
into the operating system, and it is common to find Windows acting as
a server, client, both, or neither at any given time in a production
network. Although Samba has been developed primarily to function as a
server, there are also ways that it and associated software can act
as an SMB client. As with Windows, it is even possible to set up a
Unix system to act as an SMB client and not as a server. See <a href="ch05.html">Chapter 5</a> for more details on this topic.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-4.3"/>
<h3 class="head2">A Simple SMB Connection</h3>
<p><a name="INDEX-111"/>The client and server must complete
three steps to establish a connection to a resource:</p>
<ol><li>
<p>Establish a NetBIOS session.</p>
</li><li>
<p>Negotiate the protocol variant.</p>
</li><li>
<p>Set session parameters, and make a tree connection to a resource.</p>
</li></ol>
<p>We will examine each step through the eyes of a useful tool that we
mentioned earlier: the modified
<em class="filename">tcpdump</em><a name="INDEX-112"/> that is
available from the Samba web site.</p>
<a name="samba2-CHP-1-NOTE-85"/><blockquote class="note"><h4 class="objtitle">TIP</h4>
<p>You can download the tcpdump program at <a href="http://www.samba.org">http://www.samba.org</a> in the
<em class="filename">samba/ftp/tcpdump-smb</em> directory; the latest
version as of this writing is 3.4-10. Use this program as you would
use the standard <em class="filename">tcpdump</em> application, but add
the <tt class="literal">-s 1500</tt> switch to ensure that you get the
whole packet and not just the first few bytes.</p>
</blockquote>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-4.4"/>
<h3 class="head2">Establishing a NetBIOS Session</h3>
<p><a name="INDEX-113"/>When a user first makes a request
to access a network disk or send a print job to a remote printer,
NetBIOS takes care of making a connection at the session layer. The
result is a bidirectional channel between the client and server. The
client and server need only two messages to establish this
connection. This is shown in the following example session request
and response, as captured by <em class="filename">tcpdump</em> .</p>
<p>First, the client sends a request to open a session, and
<em class="filename">tcpdump </em><a name="INDEX-114"/>reports:</p>
<blockquote><pre class="code">>>> NBT Packet
NBT Session Request
Flags=0x81000044
Destination=TOLTEC NameType=0x20 (Server)
Source=MAYA NameType=0x00 (Workstation)</pre></blockquote>
<p>Then the server responds, granting a session to the client:</p>
<blockquote><pre class="code">>>> NBT Packet
NBT Session Granted
Flags=0x82000000</pre></blockquote>
<p>At this point, there is an open channel between the client and server.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-4.5"/>
<h3 class="head2">Negotiating the Protocol Variant</h3>
<p>Next, the client sends a message to the server to negotiate an
<a name="INDEX-115"/>SMB protocol. As mentioned
earlier, the client sets its <a name="INDEX-116"/>tree identifier (TID) field to
zero, because it does not yet know what TID to use. A <em class="emphasis">tree
identifier</em> is a number that represents a connection to a
share on a server.</p>
<p>The command in the message is <tt class="literal">SMBnegprot</tt>, a
request to negotiate a protocol variant that will be used for the
entire session. Note that the client sends to the server a list of
all the variants that it can speak, not vice versa:</p>
<blockquote><pre class="code">>>> NBT Packet
NBT Session Packet
Flags=0x0
Length=154
SMB PACKET: SMBnegprot (REQUEST)
SMB Command = 0x72
Error class = 0x0
Error code = 0
Flags1 = 0x0
Flags2 = 0x0
Tree ID = 0
Proc ID = 5315
UID = 0
MID = 257
Word Count = 0
Dialect=PC NETWORK PROGRAM 1.0
Dialect=MICROSOFT NETWORKS 3.0
Dialect=DOS LM1.2X002
Dialect=DOS LANMAN2.1
Dialect=Windows for Workgroups 3.1a
Dialect=NT LM 0.12</pre></blockquote>
<p>The server responds to the
<tt class="literal">SMBnegprot</tt><a name="INDEX-117"/> request with an index (with counting
starting at 0) into the list of variants that the client offered, or
with the value 0xFF if none of the protocol variants is acceptable:</p>
<blockquote><pre class="code">>>> NBT Packet
NBT Session Packet
Flags=0x0
Length=84
SMB PACKET: SMBnegprot (REPLY)
SMB Command = 0x72
Error class = 0x0
Error code = 0
Flags1 = 0x80
Flags2 = 0x1
Tree ID = 0
Proc ID = 5315
UID = 0
MID = 257
Word Count = 17
NT1 Protocol
DialectIndex=5
[...]</pre></blockquote>
<p>In this example, the server responds with the value 5, which
indicates that the <tt class="literal">NT</tt> <tt class="literal">LM</tt>
<tt class="literal">0.12</tt> dialect will be used for the remainder of the
session.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-4.6"/>
<h3 class="head2">Set Session and Login Parameters</h3>
<p><a name="INDEX-118"/><a name="INDEX-119"/>The next step is to transmit session and
login parameters for the session, which you do using the
<a name="INDEX-120"/><tt class="literal">SMBSesssetupX</tt>
command. The parameters include the following:</p>
<ul><li>
<p>The account name and password (if there is one)</p>
</li><li>
<p>The workgroup name</p>
</li><li>
<p>The maximum size of data that can be transferred</p>
</li><li>
<p>The number of pending requests that can be in the queue at a time</p>
</li></ul>
<p>The resulting output from <em class="filename">tcpdump </em>is:</p>
<blockquote><pre class="code">>>> NBT Packet
NBT Session Packet
Flags=0x0
Length=150
SMB PACKET: SMBsesssetupX (REQUEST)
SMB Command = 0x73
Error class = 0x0
Error code = 0
Flags1 = 0x10
Flags2 = 0x0
Tree ID = 0
Proc ID = 5315
UID = 1
MID = 257
Word Count = 13
Com2=0x75
Res1=0x0
Off2=120
MaxBuffer=2920
MaxMpx=50
VcNumber=0
SessionKey=0x1380
CaseInsensitivePasswordLength=24
CaseSensitivePasswordLength=0
Res=0x0
Capabilities=0x1
Pass1&Pass2&Account&Domain&OS&LanMan=
JAY METRAN Windows 4.0 Windows 4.0
SMB PACKET: SMBtconX (REQUEST) (CHAINED)
smbvwv[]=
Com2=0xFF
Off2=0
Flags=0x2
PassLen=1
Passwd&Path&Device=
smb_bcc=23
smb_buf[]=\\TOLTEC\SPIRIT</pre></blockquote>
<p>In this example, the <tt class="literal">SMBsesssetupX</tt> Session Setup
command allows for an additional SMB command to be piggybacked onto
it (indicated by the letter X at the end of the command name). The
hexadecimal code of the second command is given in the
<tt class="literal">Com2</tt> field. In this case the command is
<tt class="literal">0x75</tt>, which is the <tt class="literal">SMBtconX</tt>
<tt class="literal">(</tt>Tree Connect and X) command. The
<tt class="literal">SMBtconX</tt><a name="INDEX-121"/> message looks for the name of the
resource in the <em class="emphasis">smb_buf</em> buffer. In this example,
<em class="emphasis">smb_buf</em> contains the string
<tt class="literal">\\TOLTEC\SPIRIT</tt>, which is the full pathname to a
shared directory on <tt class="literal">toltec</tt>. Using the
"and X" commands like this speeds
up each transaction because the server doesn't have
to wait on the client to make a second request.</p>
<p>Note that the TID is still zero. Finally, the server returns a TID to
the client, indicating that the user has been authorized access and
that the resource is ready to be used:</p>
<blockquote><pre class="code">>>> NBT Packet
NBT Session Packet
Flags=0x0
Length=85
SMB PACKET: SMBsesssetupX (REPLY)
SMB Command = 0x73
Error class = 0x0
Error code = 0
Flags1 = 0x80
Flags2 = 0x1
Tree ID = 1
Proc ID = 5315
UID = 100
MID = 257
Word Count = 3
Com2=0x75
Off2=68
Action=0x1
[000] Unix Samba 2.2.6
[010] METRAN
SMB PACKET: SMBtconX (REPLY) (CHAINED)
smbvwv[]=
Com2=0xFF
Off2=0
smbbuf[]=
ServiceType=A:</pre></blockquote>
<p>The <em class="emphasis">ServiceType</em> field is set to
"A" to indicate that this is a file
service. Available service types are:</p>
<ul><li>
<p>"A" for a disk or file</p>
</li><li>
<p>"LPT1" for a spooled output</p>
</li><li>
<p>"COMM" for a direct-connect printer
or modem</p>
</li><li>
<p>"IPC" for a named pipe</p>
</li></ul>
<p>Now that a TID has been assigned, the client can use it as a handle
to perform any operation that it would use on a local disk drive. It
can open files, read and write to them, delete them, create new
files, search for filenames, and so on. <a name="INDEX-122"/></p>
</div>
</div>
<div class="sect1"><a name="samba2-CHP-1-SECT-5"/>
<h2 class="head1">Windows Workgroups and Domains</h2>
<p>Up to now, we've covered basic SMB technology, which
is all you would need if you had nothing more advanced than MS-DOS
clients on your network. We do assume you want to support Windows
clients, especially the more recent versions, so next
we'll describe the enhancements Microsoft has added
to SMB networking—namely, Windows for Workgroups and Windows
domains.</p>
<div class="sect2"><a name="samba2-CHP-1-SECT-5.1"/>
<h3 class="head2">Windows Workgroups</h3>
<p><a name="INDEX-123"/><a name="INDEX-124"/>Windows
Workgroups are very similar to the SMB groups already described. You
need to know just a few additional things.</p>
<div class="sect3"><a name="samba2-CHP-1-SECT-5.1.1"/>
<h3 class="head3">Browsing</h3>
<p><a name="INDEX-125"/>Browsing
is the process of finding the other computers and shared resources in
the Windows network. Note that there is no connection with a World
Wide Web browser, apart from the general idea of
"discovering what's
there." On the other hand, browsing the Windows
network is like the Web in that what's out there can
change without warning.</p>
<p>Before browsing existed, users had to know the name of the computer
they wanted to connect to on the network and then manually enter a
UNC such as the following into an application or file manager to
access resources:</p>
<blockquote><pre class="code">\\toltec\spirit\</pre></blockquote>
<p>Browsing is much more convenient, making it possible to examine the
contents of a network by using the point-and-click GUI interface of
the Network Neighborhood (or My Network Places<a name="FNPTR-5"/><a href="#FOOTNOTE-5">[5]</a>) on a Windows client.</p>
<p>You will encounter two types of browsing in an SMB network:</p>
<ul><li>
<p><a name="INDEX-129"/>Browsing a list
of computers and shared resources</p>
</li><li>
<p><a name="INDEX-130"/>Browsing the shared resource
of a specific computer</p>
</li></ul>
<p>Let's look at the first one. On each LAN (or subnet)
with a Windows workgroup or domain, one computer has the
responsibility of maintaining a list of the computers that are
currently accessible through the network. This computer is called the
<em class="firstterm">local master
browser</em><a name="INDEX-131"/><a name="INDEX-132"/>, and the list that it maintains is
called the <em class="firstterm">browse
list</em><a name="INDEX-133"/>. Computers on a subnet use the browse
list to cut down on the amount of network traffic generated while
browsing. Instead of each computer dynamically polling to determine a
list of the currently available computers, the computer can simply
query the local master browser to obtain a complete, up-to-date list.</p>
<p>To browse the resources on a computer, a user must connect to the
specific computer; this information cannot be obtained from the
browse list. Browsing the list of resources on a computer can be done
by double-clicking the computer's icon when it is
presented in the Network Neighborhood. As you saw at the opening of
the chapter, the computer will respond with a list of shared
resources that can be accessed after the user is successfully
authenticated.</p>
<p>Each server on a Windows workgroup is required to announce its
presence to the local master browser after it has registered a
NetBIOS name, and (theoretically) announce that it is leaving the
workgroup when it is shut down. It is the local master
browser's responsibility to record what the servers
have announced.</p>
<a name="samba2-CHP-1-NOTE-86"/><blockquote class="note"><h4 class="objtitle">WARNING</h4>
<p>The Windows <a name="INDEX-134"/>Network Neighborhood can behave
oddly: until you select a particular computer to browse, the Network
Neighborhood window might contain data that is not up-to-date. That
means the Network Neighborhood window can be showing computers that
have crashed or can be missing computers that
haven't been noticed yet. Put succinctly, once
you've selected a server and connected to it, you
can be a lot more confident that the shares and printers really exist
on the network.</p>
</blockquote>
<p>Unlike the roles you've seen earlier, almost any
Windows system (including Windows for Workgroups and Windows 95/98/Me
or NT/2000/XP) can act as a local master browser. The local master
browser can have one or more
<em class="firstterm"/><a name="INDEX-135"/><a name="INDEX-136"/>backup
browsers</em> on the local subnet
that will take over in the event that the local master browser fails
or becomes inaccessible. To ensure fluid operation, the local backup
browsers will frequently synchronize their browse list with the local
master browser.</p>
<p>Here is how to calculate the minimum number of backup browsers that
will be allocated on a workgroup:</p>
<ul><li>
<p>If up to 32 Windows NT/2000/XP workstations are on the network, or up
to 16 Windows 95/98/Me computers are on the network, the local master
browser allocates one backup browser in addition to the local master
browser.</p>
</li><li>
<p>If the number of Windows NT/2000/XP workstations falls between 33 and
64, or the number of Windows 95/98/Me workstations falls between 17
and 32, the local master browser allocates two backup browsers.</p>
</li><li>
<p>For each group of 32 NT/2000/XP workstations or 16 Windows 95/98/Me
computers beyond this, the local master browser allocates another
backup browser.</p>
</li></ul>
<p>There is currently no upper limit on the number of backup browsers
that can be allocated by the local master browser.</p>
</div>
<div class="sect3"><a name="samba2-CHP-1-SECT-5.1.2"/>
<h3 class="head3">Browsing elections</h3>
<p><a name="INDEX-137"/>Browsing
is a critical aspect of any Windows workgroup. However, not
everything runs perfectly on any network. For example,
let's say that a computer running Windows on the
desk of a small company's CEO is the local master
browser—that is, until he switches it off while plugging in his
massage chair. At this point the Windows NT Workstation in the spare
parts department might agree to take over the job. However, that
computer is currently running a large, poorly written program that
has brought its processor to its knees. The moral: browsing has to be
very tolerant of servers coming and going. Because nearly every
Windows system can serve as a browser, there has to be a way of
deciding at any time who will take on the job. This decision-making
process is called an <em class="firstterm">election</em>.</p>
<p>An election algorithm is built into nearly all Windows operating
systems such that they can each agree who is going to be a local
master browser and who will be local backup browsers. An election can
be forced at any time. For example, let's assume
that the CEO has finished his massage and reboots his server. As the
server comes online, it will announce its presence, and an election
will take place to see if the PC in the spare parts department should
still be the master browser.</p>
<p>When an election is performed, each computer broadcasts information
about itself via datagrams. This information includes the following:</p>
<ul><li>
<p>The version of the election protocol used</p>
</li><li>
<p>The operating system on the computer</p>
</li><li>
<p>The amount of time the client has been on the network</p>
</li><li>
<p>The hostname of the client</p>
</li></ul>
<p>These values determine which operating system has seniority and will
fulfill the role of the local master browser. (<a href="ch07.html">Chapter 7</a> describes the election process in more
detail.) The architecture developed to achieve this is not elegant
and has built-in security problems. While a browsing domain can be
integrated with domain security, the election algorithm does not take
into consideration which computers become browsers. Thus it is
possible for any computer running a browser service to register
itself as participating in the browsing election and (after winning)
being able to change the browse list. Nevertheless, browsing is a key
feature of Windows networking, and backward-compatibility
requirements will ensure that it is in use for years to come.
<a name="INDEX-138"/></p>
</div>
<div class="sect3"><a name="samba2-CHP-1-SECT-5.1.3"/>
<h3 class="head3">Windows 95/98/Me authentication</h3>
<p>Three types of passwords arise when
<a name="INDEX-139"/><a name="INDEX-140"/>Windows
95/98/Me is operating in a Windows workgroup:</p>
<ul><li>
<p>A Windows password</p>
</li><li>
<p>A Windows Networking password</p>
</li><li>
<p>A password for each shared resource that has been assigned password
protection</p>
</li></ul>
<p>The Windows <a name="INDEX-141"/>password functions in a manner
that might be a source of confusion for Unix system administrators.
It is not there to prevent unauthorized users from using the
computer. (If you don't believe that, try clicking
the Cancel button on the password dialog box and see what happens!)
Instead, the Windows password is used to gain access to a file that
contains the Windows Networking and network resource passwords. There
is one such file per registered user of the system, and they can be
found in the <em class="filename">C:\Windows</em> directory with a name
composed of the user's account name, followed by a
<em class="filename">.pwl</em><a name="INDEX-142"/><a name="INDEX-143"/><a name="INDEX-144"/> extension. For example, if the
user's account name is
"sarah," the file will be
<em class="filename">C:\Windows\sarah.pwl</em>. This file is encrypted
using the Windows password as the encryption key.</p>
<a name="samba2-CHP-1-NOTE-87"/><blockquote class="note"><h4 class="objtitle">TIP</h4>
<p>As a security measure, you might want to check for junk
<em class="filename">.pwl</em> files on Windows 95/98/Me clients, which
might have been created by mistakes users made while attempting to
log on. A <em class="filename">.pwl</em> file is easily cracked and can
contain valid passwords for Samba accounts and network shares.</p>
</blockquote>
<p>The first time the network is accessed, Windows attempts to use the
Windows password as the Windows Networking password. If this is
successful, the user will not be prompted for two separate passwords,
and subsequent logins to the Windows system will automatically result
in logging on to the Windows network as well, making things much
simpler for the user.</p>
<p>Shared network resources in the workgroup can also have passwords
assigned to them to limit their accessibility. The first time a user
attempts to access the resource, she is asked for its password, and a
checkbox in the password dialog box gives the user the option to add
the password to her password list. This is the default; if it is
accepted, Windows will store the password in the
user's <em class="filename">.pwl</em> file, and all
further authentication to the resource will be handled automatically
by Windows.</p>
<p>Samba's approach to workgroup authentication is a
little different, which is a result of blending the Windows workgroup
model with that of the Unix host upon which Samba runs. This will be
discussed further in <a href="ch09.html">Chapter 9</a>. <a name="INDEX-145"/></p>
</div>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-5.2"/>
<h3 class="head2">Windows NT Domains</h3>
<p><a name="INDEX-146"/>The
peer-to-peer networking model of
<a name="INDEX-147"/>workgroups functions fairly well as long as
the number of computers on the network is small and there is a
close-knit community of users. However, in larger networks the
simplicity of workgroups becomes a limiting factor. Workgroups offer
only the most basic level of security, and because each resource can
have its own password, it is inconvenient (to say the least) for
users to remember the password for each resource in a large network.
Even if that were not a problem, many people find it frustrating to
have to interrupt their creative workflow to enter a shared password
into a dialog box every time another network resource is accessed.</p>
<p>To support the needs of larger networks, such as those found in
departmental computing environments, Microsoft introduced domains
with Windows NT 3.51. A <em class="firstterm">Windows NT domain</em> is
essentially a workgroup of SMB computers that has one addition: a
server acting as a <em class="firstterm">domain
controller</em><a name="INDEX-148"/> (see <a href="ch01.html#samba2-CHP-1-FIG-12">Figure 1-12</a>).</p>
<div class="figure"><a name="samba2-CHP-1-FIG-12"/><img src="figs/sam2_0112.gif"/></div><h4 class="head4">Figure 1-12. A simple Windows domain</h4>
<div class="sect3"><a name="samba2-CHP-1-SECT-5.2.1"/>
<h3 class="head3">Domain controllers</h3>
<p>A domain controller in a Windows NT domain functions much like a
<a name="INDEX-149"/><a name="INDEX-150"/>Network
Information Service (NIS) server in a Unix network, maintaining a
domain-wide database of user and group information, as well as
performing related services. The responsibilities of a domain
controller are mainly centered around security, including
<em class="firstterm">authentication</em><a name="INDEX-151"/>,
the process of granting or denying a user access to the resources of
the domain. This is typically done through the use of a username and
password. The service that maintains the database on the domain
controllers is called the <a name="INDEX-152"/><a name="INDEX-153"/>Security Account Manager (SAM).</p>
<p>The <a name="INDEX-154"/>Windows NT security model revolves
around <em class="firstterm">security
identifiers</em><a name="INDEX-155"/><a name="INDEX-156"/> (SIDs) and <em class="firstterm">access
control lists</em><a name="INDEX-157"/><a name="INDEX-158"/>
(ACLs). Security identifiers are used to represent objects in the
domain, which include (but are not limited to) users, groups,
computers, and processes. SIDs are commonly written in ASCII form as
hyphen-separated fields, like this:</p>
<blockquote><pre class="code">S-1-5-21-1638239387-7675610646-9254035128-545</pre></blockquote>
<p>The part of the SID starting with the
"S" and leading up to the rightmost
hyphen identifies a domain. The number after the rightmost hyphen is
called a <a name="INDEX-159"/>relative identifier (RID) and is a unique
number within the domain that identifies the user, group, computer,
or other object. The RID is the analog of a <a name="INDEX-160"/>user ID (UID) or
<a name="INDEX-161"/>group ID
(GID) on a Unix system or within an NIS domain.</p>
<p>ACLs supply the same function as
"rwx"
<a name="INDEX-162"/><a name="INDEX-163"/><a name="INDEX-164"/><a name="INDEX-165"/><a name="INDEX-166"/>file permissions that are common in Unix
systems. However, ACLs are more versatile. Unix file permissions only
set permissions for the owner and group to which the file belongs,
and "other," meaning everyone else.
Windows NT/2000/XP ACLs allow permissions to be set individually for
any number of arbitrary users and/or groups. ACLs are made up of one
or more <em class="firstterm">access control
entries</em><a name="INDEX-167"/> (ACEs), each of which contains an SID
and the access rights associated with it.</p>
<p>ACL support has been added as a standard feature for some Unix
variants and is available as an add-on for others. Samba supports
mappings between Windows and Unix ACLs, and this will be covered in
<a href="ch08.html">Chapter 8</a>.</p>
</div>
<div class="sect3"><a name="samba2-CHP-1-SECT-5.2.2"/>
<h3 class="head3">Primary and backup domain controllers</h3>
<p>You've already read about master and backup
browsers. Domain controllers are similar in that a domain has a
<em class="firstterm">primary domain
controller</em><a name="INDEX-168"/><a name="INDEX-169"/><a name="INDEX-170"/> (PDC) and can have
one or more <em class="firstterm">backup domain
controllers</em><a name="INDEX-171"/> (BDCs) as well. If the PDC fails or
becomes inaccessible, its duties are automatically taken over by one
of the BDCs. BDCs frequently synchronize their SAM data with the PDC
so if the need arises, any one of them can immediately begin
performing domain-controller services without impacting the clients.
However, note that BDCs have read-only copies of the SAM database;
they can update their data only by synchronizing with a PDC. A server
in a Windows domain can use the SAM of any PDC or BDC to authenticate
a user who attempts to access its resources and log on to the domain.</p>
<p>All recent versions of Windows can log on to a domain as clients to
access the resources of the domain servers. The systems that are
considered members of the domain are a more exclusive class, composed
of the PDC and BDCs, as well as domain member servers, which are
systems that have joined a domain as members, and are known to the
domain controllers by having a computer account in the SAM database.</p>
</div>
<div class="sect3"><a name="samba2-CHP-1-SECT-5.2.3"/>
<h3 class="head3">Authentication</h3>
<p><a name="INDEX-172"/>When
a user logs on to a Windows domain by typing in a username and
password, a secure challenge and response protocol is invoked between
the client computer and a domain controller to verify that the
username and password are valid. Then the domain controller sends a
SID back to the client, which uses it to create a
<a name="INDEX-173"/>Security Access Token (SAT) that is valid
only for that system, to be used for further authentication. This
access token has information about the user coded into it, including
the username, the group, and the rights the user has within the
domain. At this point, the user is logged on to the domain.</p>
<p>Subsequently, when the client attempts to access a shared resource
within the domain, the client system enters into a secure challenge
and response exchange with the server of the resource. The server
then enters into another secure challenge and response conversation
with a domain controller to check that the client is valid. (What
actually happens is that the server uses information it gets from the
client to pretend to be the client and authenticate itself with the
domain controller. If the domain controller validates the
credentials, it sends an SID back to the server, which uses the SID
to create its own SAT for the client to enable access to its local
resources on the client's behalf.) At this point,
the client is authenticated for resources on the server and is
allowed to access them. The server then uses the SID in the access
token to determine what permissions the client has to use and modify
the requested resource by comparing them to entries in the ACL of the
resource.</p>
<p>Although this method of authentication might seem overly complicated,
it allows clients to authenticate without having plain-text passwords
travel through the network, and it is much more difficult to crack
than the relatively weak workgroup security we described earlier.</p>
</div>
<div class="sect3"><a name="samba2-CHP-1-SECT-5.2.4"/>
<h3 class="head3">Name service with WINS and DNS</h3>
<p>The <a name="INDEX-174"/><a name="INDEX-175"/>Windows
Internet Name Service (WINS) is Microsoft's
implementation of a NetBIOS name server (NBNS). As such, WINS
inherits much of NetBIOS's characteristics. First,
WINS is flat; you can have only simple machine names such as
<tt class="literal">inca</tt>, <tt class="literal">mixtec</tt>, or
<tt class="literal">navaho</tt>, and workgroups such as PERU, MEXICO, or
USA. In addition, WINS is dynamic: when a client first comes online,
it is required to report its hostname, its address, and its workgroup
to the local WINS server. This WINS server will retain the
information so long as the client periodically refreshes its WINS
registration, which indicates that it's still
connected to the network. Note that WINS servers are not workgroup-
or domain-specific; they can contain information for multiple domains
and/or workgroups, which might exist on more than one subnet.</p>
<p>Multiple <a name="INDEX-176"/>WINS
servers can be set to synchronize with each other. This allows
entries for computers that come online and go offline in the network
to propagate from one WINS server to another. While in theory this
seems efficient, it can quickly become cumbersome if several WINS
servers are covering a network. Because WINS services can cross
multiple subnets (you'll either hardcode the address
of a WINS server in each of your clients or obtain it via DHCP), it
is often more efficient to have each Windows client, regardless of
the number of Windows domains, point themselves to the same WINS
server. That way, only one authoritative WINS server will have the
correct information, instead of several WINS servers continually
struggling to synchronize themselves with the most recent changes.</p>
<p>The currently active WINS server is known as the <em class="firstterm">primary
WINS server</em><a name="INDEX-177"/><a name="INDEX-178"/>. You can also install a secondary WINS
server, which will take over if the primary WINS server fails or
becomes inaccessible. Both the primary and any other WINS servers
will synchronize their address databases on a periodic basis.</p>
<p>In the Windows family of operating systems, only a server edition of
Windows NT/2000 can act as a WINS server. Samba 2.2 can function as a
primary WINS server, but cannot <a name="INDEX-179"/><a name="INDEX-180"/>synchronize
its database with other WINS servers. It therefore cannot act as a
secondary WINS server or as a primary WINS server for a Windows
secondary WINS server.</p>
<p>WINS handles name service by default, although Microsoft added DNS
starting with Windows NT 4 Server. It is compatible with DNS that is
standard on virtually every Unix system, and a Unix server (such as
the Samba host) can also be used for DNS.</p>
</div>
<div class="sect3"><a name="samba2-CHP-1-SECT-5.2.5"/>
<h3 class="head3">Trust relationships</h3>
<p>One additional aspect of Windows NT domains not yet supported in
Samba 2.2 is that it is possible to set up a <em class="emphasis">trust
relationship</em><a name="INDEX-181"/><a name="INDEX-182"/><a name="INDEX-183"/> between domains, allowing clients
within one domain to access the resources within another without the
user having to go through additional authentication. The protocol
that is followed is called <em class="emphasis">pass-through authentication</em>,
<a name="INDEX-184"/><a name="INDEX-185"/>in which the
user's credentials are passed from the client system
in the first domain to the server in the second domain, which
consults a domain controller in the first (trusted) domain to check
that the user is valid before granting access to the resource.</p>
<p>Note that in many aspects, the behaviors of a Windows workgroup and a
Windows NT domain overlap. For example, the master and backup
browsers in a domain are always the PDC and BDC, respectively.
Let's update our Windows domain diagram to include
both a local master and local backup browser. The result is shown in
<a href="ch01.html#samba2-CHP-1-FIG-13">Figure 1-13</a>.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-13"/><a name="INDEX-186"/><img src="figs/sam2_0113.gif"/></div><h4 class="head4">Figure 1-13. A Windows domain with a local master and local backup browser</h4>
<p>The similarity between workgroups and NT domains is not accidental
because the concept of Windows domains did not evolve until Windows
NT 3.5 was introduced, and Windows domains were forced to remain
backward-compatible with the workgroups present in Windows for
Workgroups.</p>
<p>Samba can function as a primary domain controller for Windows
95/98/Me and Windows NT/2000/XP clients with the limitation that it
can act as a PDC only, and not as a BDC.</p>
<p>Samba can also function as a <em class="firstterm">domain member
server</em><a name="INDEX-187"/><a name="INDEX-188"/>, meaning that it has a computer account
in the PDC's account database and is therefore
recognized as being part of the domain. A domain member server does
not authenticate users logging on to the domain, but still handles
security functions (such as file permissions) for domain users
accessing its resources.</p>
</div>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-5.3"/>
<h3 class="head2">Active Directory Domains</h3>
<p>Starting with Windows 2000, Microsoft has introduced
<a name="INDEX-189"/><a name="INDEX-190"/>Active
Directory, the next step beyond Windows NT domains. We
won't go into much detail concerning Active
Directory because it is a huge topic. <a name="INDEX-191"/>Samba 2.2 doesn't
support Active Directory at all, and support in Samba 3.0 is limited
to acting as a client. For now, be aware that with Active Directory,
the authentication model is centered around
<a name="INDEX-192"/>Lightweight Directory
Access Protocol (LDAP), and name service is provided by DNS instead
of WINS. Domains in Active Directory can be organized in a
hierarchical tree structure, in which each domain controller operates
as a peer, with no distinction between primary and backup controllers
as in Windows NT domains.</p>
<p>Windows 2000/XP systems can be set up as simple workgroup or Windows
NT domain clients (which will function with Samba). The server
editions of Windows 2000 can be set up to run Active Directory and
support Windows NT domains for backward compatibility
(<em class="firstterm">mixed mode</em>). In this case, Samba 2.2 works
with Windows 2000 servers in the same way it works with Windows NT
4.0 servers. When set up to operate in <em class="firstterm">native mode,
</em><a name="INDEX-193"/>Windows 2000 servers support only
Active Directory. Even so, <a name="INDEX-194"/>Samba 2.2 can operate as a server
in a domain hosted by a native-mode Windows 2000 server, using the
<a name="INDEX-195"/>Windows 2000 server's
<em class="firstterm">PDC emulation mode</em>. However, it is not
possible for Samba 2.2 or 3.0 to operate as a domain controller in a
Windows 2000 Active Directory domain.</p>
<p>If you want to know more about Active Directory, we encourage you to
obtain a copy of the O'Reilly book,
<em class="emphasis">Windows 2000 Active Directory</em>. <a name="INDEX-196"/></p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-5.4"/>
<h3 class="head2">Can a Windows Workgroup Span Multiple Subnets?</h3>
<p><a name="INDEX-197"/><a name="INDEX-198"/>Yes, but most people who have
done it have had their share of headaches. Spanning multiple subnets
was not part of the initial design of Windows NT 3.5 or Windows for
Workgroups. As a result, a Windows domain that spans two or more
subnets is, in reality, the
"gluing" together of two or more
workgroups that share an identical name. The good news is that you
can still use a PDC to control authentication across each subnet. The
bad news is that things are not as simple with browsing.</p>
<p>As mentioned previously, each subnet must have its own local master
browser. When a Windows domain spans multiple subnets, a system
administrator will have to assign one of the computers as the
<em class="firstterm">domain master
browser</em><a name="INDEX-199"/><a name="INDEX-200"/>. The domain master browser will keep a
browse list for the entire Windows domain. This browse list is
created by periodically synchronizing the browse lists of each local
master browser with the browse list of the domain master browser.
After the synchronization, the local master browser and the domain
master browser should contain identical entries. See <a href="ch01.html#samba2-CHP-1-FIG-14">Figure 1-14</a> for an illustration.</p>
<div class="figure"><a name="samba2-CHP-1-FIG-14"/><img src="figs/sam2_0114.gif"/></div><h4 class="head4">Figure 1-14. A workgroup that spans more than one subnet</h4>
<p>Sound good? <a name="INDEX-201"/>Well, it's not quite
nirvana for the following reasons:</p>
<ul><li>
<p>If it exists, a PDC always plays the role of the domain master
browser. By Microsoft design, the two always share the NetBIOS
resource type <tt class="literal"><1B></tt> and (unfortunately)
cannot be separated.</p>
</li><li>
<p>Windows 95/98/Me computers cannot become <em class="emphasis">or</em>
<em class="emphasis">even contact</em> a domain master browser. This means
that it is necessary to have at least one Windows NT/2000/XP system
(or Samba server) on each subnet of a multisubnet workgroup.</p>
</li></ul>
<p>Each subnet's local master browser continues to
maintain the browse list for its subnet, for which it becomes
authoritative. So if a computer wants to see a list of servers within
its own subnet, the local master browser of that subnet will be
queried. If a computer wants to see a list of servers outside the
subnet, it can still go only as far as the local master browser. This
works because at appointed intervals, the authoritative browse list
of a subnet's local master browser is synchronized
with the domain master browser, which is synchronized with the local
master browser of the other subnets in the domain. This is called
<em class="firstterm">browse list propagation</em>.</p>
<p>Samba can act as a domain master browser in a Windows NT domain, or
it can act as a local master browser for a subnet, synchronizing its
browse list with the domain master browser.</p>
</div>
</div>
<div class="sect1"><a name="samba2-CHP-1-SECT-6"/>
<h2 class="head1">What's New in Samba 2.2?</h2>
<p><a name="INDEX-202"/><a name="INDEX-203"/>In
Version 2.2, Samba has more advanced support for Windows networking,
including the ability to perform the more important tasks necessary
for acting in a Windows NT domain. In addition, Samba 2.2 has some
support for technologies that Microsoft introduced in Windows 2000,
although the Samba team has saved Active Directory support for
Version 3.0.</p>
<div class="sect2"><a name="samba2-CHP-1-SECT-6.1"/>
<h3 class="head2">PDC Support for Windows 2000/XP Clients</h3>
<p>Samba previously could act as a PDC to authenticate Windows 95/98/Me
and Windows NT 4 systems. This functionality has been extended in
Release 2.2 to include Windows 2000 and Windows XP. Thus, it is
possible to have a Samba server supporting domain logons for a
network of Windows clients, including the most recent releases from
Microsoft. This can result in a very stable, high-performance, and
more secure network, and gives you the added benefit of not having to
purchase per-seat Windows CALs from Microsoft.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-6.2"/>
<h3 class="head2">Microsoft Dfs Support</h3>
<p><a name="INDEX-204"/>Microsoft Dfs allows shared resources that
are dispersed among a number of servers in the network to be gathered
together and appear to users as if they all exist in a single
directory tree on one server. This method of organization makes life
much simpler for users. Instead of having to browse around the
network on a treasure hunt to locate the resource they want to use,
they can go directly to the Dfs server and grab what they want. Samba
2.2 offers support for serving Dfs, so a Windows server is no longer
needed for this purpose.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-6.3"/>
<h3 class="head2">Windows NT/2000/XP Printing Support</h3>
<p>Windows NT/2000/XP has a different Remote Procedure Call (RPC)-based
printer interface than Windows 95/98/Me does. In Samba 2.2, the
Windows NT/2000/XP interface is supported. Along with this, the Samba
team has been adding support for automatically downloading the
printer driver from the Samba server while adding a new printer to a
Windows client.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-6.4"/>
<h3 class="head2">ACLs</h3>
<p>Samba now supports
<a name="INDEX-205"/>ACLs on its Unix host for Unix variants
that support them. The list includes Solaris 2.6, 7, and 8, Irix,
AIX, Linux (with either the ACL patch for the
<a name="INDEX-206"/>ext2/ext3 filesystem from <a href="http://acl.bestbits.at">http://acl.bestbits.at</a> or when using the
<a name="INDEX-207"/>XFS
filesystem), and FreeBSD (Version 5.0 and later). When using ACL
support, Samba translates between Unix ACLs and Windows NT/2000/XP
ACLs, making the Samba host look and act more like a Windows
NT/2000/XP server from the point of view of Windows clients.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-6.5"/>
<h3 class="head2">Support for Windows Client Administration Tools</h3>
<p>Windows comes with tools that can be used from a client to manage
shared resources remotely on a Windows server. Samba 2.2 allows these
tools to operate on shares on the Samba server as well.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-6.6"/>
<h3 class="head2">Integration with Winbind</h3>
<p><a name="INDEX-208"/>Winbind is a
facility that allows users whose account information is stored in a
Windows domain database to authenticate on a Unix system. The result
is a unified logon environment, in which a user account can be kept
on either the Unix system or a Windows NT/2000 domain controller.
This greatly facilitates account management because administrators no
longer need to keep the two systems synchronized, and it is possible
for users whose accounts are held in a Windows domain to authenticate
when accessing Samba shares.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-6.7"/>
<h3 class="head2">Unix CIFS Extensions</h3>
<p>The <a name="INDEX-209"/><a name="INDEX-210"/>Unix CIFS extensions were developed
at Hewlett-Packard and introduced in Samba 2.2.4. They allow Samba
servers to support Unix filesystem attributes, such as links and
permissions, when sharing files with other Unix systems. This allows
Samba to be used as an alternative to network file sharing (NFS) for
Unix-to-Unix file sharing. An advantage of using Samba is that it
authenticates individual users, whereas NFS authenticates only
clients (based on their IP addresses, which is a poor security
model). This gives Samba an edge in the area of security, along with
its much greater configurability. See <a href="ch05.html">Chapter 5</a>
for information on how to operate Unix systems as Samba clients.</p>
</div>
<div class="sect2"><a name="samba2-CHP-1-SECT-6.8"/>
<h3 class="head2">And More...</h3>
<p>As usual, the code has numerous improvements that do not show up at
the administrative level in an immediate or obvious way. Samba now
functions better on systems that employ <a name="INDEX-211"/>PAM
(Pluggable Authentication Modules), and there is new support for
profiling. Samba's support for oplocks has been
strengthened, offering better integration with NFS server-terminated
leases (currently on Irix and Linux only) and in the local filesystem
with SMB locks mapped to POSIX locks (which is dependent on each Unix
variant's implementation of POSIX locks). And of
course there have been the usual bug fixes.</p>
</div>
</div>
<div class="sect1"><a name="samba2-CHP-1-SECT-7"/>
<h2 class="head1">What's New in Samba 3.0?</h2>
<p>The main distinguishing feature of <a name="INDEX-212"/><a name="INDEX-213"/>Samba 3.0
is that it includes support for <a name="INDEX-214"/>Kerberos 5 authentication and
<a name="INDEX-215"/>LDAP, which are
required to act as clients in an Active Directory domain. Another
feature that appeared in Samba 3.0 is support for Unicode, which
greatly simplifies supporting international languages.</p>
<p>In later Version 3 releases, the Samba team plans to develop support
for
<a name="INDEX-216"/>WINS
replication, allowing Samba to act as a secondary WINS server or as a
primary WINS server with Windows or Samba secondary WINS servers.
Also planned are support for acting as a Windows NT BDC and support
for Windows NT domain trust relationships.</p>
</div>
<div class="sect1"><a name="samba2-CHP-1-SECT-8"/>
<h2 class="head1">What Can Samba Do?</h2>
<p>Now let's wrap up by showing where Samba can help
out and where it is limited. <a href="ch01.html#samba2-CHP-1-TABLE-9">Table 1-9</a> summarizes
which roles Samba can and cannot play in a Windows NT or Active
Directory domain or a Windows workgroup. Many of the Windows domain
protocols are proprietary and have not been documented by Microsoft
and therefore must be reverse-engineered by the Samba team before
Samba can support them. As of Version 3.0, Samba cannot act as a
backup in most roles and does not yet fully support Active Directory.</p>
<a name="samba2-CHP-1-TABLE-9"/><h4 class="head4">Table 1-9. Samba roles (as of Version 3.0)</h4><table border="1">
<tr>
<th>
<p>Role</p>
</th>
<th>
<p>Can perform?</p>
</th>
</tr>
<tr>
<td>
<p><a name="INDEX-217"/>File server</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p>Printer server</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p>Microsoft Dfs server</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p>Primary domain controller</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p>Backup domain controller</p>
</td>
<td>
<p>No</p>
</td>
</tr>
<tr>
<td>
<p>Active Directory domain controller</p>
</td>
<td>
<p>No</p>
</td>
</tr>
<tr>
<td>
<p>Windows 95/98/Me authentication</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p>Windows NT/2000/XP authentication</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p>Local master browser</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p>Local backup browser</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p>Domain master browser</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p>Primary WINS server</p>
</td>
<td>
<p>Yes</p>
</td>
</tr>
<tr>
<td>
<p>Secondary WINS server</p>
</td>
<td>
<p>No</p>
</td>
</tr>
</table>
</div>
<div class="sect1"><a name="samba2-CHP-1-SECT-9"/>
<h2 class="head1">An Overview of the Samba Distribution</h2>
<p><a name="INDEX-218"/>As mentioned earlier, Samba actually
contains several programs that serve different but related purposes.
These programs are documented more fully in <a href="appc.html">Appendix C</a>. For now, we will introduce each of them
briefly and describe how they work together.</p>
<p>The majority of the programs that come with Samba center on its two
daemons. Let's take a refined look at the
responsibilities of each daemon:</p>
<dl>
<dt><b><em class="emphasis">nmbd</em></b></dt>
<dd>
<p>The <em class="emphasis">nmbd</em><a name="INDEX-219"/> daemon is a simple name server that
supplies WINS functionality. This daemon listens for name-server
requests and provides the appropriate IP addresses when called upon.
It also provides browse lists for the Network Neighborhood and
participates in browsing elections.</p>
</dd>
<dt><b><em class="emphasis">smbd</em></b></dt>
<dd>
<p>The <em class="emphasis">smbd</em><a name="INDEX-220"/> daemon manages the shared resources
between the Samba server and its clients. It provides file, print,
and browse services to <span class="acronym">SMB</span> clients across one or
more networks and handles all notifications between the Samba server
and the network clients. In addition, it is responsible for user
authentication, resource locking, and data sharing through the
<span class="acronym">SMB</span> protocol.</p>
</dd>
</dl>
<p>New with Version 2.2, there is an additional daemon:</p>
<dl>
<dt><b><a name="INDEX-221"/><em class="emphasis">winbindd</em></b></dt>
<dd>
<p>This daemon is used along with the name service switch to get
information on users and groups from a Windows NT server and allows
Samba to authorize users through a Windows NT/2000 server.</p>
</dd>
</dl>
<p>The Samba distribution also comes with a small set of Unix
command-line tools:</p>
<dl>
<dt><b><em class="emphasis">findsmb</em><a name="INDEX-222"/></b></dt>
<dd>
<p>A program that searches the local network for computers that respond
to SMB protocol and prints information on them.</p>
</dd>
<dt><b><em class="emphasis">make_smbcodepage</em><a name="INDEX-223"/></b></dt>
<dd>
<p>A program used when working with Samba's
internationalization features for telling Samba how to convert
between upper- and lowercase in different character sets.</p>
</dd>
<dt><b><em class="emphasis">make_unicodemap</em><a name="INDEX-224"/></b></dt>
<dd>
<p>Another internationalization program used with Samba for compiling
Unicode map files that Samba uses to translate DOS codepages or Unix
character sets into 16-bit unicode.</p>
</dd>
<dt><b><a name="INDEX-225"/><em class="emphasis">net</em></b></dt>
<dd>
<p>A new program distributed with Samba 3.0 that can be used to perform
remote administration of servers.</p>
</dd>
<dt><b><em class="emphasis">nmblookup</em><a name="INDEX-226"/></b></dt>
<dd>
<p>A program that provides NBT name lookups to find a
computer's IP address when given its machine name.</p>
</dd>
<dt><b><a name="INDEX-227"/><em class="emphasis">pdbedit</em></b></dt>
<dd>
<p>A new program distributed with Samba 3.0 that is helpful for managing
user accounts held in SAM databases.</p>
</dd>
<dt><b><em class="emphasis">rpcclient</em><a name="INDEX-228"/></b></dt>
<dd>
<p>A program that can be used to run MS-RPC functions on Windows clients.</p>
</dd>
<dt><b><em class="emphasis">smbcacls</em><a name="INDEX-229"/></b></dt>
<dd>
<p>A program that is used to set or show ACLs on Windows NT filesystems.</p>
</dd>
<dt><b><em class="emphasis">smbclient</em><a name="INDEX-230"/></b></dt>
<dd>
<p>An <em class="emphasis">ftp</em>-like Unix client that can be used to connect to
SMB shares and operate on them. The <em class="emphasis">smbclient</em>
command is discussed in detail in <a href="ch05.html">Chapter 5</a>.</p>
</dd>
<dt><b><em class="emphasis">smbcontrol</em><a name="INDEX-231"/></b></dt>
<dd>
<p>A simple administrative utility that sends messages to <em class="emphasis">nmbd</em>
or <em class="emphasis">smbd</em>.</p>
</dd>
<dt><b><a name="INDEX-232"/><em class="emphasis">smbgroupedit</em></b></dt>
<dd>
<p>A command that can be used to define mappings between Windows NT
groups and Unix groups. It is new in Samba 3.0.</p>
</dd>
<dt><b><em class="emphasis">smbmnt</em><a name="INDEX-233"/></b></dt>
<dd>
<p>A helper utility used along with <em class="emphasis">smbmount.</em></p>
</dd>
<dt><b><em class="emphasis">smbmount</em><a name="INDEX-234"/></b></dt>
<dd>
<p>A program that mounts an smbfs filesystem, allowing remote SMB shares
to be mounted in the filesystem of the Samba host.</p>
</dd>
<dt><b><em class="emphasis">smbpasswd</em><a name="INDEX-235"/></b></dt>
<dd>
<p>A program that allows an administrator to change the passwords used
by Samba.</p>
</dd>
<dt><b><em class="emphasis">smbsh</em><a name="INDEX-236"/></b></dt>
<dd>
<p>A tool that functions like a command shell to allow access to a
remote SMB filesystem and allow Unix utilities to operate on it. This
command is covered in <a href="ch05.html">Chapter 5</a>.</p>
</dd>
<dt><b><em class="emphasis">smbspool</em><a name="INDEX-237"/></b></dt>
<dd>
<p>A print-spooling program used to send files to remote printers that
are shared on the SMB network.</p>
</dd>
<dt><b><em class="emphasis">smbstatus</em><a name="INDEX-238"/></b></dt>
<dd>
<p>A program that reports the current network connections to the shares
on a Samba server.</p>
</dd>
<dt><b><em class="emphasis">smbtar</em><a name="INDEX-239"/></b></dt>
<dd>
<p>A program similar to the Unix <em class="filename">tar</em> command, for
backing up data in SMB shares.</p>
</dd>
<dt><b><em class="emphasis">smbumount</em><a name="INDEX-240"/></b></dt>
<dd>
<p>A program that works along with <em class="emphasis">smbmount</em> to unmount
smbfs filesystems.</p>
</dd>
<dt><b><em class="emphasis">testparm</em><a name="INDEX-241"/></b></dt>
<dd>
<p>A simple program for checking the Samba configuration file.</p>
</dd>
<dt><b><em class="emphasis">testprns</em><a name="INDEX-242"/></b></dt>
<dd>
<p>A program that tests whether printers on the Samba host are
recognized by the <em class="filename">smbd</em> daemon.</p>
</dd>
<dt><b><em class="emphasis">wbinfo</em><a name="INDEX-243"/></b></dt>
<dd>
<p>A utility used to query the <em class="filename">winbindd
</em><a name="INDEX-244"/>daemon.</p>
</dd>
</dl>
<p>Each major release of Samba goes through an exposure test before
it's announced. In addition, it is quickly updated
afterward if problems or unwanted side effects are found. The latest
stable distribution as of this writing is Samba 2.2.6, and this book
focuses mainly on the functionality supported in Samba 2.2.6, as
opposed to older versions of Samba.</p>
</div>
<div class="sect1"><a name="samba2-CHP-1-SECT-10"/>
<h2 class="head1">How Can I Get Samba?</h2>
<p><a name="INDEX-245"/><a name="INDEX-246"/>Source
and binary distributions of Samba are available from mirror sites
across the Internet. The primary web site for Samba is located at
<a href="http://www.samba.org/">http://www.samba.org/</a>. From there, you
can select a mirror site that is geographically near you.</p>
<p>Most Linux and many Unix vendors provide binary packages. These can
be more convenient to install and maintain than the Samba
team's source or binary packages, due to the
vendor's efforts to supply a package that matches
its specific products. <a name="INDEX-247"/></p>
</div>
<hr/><h4 class="head4">Footnotes</h4><blockquote><a name="FOOTNOTE-1"/> <p><a href="#FNPTR-1">[1]</a> You
can also right-click the shared resource in the Network Neighborhood
and then select the Map Network Drive menu item.</p> <a name="FOOTNOTE-2"/> <p><a href="#FNPTR-2">[2]</a> Be
warned that many end-user license agreements forbid installing a
program on a network so that multiple clients can access it. Check
the legal agreements that accompany the product to be absolutely
sure.</p> <a name="FOOTNOTE-3"/> <p><a href="#FNPTR-3">[3]</a> You
might also see the abbreviation NetBT, which is common in Microsoft
literature.</p> <a name="FOOTNOTE-4"/>
<p><a href="#FNPTR-4">[4]</a> See
<a href="http://www.samba.org/cifs/docs/what-is-smb.html">http://www.samba.org/cifs/docs/what-is-smb.html</a>
for Richard's excellent summary of
<a name="INDEX-93"/>SMB.</p> <a name="FOOTNOTE-5"/> <p><a href="#FNPTR-5">[5]</a> This
was originally called <a name="INDEX-126"/><a name="INDEX-127"/><a name="INDEX-128"/>Network Neighborhood in Windows 95/98/NT,
but Microsoft has changed the name to My Network Places in the more
recent Windows Me/2000/XP. We will continue to call it Network
Neighborhood, and if you're using a new version of
Windows, be aware that My Network Places can act a little differently
in some ways.</p> </blockquote>
<hr/><h4 class="head4"><a href="toc.html">TOC</a></h4>
</body></html>
|