| 12
 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
 
 | <?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
<chapter id="simple">
  <title>No-Frills Samba Servers</title>
	<para>
	This is the start of the real journey toward the successful deployment of Samba. For some this chapter
	is the end of the road because their needs will have been adequately met. For others, this chapter is
	the beginning of a journey that will take them well past the contents of this book. This book provides
	example configurations of, for the greater part, complete networking solutions. The intent of this book
	is to help you to get your Samba installation working with the least amount of pain and aggravation.
	</para>
<sect1>
	<title>Introduction</title>
	<para>
	This chapter lays the groundwork for understanding the basics of Samba operation. 
	Instead of a bland technical discussion, each principle is demonstrated by way of a 
	real-world scenario for which a working solution<footnote><para>The examples given mirror those documented
	in The Official Samba-3 HOWTO and Reference Guide, Second Edition (TOSHARG2) Chapter 2, Section 2.3.1. You may gain additional
	insight from the standalone server configurations covered in TOSHARG2, sections 2.3.1.2 through 2.3.1.4.
	</para></footnote> is fully described.
	</para>
	<para>
	The practical exercises take you on a journey through a drafting office, a charity administration
	office, and an accounting office. You may choose to apply any or all of these exercises to your own environment.
	</para>
	<para>
	Every assignment case can be implemented far more creatively, but remember that the solutions you
	create are designed to demonstrate a particular solution possibility. With experience, you should
	find much improved solutions compared with those presented here. By the time you complete this book,
	you should aim to be a Samba expert, so do attempt to find better solutions and try them as you work your
	way through the examples.
	</para>
</sect1>
<sect1>
	<title>Assignment Tasks</title>
	<para>
	Each case presented highlights different aspects of Windows networking for which a simple 
	Samba-based solution can be provided. Each has subtly different requirements taken from real-world cases.
	The cases are briefly reviewed to cover important points. Instructions are based
	on the assumption that the official Samba Team RPM package has been installed.
	</para>
	<para>
	This chapter has three assignments built around fictitious companies: 
	</para>
	<para>
	<itemizedlist>
		<listitem><para>A drafting office</para></listitem>
		<listitem><para>A charity administration office</para></listitem>
		<listitem><para>An accounting office</para></listitem>
	</itemizedlist>
	</para>
	<para>
	Let's get started.
	</para>
	<sect2>
	<title>Drafting Office</title>
	<para>
	Our fictitious company is called <emphasis>Abmas Design, Inc.</emphasis> This is a three-person
	computer-aided design (CAD) business that often has more work than can be handled. The 
	business owner hires contract draftspeople from wherever he can. They bring their own 
	notebook computers into the office. There are four permanent drafting machines. Abmas has a 
	collection of over 10 years of plans that must be available for all draftsmen to reference. 
	Abmas hires the services of an experienced network engineer to update the 
	plans that are stored on a central server one day per month. She knows how to upload 
	plans from each machine. The files available from the server must remain read-only. 
	Anyone should be able to access the plans at any time and without barriers or difficulty.
	</para>
	<para><indexterm><primary>Red Hat</primary></indexterm>
		<indexterm><primary>Fedora</primary></indexterm>
	Mr. Bob Jordan has asked you to install the new server as economically as possible. The central
	server has a Pentium-IV 1.6GHz CPU, 768MB RAM, a 20GB IDE boot drive, a 160GB IDE second disk
	to store plans, and a 100-base-T Ethernet card. You have already installed Red Hat Fedora CoreX and
	have upgraded Samba to version 3.0.20 using the RPM package that is provided from the Samba
	<ulink url="http://www.samba.org">FTP</ulink> sites. (Note: Fedora CoreX indicates your favorite
	version.)
	</para>
	<para><indexterm>
	    <primary>consultant</primary>
	  </indexterm>
	The four permanent drafting machines (Microsoft Windows workstations) have attached printers 
	and plotters that are shared on a peer-to-peer basis by any and all network users. The intent 
	is to continue to share printers in this manner. The three permanent staff work together with 
	all contractors to store all new work on one PC. A daily copy is made of the work storage 
	area to another PC for safekeeping.  When the network consultant arrives, the weekly work 
	area is copied to the central server and the files are removed from the main weekly storage 
	machine. The office works best with this arrangement and does not want to change anything. 
	Old habits are too ingrained.
	</para>
		<sect3>
		<title>Dissection and Discussion</title>
		<para>
		<indexterm><primary>file server</primary><secondary>read-only</secondary></indexterm>
		The requirements for this server installation demand simplicity. An anonymous read-only
		file server adequately meets all needs. The network consultant determines how
		to upload all files from the weekly storage area to the server. This installation should
		focus only on critical aspects of the installation.
		</para>
		<para>
		It is not necessary to have specific users on the server. The site has a method for storing
		all design files (plans). Each plan is stored in a directory that is named YYYYWW,<footnote><para>
		This information is given purely as an example of how data may be stored in such a way that it
		will be easy to locate records at a later date. The example is not meant to imply any instructions
		that may be construed as essential to the design of the solution; this is something you will almost
		certainly want to determine for yourself.</para></footnote> where
		YYYY is the year, and WW is the week of the year. This arrangement allows work to be stored
		by week of year to preserve the filing technique the site is familiar with.
		There is also a customer directory that is alphabetically listed. At the top level are 26
		directories (A-Z), in each is a second-level of directory for the first plus second letters of the name
		(A-Z); inside each is a directory by the customers' name. Inside each directory is a symbolic
		link to each design drawing or plan. This way of storing customer data files permits all
		plans to be located both by customer name and by the date the work was performed, without
		demanding the disk space that would be needed if a duplicate file copy were to be stored. 
		The share containing the plans is called <emphasis>Plans</emphasis>.
		</para>
		</sect3>
		<sect3>
		<title>Implementation</title>
		<para>
		It is assumed that the server is fully installed and ready for installation and 
		configuration of Samba 3.0.20 and any support files needed. All TCP/IP addresses 
		have been hard-coded. In our case the IP address of the Samba server is 
		<constant>192.168.1.1</constant> and the netmask is <constant>255.255.255.0</constant>. 
		The hostname of the server used is <constant>server</constant>.
		</para>
		<procedure>
		<title>Samba Server Configuration</title>
			<step><para>
			Download the Samba-3 RPM packages for Red Hat Fedora Core2 from the Samba
			<ulink url="http://www.samba.org">FTP servers.</ulink>
			</para></step>
			<step><para>
			<indexterm><primary>RPM</primary><secondary>install</secondary></indexterm>
			<indexterm><primary>package</primary></indexterm>
			Install the RPM package using either the Red Hat Linux preferred GUI
			tool or the <command>rpm</command>:
<screen>
&rootprompt; rpm -Uvh samba-3.0.20-1.i386.rpm
</screen>
			</para></step>
			<step><para>
			Create a mount point for the file system that will be used to store all data files.
			You can create a directory called <filename>/plans</filename>:
<screen>
&rootprompt; mkdir /plans
&rootprompt; chmod 755 /plans
</screen>
			The 755 permissions on this directory (mount point) permit the owner to read, write,
			and execute, and the group and everyone else to read and execute only.
			</para>
			<para>
			<indexterm><primary>file system</primary><secondary>Ext3</secondary></indexterm>
			Use Red Hat Linux system tools (refer to Red Hat instructions)
			to format the 160GB hard drive with a suitable file system. An Ext3 file system
			is suitable. Configure this drive to automatically mount using the <filename>/plans</filename>
			directory as the mount point.
			</para></step>
			<step><para>
			Install the &smb.conf; file shown in <link linkend="draft-smbconf"/> in the
			<filename>/etc/samba</filename> directory.
<example id="draft-smbconf">
<title>Drafting Office &smb.conf; File</title>
<smbconfblock>
<smbconfcomment>Global Parameters</smbconfcomment>
<smbconfsection name="[global]"/>
<smbconfoption name="workgroup">MIDEARTH</smbconfoption>
<smbconfoption name="security">SHARE</smbconfoption>
<smbconfsection name="[Plans]"/>
<smbconfoption name="path">/plans</smbconfoption>
<smbconfoption name="read only">Yes</smbconfoption>
<smbconfoption name="guest ok">Yes</smbconfoption>
</smbconfblock>
</example>
			</para></step>
			<step><para>
			<indexterm><primary>/etc/hosts</primary></indexterm>
			Verify that the <filename>/etc/hosts</filename> file contains the following entry:
<screen>
192.168.1.1	server
</screen>
			</para></step>
			<step><para>
			<indexterm><primary>samba</primary><secondary>starting samba</secondary></indexterm>
			<indexterm><primary>chkconfig</primary></indexterm>
			<indexterm><primary>starting samba</primary></indexterm>
			Use the standard system tool to start Samba and to configure it to restart
			automatically at every system reboot. For example,
<screen>
&rootprompt; chkconfig smb on
&rootprompt; /etc/rc.d/init.d/smb restart
</screen>
			</para></step>
		</procedure>
		<procedure>
		<title>Windows Client Configuration</title>
			<step><para>
			Make certain that all clients are set to the same network address range as
			used for the Samba server. For example, one client might have an IP
			address 192.168.1.10.
			</para></step>
			<step><para>
			<indexterm><primary>netmask</primary></indexterm>
			Ensure that the netmask used on the Windows clients matches that used
			for the Samba server. All clients must have the same netmask, such as
			255.255.255.0.
			</para></step>
			<step><para>
			<indexterm><primary>workgroup</primary></indexterm>
			Set the workgroup name on all clients to <constant>MIDEARTH</constant>.
			</para></step>
			<step><para>
			Verify on each client that the machine called <constant>SERVER</constant>
			is visible in the <guimenu>Network Neighborhood</guimenu>, that it is
			possible to connect to it and see the share <guimenuitem>Plans</guimenuitem>,
			and that it is possible to open that share to reveal its contents.
			</para></step>
		</procedure>
		</sect3>
		<sect3 id="validate1">
		<title>Validation</title>
		<para>
		<indexterm><primary>validation</primary></indexterm>
		The first priority in validating the new Samba configuration should be to check
		that Samba answers on the loop-back interface. Then it is time to check that Samba
		answers its own name correctly. Last, check that a client can connect to the Samba
		server.
		</para>
		<procedure>
			<step><para>
			<indexterm><primary>smbd</primary></indexterm>
			<indexterm><primary>daemon</primary></indexterm>
			<indexterm><primary>smbclient</primary></indexterm>
			To check the ability to access the <command>smbd</command> daemon
			services, execute the following:
<screen>
&rootprompt; smbclient -L localhost -U%
        Sharename     Type     Comment
        ---------     ----     -------
        Plans         Disk
        IPC$          IPC      IPC Service (Samba 3.0.20)
        ADMIN$        IPC      IPC Service (Samba 3.0.20)
        Server             Comment
        ---------          -------
        SERVER             Samba 3.0.20
        Workgroup          Master
        ---------          --------
        MIDEARTH           SERVER 
</screen>
			<indexterm><primary>loopback</primary></indexterm>
			<indexterm><primary>NULL connection</primary></indexterm>
			This indicates that Samba is able to respond on the loopback interface to
			a NULL connection. The <parameter>-U%</parameter> means send an empty
			username and an empty password. This command should be repeated after
			Samba has been running for 15 minutes.
			</para></step>
			<step><para>
			Now verify that Samba correctly handles being passed a username
			and password, and that it answers its own name. Execute the following:
<screen>
&rootprompt; smbclient -L server -Uroot%password
</screen>
			The output should be identical to the previous response. Samba has been
			configured to ignore all usernames given; instead it uses the
			<parameter>guest account</parameter> for all connections.
			</para></step>
			<step><para>
			<indexterm><primary>Windows Explorer</primary></indexterm>
			<indexterm><primary>Network Neighborhood</primary></indexterm>
			From the Windows 9x/Me client, launch Windows Explorer: 
			<menuchoice>
				<guiicon>[Desktop: right-click] Network Neighborhood</guiicon>
				<guimenu>Explore</guimenu>
				<guimenuitem>[Left Panel]  [+] Entire Network</guimenuitem>
				<guimenuitem>[Left Panel] [+] Server</guimenuitem>
				<guimenuitem>[Left Panel] [+] Plans</guimenuitem>
			</menuchoice>. In the right panel you should see the files and directories
			(folders) that are in the <guiicon>Plans</guiicon> share.
			</para></step>
		</procedure>
		</sect3>
	</sect2>
	<sect2>
	<title>Charity Administration Office</title>
	<para>
	The fictitious charity organization is called <emphasis>Abmas Vision NL</emphasis>. This office
	has five networked computers. Staff are all volunteers, staff changes are frequent.
	Ms. Amy May, the director of operations, wants a no-hassle network. Anyone should be able to
	use any PC. Only two Windows applications are used: a custom funds tracking and management package
	that stores all files on the central server and Microsoft Word. The office prepares mail-out
	letters, invitations, and thank-you notes. All files must be stored in perpetuity.
	The custom funds tracking and management (FTM) software is configured to use a server named
	<constant>SERVER</constant>, a share named <constant>FTMFILES</constant>, and a printer queue
	named <constant>PRINTQ</constant> that uses preprinted stationery, thus demanding a
	dedicated printer. This printer does not need to be mapped to a local printer on the workstations.
	</para>
	<para>
	The FTM software has been in use since the days of Windows 3.11. The software was configured
	by the vendor who has since gone out of business. The identities of the file
	server and the printer are hard-coded in a configuration file that was created using a
	setup tool that the vendor did not provide to Abmas Vision NL or to its predecessors. The
	company that produced the software is no longer in business. In order to avoid risk of
	any incompatibilities, the share name and the name of the target print queue must be set
	precisely as the application expects. In fact, share names and print queue names
	should be treated as case insensitive (i.e., case does not matter), but Abmas Vision advises
	that if the share name is not in lowercase, the application claims it cannot find the
	file share.
	</para>
	<para>
	<indexterm><primary>print queue</primary></indexterm>
	<indexterm><primary>print spooler</primary></indexterm>
	Printer handling in Samba results in a significant level of confusion. Samba presents to the
	MS Windows client only a print queue. The Samba <command>smbd</command> process passes a
	print job sent to it from the Windows client to the native UNIX printing system. The native
	UNIX printing system (spooler) places the job in a print queue from which it is
	delivered to the printer. In this book, network diagrams refer to a printer by the name 
	of the print queue that services that printer. It does not matter what the fully qualified 
	name (or the hostname) of a network-attached printer is. The UNIX print spooler is configured 
	to correctly deliver all jobs to the printer.
	</para>
	<para>
	This organization has a policy forbidding use of privately owned computers on site as a measure
	to prevent leakage of confidential information. Only the five PCs owned by Abmas Vision NL are
	used on this network.
	</para>
	<para>
	<indexterm><primary>SUSE Enterprise Linux Server</primary></indexterm>
	The central server was donated by a local computer store. It is a dual processor Pentium-III
	server, has 1GB RAM, a 3-Ware IDE RAID Controller that has four 200GB IDE hard drives, and a
	100-base-T network card. The office has 100-base-T permanent network connections that go to
	a central hub, and all equipment is new. The five network computers all are equipped with Microsoft
	Windows Me. Funding is limited, so the server has no operating system on it. You have approval
	to install Samba on Linux, provided it works without problems. There are two HP LaserJet
	5 PS printers that are network connected.  The second printer is to be used for general
	office and letter printing. Your recommendation to allow only the Linux server to print directly
	to the printers was accepted. You have supplied SUSE Enterprise Linux Server 9 and
	have upgraded Samba to version 3.0.20.
	</para>
		<sect3>
		<title>Dissection and Discussion</title>
		<para>
		<indexterm><primary>force user</primary></indexterm>
		<indexterm><primary>nt acl support</primary></indexterm>
		<indexterm><primary>UID</primary></indexterm>
		<indexterm><primary>Posix</primary></indexterm>
		This installation demands simplicity. Frequent turnover of volunteer staff indicates that
		a network environment that requires users to logon might be problematic. It is suggested that the
		best solution for this office would be one where the user can log onto any PC with any username
		and password. Samba can accommodate an office like this by using the <parameter>force user</parameter>
		parameter in share and printer definitions. Using the <parameter>force user</parameter>
		parameter ensures that all files are owned by same user identifier (UID) and thus that there
		will never be a problem with file access due to file access permissions. Additionally, you elect
		to use the <parameter>nt acl support = No</parameter> option to ensure that
		access control lists (Posix type) cannot be written to any file or directory. This prevents
		an inadvertent ACL from overriding actual file permissions.
		</para>
		<para>
		<indexterm><primary>SUID</primary></indexterm>
		<indexterm><primary>SGID</primary></indexterm>
		<indexterm><primary>security</primary><secondary>share mode</secondary></indexterm>
		This organization is a prime candidate for Share Mode security. The <parameter>force user</parameter>
		allows all files to be owned by the same user and group. In addition, it would not hurt to
		set SUID and set SGID shared directories. This means that all new files that are created, no matter
		who creates it, are owned by the owner or group of the directory in which they are created.
		For further information regarding the significance of the SUID/SGID settings, see <link
		linkend="appendix"/>, <link linkend="ch12-SUIDSGID"/>.
		</para>
		<para>
		<indexterm><primary>CUPS</primary></indexterm>
		<indexterm><primary>printing</primary><secondary>raw</secondary></indexterm>
		<indexterm><primary>Red Hat Linux</primary></indexterm>
		<indexterm><primary>SUSE Linux</primary></indexterm>
		All client workstations print to a print queue on the server. This ensures that print jobs
		continue to print in the event that a user shuts down the workstation immediately after
		sending a job to the printer. Today, both Red Hat Linux and SUSE Linux use CUPS-based printing. 
		Older Linux systems offered a choice between the LPRng printing system or CUPS. It appears, however,
		that CUPS has become the leading UNIX printing technology.
		</para>
		<para>
		<indexterm><primary>print queue</primary></indexterm>
		The print queues are set up as <constant>Raw</constant> devices, which means that CUPS will 
		not do intelligent print processing, and vendor-supplied drivers must be installed locally on the 
		Windows clients.
		</para>
		<para>
		The hypothetical software, FTM, is representative of 
		custom-built software that directly uses a NetBIOS interface. Most such software originated in
		the days of MS/PC DOS. NetBIOS names are uppercase (and functionally are case insensitive), 
		so some old software applications would permit only uppercase names to be entered.
		Some such applications were later ported to MS Windows but retain the uppercase network
		resource naming conventions because customers are familiar with that. We made the decision
		to name shares and print queues for this application in uppercase for the same reason.
		Nothing would break if we were to use lowercase names, but that decision might create a need
		to retrain staff &smbmdash; something well avoided at this time.
		</para>
		<para>
		NetBIOS networking does not print directly to a printer. Instead, all printing is done to a
		print queue. The print spooling system is responsible for communicating with the physical
		printer. In this example, therefore, the resource called <constant>PRINTQ</constant>
		really is just a print queue. The name of the print queue is representative of
		the device to which the print spooler delivers print jobs.
		</para>
		</sect3>
		<sect3>
		<title>Implementation</title>
		<para>
		It is assumed that the server is fully installed and ready for configuration of
		Samba 3.0.20 and for necessary support files. All TCP/IP addresses should be hard-coded.
		In our case, the IP address of the Samba server is 192.168.1.1 and the netmask is
		255.255.255.0. The hostname of the server used is <constant>server</constant>.
		The office network is built as shown in <link linkend="charitynet"/>.
		</para>
		<figure id="charitynet">
			<title>Charity Administration Office Network</title>
			<imagefile scale="80">Charity-Network</imagefile>
		</figure>
		<procedure>
		<title>Samba Server Configuration</title>
			<step><para>
			<indexterm><primary>groupadd</primary></indexterm>
			Create a group account for office file storage:
<screen>
&rootprompt; groupadd office
</screen>
			</para></step>
			<step><para>
			<indexterm><primary>useradd</primary></indexterm>
			<indexterm><primary>passwd</primary></indexterm>
			Create a user account for office file storage:
<screen>
&rootprompt; useradd -m abmas 
&rootprompt; passwd abmas 
Changing password for abmas.
New password: XXXXXXXX
Re-enter new password: XXXXXXXX
Password changed
</screen>
			where XXXXXXXX is a secret password.
			</para></step>
				<step><para>
				Use the 3-Ware IDE RAID Controller firmware utilities to configure the four 200GB
				drives as a single RAID level 5 drive, with one drive set aside as the hot spare.
				(Refer to the 3-Ware RAID Controller Manual for the manufacturer's preferred procedure.)
				The resulting drive has a capacity of approximately 500GB of usable space.
				</para></step>
				<step><para>
				<indexterm><primary>permissions</primary></indexterm>
				Create a mount point for the file system that can be used to store all data files.
				Create a directory called <filename>/data</filename>:
<screen>
&rootprompt; mkdir /data
&rootprompt; chmod 755 /data
</screen>
				The 755 permissions on this directory (mount point) permit the owner to read, write, and execute,
				and the group and everyone else to read and execute only.
				</para></step>
				<step><para>
				Use SUSE Linux system tools (refer to the SUSE Administrators Guide for correct
				procedures) to format the partition with a suitable file system. The reiserfs file system
				is suitable. Configure this drive to automount using the <filename>/data</filename>
				directory as the mount point. It must be mounted before proceeding.
				</para></step>
				<step><para>
				Under the directory called <filename>/data</filename>, create two directories
				named <filename>ftmfiles</filename> and <filename>officefiles</filename>, and set
				ownership and permissions:
<screen>
&rootprompt; mkdir -p /data/{ftmfiles,officefiles/{letters,invitations,misc}}
&rootprompt; chown -R abmas:office /data
&rootprompt; chmod -R ug+rwxs,o-w,o+rx /data
</screen>
				These demonstrate compound operations. The <command>mkdir</command> command
 				creates in one step these directories:
<programlisting>
/data/fmtfiles
/data/officefiles
/data/officefiles/letters
/data/officefiles/invitations
/data/officefiles/misc
</programlisting>
				<indexterm><primary>TOSHARG2</primary></indexterm>
				The <command>chown</command> operation sets the owner to the user <constant>abmas</constant>
				and the group to <constant>office</constant> on all directories just created.  It recursively
				sets the permissions so that the owner and group have SUID/SGID with read, write, and execute
				permission, and everyone else has read and execute permission. This means that all files and
				directories are created with the same owner and group as the directory in which they are
				created. Any new directories created still have the same owner, group, and permissions as the
				directory they are in. This should eliminate all permissions-based file access problems.  For
				more information on this subject, refer to TOSHARG2<footnote>The Official Samba-3 HOWTO and
				Reference Guide, Chapter 15, File, Directory and Share Access Controls.</footnote> or refer
				to the UNIX man page for the <command>chmod</command> and the <command>chown</command> commands.
				</para></step>
				<step><para>
				Install the &smb.conf; file shown in <link linkend="charity-smbconfnew"/> in the
				<filename>/etc/samba</filename> directory. This newer &smb.conf; file uses user-mode security
				and is more suited to the mode of operation of Samba-3 than the older share-mode security
				configuration that was shown in the first edition of this book.
				</para>
				<para>
				Note: If you want to use the older-style configuration that uses share-mode security, you
				can install the file shown in <link linkend="charity-smbconf"/> in the
				<filename>/etc/samba</filename> directory.
				</para></step>
				<step><para>
				<indexterm><primary>smbd</primary></indexterm>
				We must ensure that the <command>smbd</command> can resolve the name of the Samba
				server to its IP address. Verify that the <filename>/etc/hosts</filename> file
				contains the following entry:
<screen>
192.168.1.1	server
</screen>
				</para></step>
				<step><para>
				Configure the printers with the IP address as shown in <link linkend="charitynet"/>.
				Follow the instructions in the manufacturer's manual to permit printing to port 9100
				so that the CUPS spooler can print using raw mode protocols.
				</para></step>
				<step><para>
				<indexterm><primary>lpadmin</primary></indexterm>
				Configure the CUPS Print Queues:
<screen>
&rootprompt; lpadmin -p PRINTQ -v socket://192.168.1.20:9100 -E
&rootprompt; lpadmin -p hplj5 -v socket://192.168.1.30:9100 -E
</screen>
				This creates the necessary print queues with no assigned print filter.
				</para></step>
				<step><para>
				<indexterm><primary>mime type</primary></indexterm>
				<indexterm><primary>/etc/cups/mime.convs</primary></indexterm>
				<indexterm><primary>application/octet-stream</primary></indexterm>
				Edit the file <filename>/etc/cups/mime.convs</filename> to uncomment the line:
<screen>
application/octet-stream     application/vnd.cups-raw      0     -
</screen>
				</para></step>
				<step><para>
				<indexterm><primary>/etc/cups/mime.types</primary></indexterm>
				Edit the file <filename>/etc/cups/mime.types</filename> to uncomment the line:
<screen>
application/octet-stream
</screen>
				</para></step>
				<step><para>
				<indexterm><primary>starting samba</primary></indexterm>
				Use the standard system tool to start Samba and CUPS to configure them to restart
				automatically at every system reboot. For example,
				</para>
				<para>
				<indexterm><primary>starting samba</primary></indexterm>
				<indexterm><primary>starting CUPS</primary></indexterm>
				<indexterm><primary>chkconfig</primary></indexterm>
<screen>
&rootprompt; chkconfig smb on
&rootprompt; chkconfig cups on
&rootprompt; /etc/rc.d/init.d/smb restart
&rootprompt; /etc/rc.d/init.d/cups restart
</screen>
				</para></step>
			</procedure>
<example id="charity-smbconfnew">
<title>Charity Administration Office &smb.conf; New-style File</title>
<smbconfblock>
<smbconfcomment>Global Parameters - Newer Configuration</smbconfcomment>
<smbconfsection name="[global]"/>
<smbconfoption name="workgroup">MIDEARTH</smbconfoption>
<smbconfoption name="printing">CUPS</smbconfoption>
<smbconfoption name="printcap name">CUPS</smbconfoption>
<smbconfoption name="map to guest">Bad User</smbconfoption>
<smbconfoption name="show add printer wizard">No</smbconfoption>
<smbconfoption name="wins support">yes</smbconfoption>
<smbconfsection name="[FTMFILES]"/>
<smbconfoption name="comment">Funds Tracking & Management Files</smbconfoption>
<smbconfoption name="path">/data/ftmfiles</smbconfoption>
<smbconfoption name="read only">No</smbconfoption>
<smbconfoption name="force user">abmas</smbconfoption>
<smbconfoption name="force group">office</smbconfoption>
<smbconfoption name="guest ok">Yes</smbconfoption>
<smbconfoption name="nt acl support">No</smbconfoption>
<smbconfsection name="[office]"/>
<smbconfoption name="comment">General Office Files</smbconfoption>
<smbconfoption name="path">/data/officefiles</smbconfoption>
<smbconfoption name="read only">No</smbconfoption>
<smbconfoption name="force user">abmas</smbconfoption>
<smbconfoption name="force group">office</smbconfoption>
<smbconfoption name="guest ok">Yes</smbconfoption>
<smbconfoption name="nt acl support">No</smbconfoption>
<smbconfsection name="[printers]"/>
<smbconfoption name="comment">Print Temporary Spool Configuration</smbconfoption>
<smbconfoption name="path">/var/spool/samba</smbconfoption>
<smbconfoption name="printable">Yes</smbconfoption>
<smbconfoption name="guest ok">Yes</smbconfoption>
<smbconfoption name="use client driver">Yes</smbconfoption>
<smbconfoption name="browseable">No</smbconfoption>
</smbconfblock>
</example>
<example id="charity-smbconf">
<title>Charity Administration Office &smb.conf; Old-style File</title>
<smbconfblock>
<smbconfcomment>Global Parameters - Older Style Configuration</smbconfcomment>
<smbconfsection name="[global]"/>
<smbconfoption name="workgroup">MIDEARTH</smbconfoption>
<smbconfoption name="security">SHARE</smbconfoption>
<smbconfoption name="printing">CUPS</smbconfoption>
<smbconfoption name="printcap name">CUPS</smbconfoption>
<smbconfoption name="disable spoolss">Yes</smbconfoption>
<smbconfoption name="show add printer wizard">No</smbconfoption>
<smbconfoption name="wins support">yes</smbconfoption>
<smbconfsection name="[FTMFILES]"/>
<smbconfoption name="comment">Funds Tracking & Management Files</smbconfoption>
<smbconfoption name="path">/data/ftmfiles</smbconfoption>
<smbconfoption name="read only">No</smbconfoption>
<smbconfoption name="force user">abmas</smbconfoption>
<smbconfoption name="force group">office</smbconfoption>
<smbconfoption name="guest ok">Yes</smbconfoption>
<smbconfoption name="nt acl support">No</smbconfoption>
<smbconfsection name="[office]"/>
<smbconfoption name="comment">General Office Files</smbconfoption>
<smbconfoption name="path">/data/officefiles</smbconfoption>
<smbconfoption name="read only">No</smbconfoption>
<smbconfoption name="force user">abmas</smbconfoption>
<smbconfoption name="force group">office</smbconfoption>
<smbconfoption name="guest ok">Yes</smbconfoption>
<smbconfoption name="nt acl support">No</smbconfoption>
<smbconfsection name="[printers]"/>
<smbconfoption name="comment">Print Temporary Spool Configuration</smbconfoption>
<smbconfoption name="path">/var/spool/samba</smbconfoption>
<smbconfoption name="printable">Yes</smbconfoption>
<smbconfoption name="guest ok">Yes</smbconfoption>
<smbconfoption name="use client driver">Yes</smbconfoption>
<smbconfoption name="browseable">No</smbconfoption>
</smbconfblock>
</example>
			<procedure>
			<title>Windows Client Configuration</title>
				<step><para>
				Configure clients to the network settings shown in <link linkend="charitynet"/>.
				</para></step>
				<step><para>
				Ensure that the netmask used on the Windows clients matches that used
				for the Samba server. All clients must have the same netmask, such as
				<constant>255.255.255.0</constant>.
				</para></step>
				<step><para>
				<indexterm><primary>WINS</primary></indexterm>
				On all Windows clients, set the WINS Server address to <constant>192.168.1.1</constant>,
				the IP address of the server.
				</para></step>
				<step><para>
				Set the workgroup name on all clients to <constant>MIDEARTH</constant>.
				</para></step>
				<step><para>
				<indexterm><secondary>logon</secondary></indexterm>
				Install the <quote>Client for Microsoft Networks.</quote> Ensure that the only option
				enabled in its properties is the option <quote>Logon and restore network connections.</quote>
				</para></step>
				<step><para>
				Click <guibutton>OK</guibutton> when you are prompted to reboot the system. Reboot the
				system, then log on using any username and password you choose.
				</para></step>
				<step><para>
				<indexterm><primary>My Network Places</primary></indexterm>
				Verify on each client that the machine called <constant>SERVER</constant>
				is visible in <guimenu>My Network Places</guimenu>, that it is
				possible to connect to it and see the share <guimenuitem>office</guimenuitem>,
				and that it is possible to open that share to reveal its contents.
				</para></step>
				<step><para>
				<indexterm><primary>password caching</primary></indexterm>
				<indexterm><primary>regedit</primary></indexterm>
				Disable password caching on all Windows 9x/Me machines using the registry change file
				shown in <link linkend="MEreg"/>. Be sure to remove all files that have the
				<filename>PWL</filename> extension that are in the <filename>C:\WINDOWS</filename>
				directory.
<example id="MEreg">
<title>Windows Me &smbmdash; Registry Edit File: Disable Password Caching</title>
<screen>
REGEDIT4
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\
	Windows\CurrentVersion\Policies\Network]
	"DisablePwdCaching"=dword:00000001
</screen>
</example>
				The best way to apply this change is to save the patch in a file called 
				<filename>ME-dpwc.reg</filename> and then execute:
<screen>
C:\WINDOWS: regedit ME-dpwc.reg
</screen>
				</para></step>
				<step><para>
				Instruct all users to log onto the workstation using a name and password of their own
				choosing. The Samba server has been
				configured to ignore the username and password given.
				</para></step>
				<step><para>
				On each Windows Me workstation, configure a network drive mapping to drive <filename>G:</filename>
				that redirects to the uniform naming convention (UNC) resource 
				<filename>\\server\office</filename>. Make this a permanent drive connection:
				</para>
					<procedure>
						<step><para>
							<menuchoice>
								Right-click <guimenu>My Network</guimenu>
								<guimenuitem>Map Network Drive...</guimenuitem>
							</menuchoice>
						</para></step>
						<step><para>
						In the box labeled <quote>Drive:</quote>, type G.
						</para></step>
						<step><para>
						In the box labeled <quote>Path:</quote>, enter 
						<filename>\\server\officefiles</filename>.
						</para></step>
						<step><para>
						Click <guimenuitem>Reconnect at logon</guimenuitem>.
						Click <guibutton>OK</guibutton>.
						</para></step>
					</procedure>
				</step>
				<step><para>
				On each workstation, install the FTM software following the
				manufacturer's instructions.
				</para>
					<procedure>
					<step><para>
					During installation, you are prompted for the name of the Windows 98
					server. Enter the name <constant>SERVER</constant>.
					</para></step>
					<step><para>
					You are prompted for the name of the data share.
					The prompt defaults to <constant>FTMFILES</constant>. Press enter to accept the default value.
					</para></step>
					<step><para>
					You are now prompted for the print queue name. The default prompt is the name of
					the server you entered (<constant>SERVER</constant> as follows:
					<constant>\\SERVER\PRINTQ</constant>). Simply accept the default and press enter to
					continue. The software now completes the installation.
					</para></step>
					</procedure>
				</step>
				<step><para>
				Install an office automation software package of the customer's choice. Either Microsoft
				Office 2003 Standard or OpenOffice 1.1.0 suffices for any functions the office may
				need to perform. Repeat this on each workstation.
				</para></step>
				<step><para>
				Install a printer on each workstation using the following steps:
				</para>
					<procedure>
						<step><para>
						Click <menuchoice>
							<guimenu>Start</guimenu>
							<guimenuitem>Settings</guimenuitem>
							<guimenuitem>Printers</guimenuitem>
							<guiicon>Add Printer</guiicon>
							<guibutton>Next</guibutton>
							</menuchoice>. Do not click <guimenuitem>Network printer</guimenuitem>.
							Ensure that <guimenuitem>Local printer</guimenuitem> is selected.
						</para></step>
						<step><para>
						Click <guibutton>Next</guibutton>. In the Manufacturer: panel, select
						<constant>HP</constant>. In the Printers: panel, select the printer called
						<constant>HP LaserJet 5/5M Postscript</constant>. Click <guibutton>Next</guibutton>.
						</para></step>
						<step><para>
						In the Available ports: panel, select <constant>FILE:</constant>. Accept the
						default printer name by clicking <guibutton>Next</guibutton>. When asked,
						<quote>Would you like to print a test page?</quote>, click
						<guimenuitem>No</guimenuitem>. Click <guibutton>Finish</guibutton>.
						</para></step>
						<step><para>
						You may be prompted for the name of a file to print to. If so, close the
						dialog panel. Right-click <menuchoice>
							<guiicon>HP LaserJet 5/5M Postscript</guiicon>
							<guimenuitem>Properties</guimenuitem>
							<guisubmenu>Details (Tab)</guisubmenu>
							<guimenuitem>Add Port</guimenuitem>
							</menuchoice>.
						</para></step>
						<step><para>
						In the Network panel, enter the name of
						the print queue on the Samba server as follows: <constant>\\SERVER\hplj5</constant>.
						Click <menuchoice> 
							<guibutton>OK</guibutton>
							<guibutton>OK</guibutton>
							</menuchoice> to complete the installation.
						</para></step>
						<step><para>
						It is a good idea to test the functionality of the complete installation before
						handing the newly configured network over to the Charity Administration Office
						for production use.
						</para></step>
					</procedure>
				</step>
			</procedure>
		</sect3>
		<sect3>
		<title>Validation</title>
		<para>
		Use the same validation process as was followed in <link linkend="validate1"/>.
		</para>
		</sect3>
	</sect2>
	<sect2 id="AccountingOffice">
	<title>Accounting Office</title>
	<para>
	Abmas Accounting is a 40-year-old family-run business. There are nine permanent
	computer users. The network clients were upgraded two years ago. All computers run Windows 2000
	Professional. This year the server will be upgraded from an old Windows NT4 server (actually
	running Windows NT4 Workstation, which worked fine for fewer than 10 users) that has
	run in workgroup (standalone) mode, to a new Linux server running Samba.
	</para>
	<para>
	The office does not want a Domain Server. Mr. Alan Meany wants to keep the Windows 2000 Professional
	clients running as workgroup machines so that any staff member can take a machine home and keep 
	working.  It has worked well so far, and your task is to replace the old server. All users have 
	their own workstation logon (you configured it that way when the machines were installed). 
	Mr. Meany wants the new system to operate the same way as the old Windows NT4 server &smbmdash; users 
	cannot access each others' files, but he can access everyone's files. Each person's work files are 
	in a separate share on the server. Users log on to their Windows workstation with their username 
	and enter an assigned password; they do not need to enter a password when accessing their files 
	on the server.
	</para>
	<para>
	<indexterm><primary>Red Hat Linux</primary></indexterm>
	The new server will run Red Hat Fedora Core2. You should install Samba-3.0.20 and 
	copy all files from the old system to the new one. The existing Windows NT4 server has a parallel
	port HP LaserJet 4 printer that is shared by all. The printer driver is installed on each
	workstation. You must not change anything on the workstations. Mr. Meany gave instructions to
	replace the server, <quote>but leave everything else alone to avoid staff unrest.</quote>
	</para>
	<para>
	You have tried to educate Mr. Meany and found that he has no desire to understand networking.
	He believes that Windows for Workgroups 3.11 was <quote>the best server Microsoft ever sold
	</quote> and that Windows NT and 2000 are <quote>too fang-dangled complex!</quote>
	</para>
		<sect3>
		<title>Dissection and Discussion</title>
			<para>
			<indexterm><primary>security</primary><secondary>user mode</secondary></indexterm>
			The requirements of this network installation are not unusual. The staff are not interested in the
			details of networking. Passwords are never changed. In this example solution, we demonstrate the use
			of User Mode security in a simple context. Directories should be set SGID to ensure that members
			of a common group can access the contents. Each user has his or her own share to which only they
			can connect. Mr. Meany's share will be a top-level directory above the share point for each employee.
			Mr. Meany is a member of the same group as his staff and can access their work files.
			The well-used HP LaserJet 4 is available as a service called <constant>hplj</constant>.
			</para>
			<para>
			You have finished configuring the new hardware and have just completed installation of Red Hat 
			Fedora Core2. Roll up your sleeves and let's get to work.
			</para>
		</sect3>
		<sect3 id="AcctgNet">
		<title>Implementation</title>
		<para>
		The workstations have fixed IP addresses. The old server runs Windows NT4 Workstation, so it 
		cannot be running as a WINS server. It is best that the new configuration preserves the same
		configuration. The office does not use Internet access, so security really is not an issue.
		</para>
		<para>
		The core information regarding the users, their passwords, the directory share point, and the
		share name is given in <link linkend="acctingnet"/>. The overall network topology is shown in
		<link linkend="acctingnet2"/>. All machines have been configured as indicated prior to the
		start of Samba configuration. The following prescriptive steps may now commence.
		</para>
		<figure id="acctingnet2">
			<title>Accounting Office Network Topology</title>
			<imagefile scale="85">AccountingNetwork</imagefile>
		</figure>
		<table id="acctingnet">
			<title>Accounting Office Network Information</title>
			<tgroup cols="6">
				<colspec align="left"/>
				<colspec align="left"/>
				<colspec align="left"/>
				<colspec align="left"/>
				<colspec align="left"/>
				<colspec align="left"/>
				<thead>
					<row>
						<entry>User</entry>
						<entry>Login-ID</entry>
						<entry>Password</entry>
						<entry>Share Name</entry>
						<entry>Directory</entry>
						<entry>Wkst</entry>
					</row>
				</thead>
				<tbody>
					<row>
						<entry>Alan Meany</entry>
						<entry>alan</entry>
						<entry>alm1961</entry>
						<entry>alan</entry>
						<entry>/data</entry>
						<entry>PC1</entry>
					</row>
					<row>
						<entry>James Meany</entry>
						<entry>james</entry>
						<entry>jimm1962</entry>
						<entry>james</entry>
						<entry>/data/james</entry>
						<entry>PC2</entry>
					</row>
					<row>
						<entry>Jeannie Meany</entry>
						<entry>jeannie</entry>
						<entry>jema1965</entry>
						<entry>jeannie</entry>
						<entry>/data/jeannie</entry>
						<entry>PC3</entry>
					</row>
					<row>
						<entry>Suzy Millicent</entry>
						<entry>suzy</entry>
						<entry>suzy1967</entry>
						<entry>suzy</entry>
						<entry>/data/suzy</entry>
						<entry>PC4</entry>
					</row>
					<row>
						<entry>Ursula Jenning</entry>
						<entry>ujen</entry>
						<entry>ujen1974</entry>
						<entry>ursula</entry>
						<entry>/data/ursula</entry>
						<entry>PC5</entry>
					</row>
					<row>
						<entry>Peter Pan</entry>
						<entry>peter</entry>
						<entry>pete1984</entry>
						<entry>peter</entry>
						<entry>/data/peter</entry>
						<entry>PC6</entry>
					</row>
					<row>
						<entry>Dale Roland</entry>
						<entry>dale</entry>
						<entry>dale1986</entry>
						<entry>dale</entry>
						<entry>/data/dale</entry>
						<entry>PC7</entry>
					</row>
					<row>
						<entry>Bertrand E Paoletti</entry>
						<entry>eric</entry>
						<entry>eric1993</entry>
						<entry>eric</entry>
						<entry>/data/eric</entry>
						<entry>PC8</entry>
					</row>
					<row>
						<entry>Russell Lewis</entry>
						<entry>russ</entry>
						<entry>russ2001</entry>
						<entry>russell</entry>
						<entry>/data/russell</entry>
						<entry>PC9</entry>
					</row>
				</tbody>
			</tgroup>
		</table>
		<procedure>
		<title>Migration from Windows NT4 Workstation System to Samba-3</title>
	    <step><para><indexterm>
		  <primary>migration</primary>
		</indexterm>
			Rename the old server from <constant>CASHPOOL</constant> to <constant>STABLE</constant>
			by logging onto the console as the <constant>Administrator</constant>. Restart the machine
			following system prompts.
			</para></step>
			<step><para>
			Name the new server <constant>CASHPOOL</constant> using the standard configuration method.
			Restart the machine following system prompts.
			</para></step>
			<step><para>
			Install the latest Samba-3 binary Red Hat Linux RPM that is available from the
			Samba FTP site.
			</para></step>
			<step><para>
			<indexterm><primary>group account</primary></indexterm>
			<indexterm><primary>groupadd</primary></indexterm>
			Add a group account for the office to use. Execute the following:
<screen>
&rootprompt; groupadd accts
</screen>
			</para></step>
			<step><para>
			Install the &smb.conf; file shown<footnote><para>This example uses the 
			<parameter>smbpasswd</parameter> file in an obtuse way, since the use of 
			the <parameter>passdb backend</parameter> has not been specified in the &smb.conf; 
			file. This means that you are depending on correct default behavior.</para></footnote> 
			in <link linkend="acctconf"/>.
			</para></step>
			<step><para>
			<indexterm><primary>useradd</primary></indexterm>
			<indexterm><primary>passwd</primary></indexterm>
			<indexterm><primary>smbpasswd</primary></indexterm>
			For each user who uses this system (see <link linkend="acctingnet"/>),
			execute the following:
<screen>
&rootprompt; useradd -m -G accts -c "Name of User" "LoginID"
&rootprompt; passwd "LoginID"
Changing password for user "LoginID"
New Password: XXXXXXXXX	<-- the password from the table
Retype new password: XXXXXXXXX
&rootprompt; smbpasswd -a "LoginID"
New SMB password: XXXXXXXXX <-- the password from the table
Retype new SMB password: XXXXXXXXX
Added user "LoginID"
</screen>
			</para></step>
			<step><para>
			<indexterm><primary>data storage</primary></indexterm>
			Create the directory structure for the file shares by executing the following:
<screen>
&rootprompt; mkdir -p /data
&rootprompt; chown alan /data
&rootprompt; for i in james suzy ujen peter dale eric jeannie russ
> do
> 	mkdir -p /data/$i
> 	chown $i /data/$i
> done
&rootprompt; chgrp -R accts /data
&rootprompt; chmod -R ug+rwxs,o-r+x /data
</screen>
			The data storage structure is now prepared for use.
			</para></step>
			<step><para>
			<indexterm><primary>lpadmin</primary></indexterm>
			Configure the CUPS Print Queues:
<screen>
&rootprompt; lpadmin -p hplj -v parallel:/dev/lp0 -E
</screen>
			This creates the necessary print queues with no assigned print filter.
			</para></step>
			<step><para>
			<indexterm><primary>mime types</primary></indexterm>
			<indexterm><primary>/etc/cups/mime.convs</primary></indexterm>
			Edit the file <filename>/etc/cups/mime.convs</filename> to uncomment the line:
<screen>
application/octet-stream     application/vnd.cups-raw      0     -
</screen>
			</para></step>
			<step><para>
			<indexterm><primary>/etc/cups/mime.types</primary></indexterm>
			<indexterm><primary>application/octet-stream</primary></indexterm>
			Edit the file <filename>/etc/cups/mime.types</filename> to uncomment the line:
<screen>
application/octet-stream
</screen>
			</para></step>
			<step><para>
			<indexterm><primary>starting samba</primary></indexterm>
			Use the standard system tool to start Samba and CUPS to configure them to restart
			automatically at every system reboot. For example,
			</para>
			<para>
			<indexterm><primary>starting samba</primary></indexterm>
			<indexterm><primary>startingCUPS</primary></indexterm>
			<indexterm><primary>chkconfig</primary></indexterm>
<screen>
&rootprompt; chkconfig smb on
&rootprompt; chkconfig cups on
&rootprompt; /etc/rc.d/init.d/smb restart
&rootprompt; /etc/rc.d/init.d/cups restart
</screen>
			</para></step>
			<step><para>
			On Alan's workstation, use Windows Explorer to migrate the files from the old server
			to the new server. The new server should appear in the <guimenu>Network Neighborhood</guimenu>
			with the name of the old server (<constant>CASHPOOL</constant>).
			</para>
				<procedure>
					<step><para>
					Log on to Alan's workstation as the user <constant>alan</constant>.
					</para></step>
					<step><para>
					Launch a second instance of Windows Explorer and navigate to the share called
					<guiicon>files</guiicon> on the server called <guimenu>STABLE</guimenu>.
					</para></step>
					<step><para>
					Click in the right panel, and press <guimenu>Ctrl-A</guimenu> to select all files and
					directories. Press <guimenu>Ctrl-C</guimenu> to instruct Windows that you wish to
					copy all selected items.
					</para></step>
					<step><para>
					Launch the Windows Explorer, and navigate to the share called <guiicon>files</guiicon>
					on the server called <guimenu>CASHPOOL</guimenu>. Click in the right panel, and then press
					<guimenu>Ctrl-V</guimenu> to commence the copying process.
					</para></step>
				</procedure>
			</step>
			<step><para>
			Verify that the files are being copied correctly from the Windows NT4 machine to the Samba-3 server.
			This is best done on the Samba-3 server. Check the contents of the directory tree under 
			<filename>/data</filename> by executing the following command:
<screen>
&rootprompt; ls -aR /data
</screen>
			Make certain to check the ownership and permissions on all files. If in doubt, execute the following:
<screen>
&rootprompt; chown alan /data
&rootprompt; for i in james suzy ujen peter dale eric jeannie russ
> do
> 	chown $i /data/$i
> done
&rootprompt; chgrp -R accts /data
&rootprompt; chmod -R ug+rwxs,o-r+x /data
</screen>
			</para></step>
			<step><para>
			The migration of all data should now be complete. It is time to validate the installation.
			For this, you should make sure all applications, including printing, work before asking the
			customer to test drive the new network.
			</para></step>
		</procedure>
<example id="acctconf">
<title>Accounting Office Network &smb.conf; Old Style Configuration File</title>
<smbconfblock>
<smbconfcomment>Global parameters</smbconfcomment>
<smbconfsection name="[global]"/>
<smbconfoption name="workgroup">BILLMORE</smbconfoption>
<smbconfoption name="printcap name">CUPS</smbconfoption>
<smbconfoption name="disable spoolss">Yes</smbconfoption>
<smbconfoption name="show add printer wizard">No</smbconfoption>
<smbconfoption name="printing">cups</smbconfoption>
<smbconfsection name="[files]"/>
<smbconfoption name="comment">Work area files</smbconfoption>
<smbconfoption name="path">/data/%U</smbconfoption>
<smbconfoption name="read only">No</smbconfoption>
<smbconfsection name="[master]"/>
<smbconfoption name="comment">Master work area files</smbconfoption>
<smbconfoption name="path">/data</smbconfoption>
<smbconfoption name="valid users">alan</smbconfoption>
<smbconfoption name="read only">No</smbconfoption>
<smbconfsection name="[printers]"/>
<smbconfoption name="comment">Print Temporary Spool Configuration</smbconfoption>
<smbconfoption name="path">/var/spool/samba</smbconfoption>
<smbconfoption name="printable">Yes</smbconfoption>
<smbconfoption name="guest ok">Yes</smbconfoption>
<smbconfoption name="use client driver">Yes</smbconfoption>
<smbconfoption name="browseable">No</smbconfoption>
</smbconfblock>
</example>
		</sect3>
	</sect2>
</sect1>
<sect1>
	<title>Questions and Answers</title>
	<para>
	The following questions and answers draw from the examples in this chapter.
	Many design decisions are impacted by the configurations chosen. The intent
	is to expose some of the hidden implications.
	</para>
	<qandaset defaultlabel="chap02qa" type="number">
	<qandaentry>
	<question>
		<para>
		What makes an anonymous Samba server more simple than a non-anonymous Samba server?
		</para>
	</question>
	<answer>
		<para>
		In the anonymous server, the only account used is the <constant>guest</constant> account.
		In a non-anonymous configuration, it is necessary to add real user accounts to both the
		UNIX system and to the Samba configuration. Non-anonymous servers require additional
		administration.
		</para>
	</answer>
	</qandaentry>
	<qandaentry>
	<question>
		<para>
		How is the operation of the parameter <parameter>force user</parameter> different from
		setting the root directory of the share SUID?
		</para>
	</question>
	<answer>
		<para>
		The parameter <parameter>force user</parameter> causes all operations on the share to assume the UID
		of the forced user. The new default GID that applies is the primary GID of the forced user.
		This gives all users of this resource the actual privilege of the forced user.
		</para>
		<para>
		When a directory is set SUID, the operating system forces files that are written within it
		to be owned by the owner of the directory. While this happens, the user who is using the share
		has only the level of privilege he or she is assigned within the operating system context.
		</para>
		<para>
		The parameter <parameter>force user</parameter> has potential security implications that go
		beyond the actual share root directory. Be careful and wary of using this parameter.
		</para>
	</answer>
	</qandaentry>
	<qandaentry>
	<question>
		<para>
		When would you both use the per share parameter <parameter>force user</parameter> and set
		the share root directory SUID?
		</para>
	</question>
	<answer>
		<para>
		You would use both parameters when it is necessary to guarantee that all share handling operations
		are conducted as the forced user, while all file and directory creation are done as the SUID
		directory owner.
		</para>
	</answer>
	</qandaentry>
	<qandaentry>
	<question>
		<para>
		What is better about CUPS printing than LPRng printing?
		</para>
	</question>
	<answer>
		<para>
		CUPS is a print spooling system that has integrated remote management facilities, provides completely
		automated print processing/preprocessing, and can be configured to automatically
		apply print preprocessing filters to ensure that a print job submitted is correctly rendered for the
		target printer. CUPS includes an image file RIP that supports printing of image files to 
		non-PostScript printers. CUPS has lots of bells and whistles and is more like a supercharged MS Windows
		NT/200x print monitor and processor. Its complexity can be eliminated or turbocharged to suit
		any fancy.
		</para>
		<para>
		The LPRng software is an enhanced, extended, and portable implementation of the Berkeley LPR print 
		spooler functionality. It provides the same interface and meets RFC1179 requirements. LPRng can be
		configured to act like CUPS, but it is in principle a replacement for the old Berkeley lpr/lpd
		spooler. LPRng is generally preferred by those who are familiar with Berkeley lpr/lpd.
		</para>
		<para>
		Which spooling system is better is a matter of personal taste. It depends on what you want to do and how you want to
		do it and manage it. Most modern Linux systems ship with CUPS as the default print management system.
		</para>
	</answer>
	</qandaentry>
	<qandaentry>
	<question>
		<para>
		When should Windows client IP addresses be hard-coded?
		</para>
	</question>
	<answer>
		<para>
		When there are few MS Windows clients, little client change, no mobile users, and users are not
		inclined to tamper with network settings, it is a safe and convenient matter to hard-code Windows
		client TCP/IP settings. Given that it is possible to lock down the Windows desktop and remove
		user ability to access network configuration controls, fixed configuration eliminates the need
		for a DHCP server. This reduces maintenance overheads and eliminates a possible point of network
		failure.
		</para>
	</answer>
	</qandaentry>
	<qandaentry>
	<question>
		<para>
		Under what circumstances is it best to use a DHCP server?
		</para>
	</question>
	<answer>
		<para>
		In network configurations where there are mobile users, or where Windows client PCs move around
		(particularly between offices or between subnets), it makes complete sense to control all Windows
		client configurations using a DHCP server. Additionally, when users do tamper with the network
		settings, DHCP can be used to normalize all client settings. 
		</para>
		<para>
		One underappreciated benefit of using a DHCP server to assign all network client
		device TCP/IP settings is that it makes it a pain-free process to change network TCP/IP
		settings, change network addressing, or enhance the ability of client devices to
		benefit from new network services.
		</para>
		<para>
		Another benefit of modern DHCP servers is their ability to register dynamically
		assigned IP addresses with the DNS server. The benefits of Dynamic DNS (DDNS) are considerable in 
		a large Windows network environment.
		</para>
	</answer>
	</qandaentry>
	<qandaentry>
	<question>
		<para>
		What is the purpose of setting the parameter <parameter>guest ok</parameter> on a share?
		</para>
	</question>
	<answer>
		<para>
		If this parameter is set to yes for a service, then no password is required to connect to the service.
		Privileges are those of the guest account.
		</para>
	</answer>
	</qandaentry>
	<qandaentry>
	<question>
		<para>
		When would you set the global parameter <parameter>disable spoolss</parameter>?
		</para>
	</question>
	<answer>
		<para>
		Setting this parameter to <constant>Yes</constant> disables Samba's support for the SPOOLSS set of 
		MS-RPCs and yields behavior identical to Samba 2.0.x. Windows NT/2000 clients can downgrade to 
		using LanMan style printing commands. Windows 9x/Me are unaffected by the parameter. However, this 
		disables the ability to upload printer drivers to a Samba server via the Windows NT/200x Add Printer 
		Wizard or by using the NT printer properties dialog window. It also disables the capability of 
		Windows NT/200x clients to download print drivers from the Samba host on demand. Be extremely careful about 
		setting this parameter.
		</para>
		<para>
		The alternate parameter <parameter>use client driver</parameter> applies only to Windows NT/200x clients. It has no 
		effect on Windows 95/98/Me clients. When serving a printer to Windows NT/200x clients without first installing a valid 
		printer driver on the Samba host, the client is required to install a local printer driver. From this point on, 
		the client treats the printer as a local printer and not a network printer connection. This is much the same behavior 
		that occurs when <parameter>disable spoolss = yes</parameter>.
		</para>
		<para>
		Under normal circumstances, the NT/200x client attempts to open the network printer using MS-RPC. Because the client 
		considers the printer to be local, it attempts to issue the <parameter>OpenPrinterEx()</parameter> call requesting
		access rights associated with the logged on user. If the user possesses local administrator rights but not root
		privilege on the Samba host (often the case), the <parameter>OpenPrinterEx()</parameter> call fails. The result is
		that the client now displays an <quote>Access Denied; Unable to connect</quote> message in the printer queue window
		(even though jobs may be printed successfully). This parameter MUST not be enabled on a print share that has a valid
		print driver installed on the Samba server.
		</para>
	</answer>
	</qandaentry>
	<qandaentry>
	<question>
		<para>
		Why would you disable password caching on Windows 9x/Me clients?
		</para>
	</question>
	<answer>
		<para>
		Windows 9x/Me workstations that are set at default (password caching enabled) store the username and
		password in files located in the Windows master directory. Such files can be scavenged (read off a client
		machine) and decrypted, thus revealing the user's access credentials for all systems the user may have accessed.
		It is most insecure to allow any Windows 9x/Me client to operate with password caching enabled.
		</para>
	</answer>
	</qandaentry>
	<qandaentry>
	<question>
		<para>
		The example of Abmas Accounting uses User Mode security. How does this provide anonymous access?
		</para>
	</question>
	<answer>
		<para>
		The example used does not provide anonymous access. Since the clients are all Windows 2000 Professional,
		and given that users are logging onto their machines, by default the client attempts to connect to
		a remote server using currently logged in user credentials. By ensuring that the user's login ID and
		password are the same as those set on the Samba server, access is transparent and does not require
		separate user authentication.
		</para>
	</answer>
	</qandaentry>
	</qandaset>
</sect1>
</chapter>
 |