This file is indexed.

/usr/share/doc/smbldap-tools/smbldap-tools.html is in smbldap-tools 0.9.7-1ubuntu1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
            "http://www.w3.org/TR/REC-html40/loose.dtd">
<!-- $Id$ -->
<HTML>
<HEAD><TITLE>Smbldap-tools User Manual 
(Release: 0.9.3 )</TITLE>

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<META name="GENERATOR" content="hevea 1.07">

<link rel="stylesheet" href="IDXDOC.css">
</HEAD>
<BODY >
<!--HEVEA command line is: hevea -fix -I ./styles -exec xxdate.exe -pedantic IDXDOC.hva smbldap-tools.tex -o smbldap-tools.html -->
<!--HTMLHEAD-->


  <DIV class="entete">
  Copyright 2002 &copy; IDEALX S.A.S. - 
  Contact:&nbsp;<A href="mailto:samba@IDEALX.org">samba@IDEALX.org</A>
  </DIV>
  <HR>
<!--ENDHTML-->
<!--PREFIX <ARG ></ARG>-->
<!--CUT DEF section 1 -->





<H1 ALIGN=center>Smbldap-tools User Manual<BR>
(<I>Release</I>: 0.9.3 )</H1>

<H3 ALIGN=center>Jérôme Tournier</H3>

<H3 ALIGN=center><I>Revision</I>: 1.7 , generated April 22, 2008<BR>
</H3>
<DIV ALIGN=center>
 
 <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD ALIGN=left NOWRAP bgcolor="#f2f2f2">Release:</TD>
<TD ALIGN=left NOWRAP>&nbsp;</TD>
</TR>
<TR><TD ALIGN=left NOWRAP bgcolor="#f2f2f2">Reference:</TD>
<TD ALIGN=left NOWRAP>&nbsp;</TD>
</TR>
<TR><TD ALIGN=left NOWRAP bgcolor="#f2f2f2">Publication date:</TD>
<TD ALIGN=left NOWRAP>&nbsp;</TD>
</TR>
<TR><TD ALIGN=left NOWRAP bgcolor="#f2f2f2">Print date:</TD>
<TD ALIGN=left NOWRAP>April 22, 2008</TD>
</TR></TABLE>
 </DIV>

<BR>
This document is the property of IDEALX<SUP><A NAME="text1" HREF="#note1">1</A></SUP>.
Permission is granted to distribute this document under the terms of the GNU 
Free Documentation License (<A HREF="http://www.gnu.org/copyleft/fdl.html"><TT>http://www.gnu.org/copyleft/fdl.html</TT></A>).<BR>
<BR>
<!--TOC section Table of Contents-->

<H2>Table of Contents</H2><!--SEC END -->

<UL><LI>
<A HREF="#htoc1">1&nbsp;&nbsp;Introduction</A>
<UL><LI>
<A HREF="#htoc2">1.1&nbsp;&nbsp;Software requirements</A>
<LI><A HREF="#htoc3">1.2&nbsp;&nbsp;Updates of this document</A>
<LI><A HREF="#htoc4">1.3&nbsp;&nbsp;Availability of this document</A>
</UL>
<LI><A HREF="#htoc5">2&nbsp;&nbsp;Installation</A>
<UL><LI>
<A HREF="#htoc6">2.1&nbsp;&nbsp;Requirements</A>
<LI><A HREF="#htoc7">2.2&nbsp;&nbsp;Installation</A>
<UL><LI>
<A HREF="#htoc8">2.2.1&nbsp;&nbsp;Installing from rpm</A>
<LI><A HREF="#htoc9">2.2.2&nbsp;&nbsp;Installing from a tarball</A>
</UL>
</UL>
<LI><A HREF="#htoc10">3&nbsp;&nbsp;Configuring the smbldap-tools</A>
<UL><LI>
<A HREF="#htoc11">3.1&nbsp;&nbsp;The smbldap.conf file</A>
<LI><A HREF="#htoc12">3.2&nbsp;&nbsp;The smbldap_bind.conf file</A>
</UL>
<LI><A HREF="#htoc13">4&nbsp;&nbsp;Using the scripts</A>
<UL><LI>
<A HREF="#htoc14">4.1&nbsp;&nbsp;Initial directory's population</A>
<LI><A HREF="#htoc15">4.2&nbsp;&nbsp;User management</A>
<UL><LI>
<A HREF="#htoc16">4.2.1&nbsp;&nbsp;Adding a user</A>
<LI><A HREF="#htoc17">4.2.2&nbsp;&nbsp;Removing a user</A>
<LI><A HREF="#htoc18">4.2.3&nbsp;&nbsp;Modifying a user</A>
</UL>
<LI><A HREF="#htoc19">4.3&nbsp;&nbsp;Group management</A>
<UL><LI>
<A HREF="#htoc20">4.3.1&nbsp;&nbsp;Adding a group</A>
<LI><A HREF="#htoc21">4.3.2&nbsp;&nbsp;Removing a group</A>
</UL>
<LI><A HREF="#htoc22">4.4&nbsp;&nbsp;Adding a interdomain trust account</A>
</UL>
<LI><A HREF="#htoc23">5&nbsp;&nbsp;Samba and the smbldap-tools scripts</A>
<UL><LI>
<A HREF="#htoc24">5.1&nbsp;&nbsp;General configuration</A>
<LI><A HREF="#htoc25">5.2&nbsp;&nbsp;Migrating an NT4 PDC to Samba3</A>
</UL>
<LI><A HREF="#htoc26">6&nbsp;&nbsp;Frequently Asked Questions</A>
<UL><LI>
<A HREF="#htoc27">6.1&nbsp;&nbsp;How can i use old released uidNumber and gidNumber ?</A>
<LI><A HREF="#htoc28">6.2&nbsp;&nbsp;I always have this error: "Can't locate IO/Socket/SSL.pm"</A>
<LI><A HREF="#htoc29">6.3&nbsp;&nbsp;I can't initialize the directory with <TT>smbldap-populate</TT></A>
<LI><A HREF="#htoc30">6.4&nbsp;&nbsp;I can't join the domain with the <TT>root</TT> account</A>
<LI><A HREF="#htoc31">6.5&nbsp;&nbsp;I have the <TT>sambaSamAccount</TT> but i can't logged in</A>
<LI><A HREF="#htoc32">6.6&nbsp;&nbsp;I want to create machine account on the fly, but it does
 not works or I must do it twice</A>
<LI><A HREF="#htoc33">6.7&nbsp;&nbsp;I can't manage the Oracle Internet Database</A>
<LI><A HREF="#htoc34">6.8&nbsp;&nbsp;The directive <TT>passwd program = /usr/local/sbin/smbldap-passwd -u %u</TT> is not
called, or i got a error message when changing the password from windows</A>
<LI><A HREF="#htoc35">6.9&nbsp;&nbsp;New computers account can't be set in ou=computers</A>
<LI><A HREF="#htoc36">6.10&nbsp;&nbsp;I can join the domain, but i can't log on</A>
<LI><A HREF="#htoc37">6.11&nbsp;&nbsp;I can't create a user with <TT>smbldap-useradd</TT></A>
<LI><A HREF="#htoc38">6.12&nbsp;&nbsp;smbldap-useradd: Can't call method "get_value" on an undefined value at
/usr/local/sbin/smbldap-useradd line 154</A>
<LI><A HREF="#htoc39">6.13&nbsp;&nbsp;Typical errors on creating a new user or a new group</A>
</UL>
<LI><A HREF="#htoc40">7&nbsp;&nbsp;Thanks</A>
<LI><A HREF="#htoc41">8&nbsp;&nbsp;Annexes</A>
<UL><LI>
<A HREF="#htoc42">8.1&nbsp;&nbsp;Full configuration files</A>
<UL><LI>
<A HREF="#htoc43">8.1.1&nbsp;&nbsp;The <TT>/etc/opt/IDEALX/smbldap-tools/smbldap.conf</TT> file</A>
<LI><A HREF="#htoc44">8.1.2&nbsp;&nbsp;The <TT>/etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf</TT> file</A>
<LI><A HREF="#htoc45">8.1.3&nbsp;&nbsp;The samba configuration file : <TT>/etc/samba/smb.conf</TT> </A>
<LI><A HREF="#htoc46">8.1.4&nbsp;&nbsp;The OpenLDAP configuration file : <TT>/etc/openldap/slapd.conf</TT></A>
</UL>
<LI><A HREF="#htoc47">8.2&nbsp;&nbsp;Changing the administrative account (<TT>ldap admin
 dn</TT> in <TT>smb.conf</TT> file)</A>
<LI><A HREF="#htoc48">8.3&nbsp;&nbsp;known bugs</A>
</UL>
</UL>



<!--TOC section Introduction-->

<H2><A NAME="htoc1">1</A>&nbsp;&nbsp;Introduction</H2><!--SEC END -->

<A NAME="sec:intro"></A>
Smbldap-tools is a set of scripts designed to help integrate Samba and a
LDAP directory. They target both users and administrators of Linux systems.<BR>
<BR>
Users can change their password in a way similar to the standard ``passwd''
command.<BR>
<BR>
Administrators can perform user and group management command line actions
and synchronise Samba account management consistently.<BR>
<BR>
This document presents:
<UL><LI>
a detailled view of the smbldap-tools scripts
<LI>a step by step explanation of how to set up a Samba3 domain controller
</UL>
<!--TOC subsection Software requirements-->

<H3><A NAME="htoc2">1.1</A>&nbsp;&nbsp;Software requirements</H3><!--SEC END -->

The smbldap-tools have been developped and tested with the following configuration :
<UL><LI>
<FONT COLOR=purple><I>Linux</I></FONT> CentOS4 (be should work on any <FONT COLOR=purple><I>Linux</I></FONT> distribution)
<LI>	<FONT COLOR=purple>Samba</FONT> release 3.0.10,
<LI><FONT COLOR=purple>OpenLDAP</FONT> release 2.2.13
<LI><FONT COLOR=purple>Microsoft Windows NT</FONT> 4.0, Windows 2000 and Windows XP Workstations and Servers,
</UL>
This guide applies to <FONT COLOR=purple>smbldap-tools</FONT> <I>Release</I>: 0.9.3 .<BR>
<BR>
<!--TOC subsection Updates of this document-->

<H3><A NAME="htoc3">1.2</A>&nbsp;&nbsp;Updates of this document</H3><!--SEC END -->

The most up to date release of this document may be found on the 
smbldap-tools project page available at <A HREF="https://gna.org/projects/smbldap-tools/"><TT>https://gna.org/projects/smbldap-tools/</TT></A>.<BR>
<BR>
If you find any bugs in this document, or if you want this document to
integrate some additional infos, please drop me a mail with your bug report
and/or change request at <U>jtournier@gmail.com</U>.<BR>
<BR>
<!--TOC subsection Availability of this document-->

<H3><A NAME="htoc4">1.3</A>&nbsp;&nbsp;Availability of this document</H3><!--SEC END -->

This document is the property of <FONT COLOR=purple>IDEALX</FONT> (<A HREF="http://www.IDEALX.com/"><TT>http://www.IDEALX.com/</TT></A>). <BR>
<BR>
Permission is granted to distribute this document under the terms of the GNU 
Free Documentation License (See <A HREF="http://www.gnu.org/copyleft/fdl.html"><TT>http://www.gnu.org/copyleft/fdl.html</TT></A>).
 <!--TOC section Installation-->

<H2><A NAME="htoc5">2</A>&nbsp;&nbsp;Installation</H2><!--SEC END -->

<!--TOC subsection Requirements-->

<H3><A NAME="htoc6">2.1</A>&nbsp;&nbsp;Requirements</H3><!--SEC END -->

The main requirement for using smbldap-tools are the two perl module:
Net::LDAP and Crypt::SmbHash.
In most cases, you'll also need the IO-Socket-SSL Perl module to use
TLS functionnality.<BR>
<BR>
If you want samba to call the scripts so that you can use the User
Manager (or any other) under MS-Windows (to add, delete modify users and
groups), <FONT COLOR=purple>Samba</FONT> must be installed on the same computer.
Finally, <FONT COLOR=purple>OpenLDAP</FONT> can be installed on any computer. Please check that it
can be contacted by a standard LDAP client software.<BR>
<BR>
<FONT COLOR=purple>Samba</FONT> and <FONT COLOR=purple>OpenLDAP</FONT> installations will not be discussed
here. You can consult the howto also available on the
project page (<A HREF="http://sourceforge.net/projects/smbldap-tools/"><TT>http://sourceforge.net/projects/smbldap-tools/</TT></A>).<BR>
<BR>
<!--TOC subsection Installation-->

<H3><A NAME="htoc7">2.2</A>&nbsp;&nbsp;Installation</H3><!--SEC END -->

An archive of the <FONT COLOR=purple>smbldap-tools</FONT> scripts can be downloaded on our project
page <A HREF="http://sourceforge.net/projects/smbldap-tools/"><TT>http://sourceforge.net/projects/smbldap-tools/</TT></A>. Archive and RedHat packages are
available.
<BR>
If you are upgrading, look at the <TT>INSTALL</TT> file or read the link
<A HREF="#faq::error::add::user">6.13</A>.<BR>
<BR>
<!--TOC subsubsection Installing from rpm-->

<H4><A NAME="htoc8">2.2.1</A>&nbsp;&nbsp;Installing from rpm</H4><!--SEC END -->

To install the scripts on a RedHat system, download the RPM
package and run the following command:
<PRE>
rpm -Uvh smbldap-tools-0.9.3-1.i386.rpm
</PRE>
<!--TOC subsubsection Installing from a tarball-->

<H4><A NAME="htoc9">2.2.2</A>&nbsp;&nbsp;Installing from a tarball</H4><!--SEC END -->

On non RedHat system, download a source archive of the scripts. The current
archive is <TT>smbldap-tools-0.9.3.tar.gz</TT>.
Uncompress it and copy all of the Perl scripts in <TT>/usr/sbin</TT>
directory, and the two configuration files in
<TT>/etc/smbldap-tools/</TT> directory:
<PRE>
mkdir /etc/smbldap-tools/
cp *.conf /etc//smbldap-tools/
cp smbldap-* /usr/sbin/
</PRE>
The configuration is now based on two differents files:
<UL><LI>
<TT>smbldap.conf</TT>: define global parameter
<LI><TT>smbldap_bind.conf</TT>: define an administrative account to
 bind to the directory
</UL>
The second file <B>must</B> be readable only for 'root', as it contains
credentials allowing modifications on all the directory. Make sure the
files are protected by running the following commands:
<PRE>
chmod 644 /etc/smbldap-tools/smbldap.conf
chmod 600 /etc/smbldap-tools/smbldap_bind.conf
</PRE> <!--TOC section Configuring the smbldap-tools-->

<H2><A NAME="htoc10">3</A>&nbsp;&nbsp;Configuring the smbldap-tools</H2><!--SEC END -->

As mentioned in the previous section, you'll have to update two
configuration files. The first (<TT>smbldap.conf</TT>) allows you to
set global parameter that are readable by everybody, and the second
(<TT>smbldap_bind.conf</TT>) defines two administrative accounts to
bind to a slave and a master ldap server: this file must thus be
readable only by root.<BR>
<BR>
A script named <TT>configure.pl</TT> can help you to set their contents
up. It is located in the tarball
downloaded or in the documentation directory if you got the RPM
archive (see <TT>/usr/share/doc/smbldap-tools-0.9.3/</TT>). Just invoke it:
<PRE>
/usr/share/doc/smbldap-tools-0.9.3/configure.pl
</PRE>It will ask for the default values defined in your
<TT>smb.conf</TT> file, and will update the two configuration files used
by the scripts. Samba configuration file should then be already configured.
Note that you can stop the script at any moment with
the <TT>Crtl-c</TT> keys.<BR>
Before using this script :
<UL><LI>
the two configuration files <B>must</B> be present in the
 <TT>/etc/smbldap-tools/</TT> directory
<LI>check that samba is configured and running, as the script will try to
 get your workgroup's domain secure id (SID).
</UL>
In those files, parameters are defined like this:
<PRE>
key="value"
</PRE>Full example configuration files can be found at
<A HREF="#configuration::files">8.1</A>.<BR>
<BR>
<!--TOC subsection The smbldap.conf file-->

<H3><A NAME="htoc11">3.1</A>&nbsp;&nbsp;The smbldap.conf file</H3><!--SEC END -->

This file is used to define parameters that can be readable by
everybody. A full example file is available in section <A HREF="#configuration::file::smbldap">8.1.1</A>.<BR>
<BR>
Let's have a look at all available parameters.
<UL><LI>
<TT>UID_START</TT> and <TT>GID_START</TT>&nbsp;: parameters deprecated
 <UL><LI>
 Those parameters must be removed or commented.
 <LI>Available uid and gid are now defined in the default
 new entry <TT>sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"</TT>.
 See later for <TT>${sambaDomain}</TT> and <TT>${suffix}</TT> definitions.
 </UL>
<LI><TT>SID</TT>&nbsp;: Secure Identifier Domain
 <UL><LI>
 Example: <TT>SID="S-1-5-21-3703471949-3718591838-2324585696"</TT>
 <LI>Remark: you can get the SID for your domain using the "<TT>net getlocalsid</TT>"
 command. Samba must be up and running for this to work (it can take <B>several</B> minutes for a Samba server to correctly negotiate its status with other network servers).
 </UL>
<LI><TT>sambaDomain</TT>&nbsp;: Samba Domain the Samba server is in charge
 <UL><LI>
 Example: <TT>sambaDomain="DOMSMB"</TT>
 <LI>Remark: if not defined, parameter is taking from smb.conf configuration file
 </UL>
<LI><TT>slaveLDAP</TT>&nbsp;: slave LDAP server
 <UL><LI>
 Example: <TT>slaveLDAP="127.0.0.1"</TT>
 <LI>Remark: must be a resolvable DNS name or it's IP address
 </UL>
<LI><TT>slavePort</TT>&nbsp;: port to contact the slave server
 <UL><LI>
 Example: <TT>slavePort="389"</TT>
 </UL>
<LI><TT>masterLDAP</TT>&nbsp;: master LDAP server
 <UL><LI>
 Example: <TT>masterLDAP="127.0.0.1"</TT>
 </UL>
<LI><TT>masterPort</TT>&nbsp;: port to contact the master server
 <UL><LI>
 Example: <TT>masterPort="389"</TT>
 </UL>
<LI><TT>ldapTLS</TT>&nbsp;: should we use TLS connection to contact the
 ldap servers ?
 <UL><LI>
 Example: <TT>ldapTLS="1"</TT>
 <LI>Remark: the LDAP severs must be configured to accept TLS
 connections. See section 5.2 of the Samba-LDAP Howto for more
 details (<A HREF="http://download.gna.org/smbldap-tools/docs/samba-ldap-howto/"><TT>http://download.gna.org/smbldap-tools/docs/samba-ldap-howto/</TT></A>). If you are using TLS support, select port 389 to connect to
 the master and slave directories.
 </UL>
<LI><TT>verify</TT>&nbsp;: How to verify the server's certificate (none, optional or require).
 <UL><LI>
 Example: <TT>verify="require"</TT>
 <LI>Remarl: See ``man Net::LDAP'' in start_tls section for more details
 </UL> 
<LI><TT>cafile</TT>&nbsp;: the PEM-format file containing certificates
 for the CA that slapd will trust
 <UL><LI>
 Example: <TT>cafile="/etc/opt/IDEALX/smbldap-tools/ca.pem"</TT>
 </UL>
<LI><TT>clientcert</TT>&nbsp;: the file that contains the client certificate
 <UL><LI>
 Example: <TT>clientcert="/etc/opt/IDEALX/smbldap-tools/smbldap-tools.example.com.pem"</TT>
 </UL>
<LI><TT>clientkey</TT>&nbsp;: the file that contains the private key that
 matches the certificate stored in the clientcert file
 <UL><LI>
 Example: <TT>clientkey="/etc/opt/IDEALX/smbldap-tools/smbldap-tools.example.com.key"</TT>
 </UL>
<LI><TT>suffix</TT>&nbsp;: The distinguished name of the search base
 <UL><LI>
 Example: <TT>suffix="dc=example,dc=com"</TT>
 </UL>
<LI><TT>usersdn</TT>&nbsp;: branch in which users account can be found or
 must be added
 <UL><LI>
 Example: <TT>usersdn="ou=Users,${suffix}"</TT>
 <LI>Remark: this branch is <B>not</B> relative to the suffix value
 </UL>
<LI><TT>computersdn</TT>&nbsp;: branch in which computers account can be
 found or must be added
 <UL><LI>
 Example: <TT>computersdn"ou=Computers,${suffix}"</TT>
 <LI>Remark: this branch is <B>not</B> relative to the suffix value
 </UL>
<LI><TT>groupsdn</TT>&nbsp;: branch in which groups account can be found
 or must be added
 <UL><LI>
 Example: <TT>groupsdn="ou=Groups,${suffix}"</TT>
 <LI>Remarks: this branch is <B>not</B> relative to the suffix value
 </UL>
<LI><TT>idmapdn</TT>&nbsp;: where are stored Idmap entries (used if samba is a domain member server)
<UL><LI>
 Example: <TT>idmapdn="ou=Idmap,${suffix}"</TT>
 <LI>Remarks: this branch is <B>not</B> relative to the suffix value
</UL>
<LI><TT>sambaUnixIdPooldn</TT>&nbsp;: object in which next uidNumber and gidNumber available are stored
<UL><LI>
 Example: <TT>sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"</TT>
 <LI>Remarks: this branch is <B>not</B> relative to the suffix value
</UL>
<LI><TT>scope</TT>&nbsp;: the search scope.
<UL><LI>
 Example: <TT>scope="sub"</TT>
</UL>
<LI><TT>hash_encrypt</TT>&nbsp;: hash to be used when generating a
 user password.
 <UL><LI>
 Example: <TT>hash_encrypt="SSHA"</TT>
 <LI>Remark: This is used for the unix password stored in <I>userPassword</I> attribute.
 </UL>
<LI><TT>crypt_salt_format="%s"</TT>&nbsp;: if hash_encrypt is set to
 CRYPT, you may set a salt format. Default is "%s", but many systems
 will generate MD5 hashed passwords if you use "$1$%.8s". This
 parameter is optional.
<LI><TT>userLoginShell</TT>&nbsp;: default shell given to users.
 <UL><LI>
 Example: <TT>userLoginShell="/bin/bash"</TT>
 <LI>Remark: This is stored in <I>loginShell</I> attribute.
 </UL>
<LI><TT>userHome</TT>&nbsp;: default directory where users's home
 directory are located.
 <UL><LI>
 Example: <TT>userHome="/home/%U"</TT>
 <LI>Remark: This is stored in <TT>homeDirectory</TT> attribute.
 </UL>
<LI><TT>userGecos</TT>&nbsp;: gecos used for users
 <UL><LI>
 Example: <TT>userGecos="System User"</TT>
 </UL>
<LI><TT>defaultUserGid</TT>&nbsp;: default primary group set to users accounts
 <UL><LI>
 Example: <TT>defaultUserGid="513"</TT>
 <LI>Remark: this is stored in <I>gidNumber</I> attribute.
</UL>
<LI><TT>defaultComputerGid</TT>&nbsp;: default primary group set to
 computers accounts
 <UL><LI>
 Example: <TT>defaultComputerGid="550"</TT>
 <LI>Remark: this is stored in <I>gidNumber</I> attribute.
</UL>
<LI><TT>skeletonDir</TT>&nbsp;: skeleton directory used for users accounts
 <UL><LI>
 Example: <TT>skeletonDir="/etc/skel"</TT>
 <LI>Remark: this option is used only if you ask for home directory creation when adding a new user.
 </UL>
<LI><TT>defaultMaxPasswordAge</TT>&nbsp;: default validation time for Samba password (in days)
 <UL><LI>
 Example: <TT>defaultMaxPassword="55"</TT>
 </UL>
<LI><TT>userSmbHome</TT>&nbsp;: samba share used to store user's home directory
 <UL><LI>
 Example:
 <TT>userSmbHome="\\PDC-SMB3\ <I>home</I>\%<I>U</I>"</TT>
 <LI>Remark: this is stored in <I>sambaHomePath</I> attribute.
</UL>
<LI><TT>userProfile</TT>&nbsp;: samba share used to store user's profile
 <UL><LI>
 Example:
 <TT>userProfile="\\PDC-SMB3\ <I>profiles</I>\%<I>U</I>"</TT>
 <LI>Remark: this is stored in <I>sambaProfilePath</I> attribute.
 </UL>
<LI><TT>userHomeDrive</TT>&nbsp;: letter used on windows system to map
 the home directory
 <UL><LI>
 Example: <TT>userHomeDrive="K:"</TT>
 </UL>
<LI><TT>userScript</TT>&nbsp;: default user netlogon script name. If not used, will be automatically <I>username.cmd</I>
 <UL><LI>
 Example:
 <TT>userScript="%U"</TT>
 <LI>Remark: this is stored in <I>sambaProfilePath</I> attribute.
 </UL>
<LI><TT>mailDomain</TT>&nbsp;: Domain appended to the users "mail"
 attribute.
 <UL><LI>
 Example: <TT>mailDomain="idealx.org"</TT>
 </UL>
<LI><TT>with_smbpasswd</TT>&nbsp;: should we use the <I>smbpasswd</I> command
 to set the user's password (instead of the <I>mkntpwd</I> utility) ?
 <UL><LI>
 Example: <TT>with_smbpasswd="0"</TT>
 <LI>Remark: must be a boolean value (0 or 1).
 </UL>
<LI><TT>smbpasswd</TT>&nbsp;: path to the <TT>smbpasswd</TT> binary
 <UL><LI>
 Example: <TT>smbpasswd="/usr/bin/smbpasswd"</TT>
 </UL>
<LI><TT>with_slappasswd</TT>&nbsp;: should we use the <I>slappasswd</I> command
 to set the Unix user's password (instead of the <I>Crypt::</I> librairies) ?
 <UL><LI>
 Example: <TT>with_smbpasswd="0"</TT>
 <LI>Remark: must be a boolean value (0 or 1).
 </UL>
<LI><TT>slappasswd</TT>&nbsp;: path to the <TT>slappasswd</TT> binary
 <UL><LI>
 Example: <TT>smbpasswd="/usr/sbin/slappasswd"</TT>
 </UL>
</UL>
<!--TOC subsection The smbldap_bind.conf file-->

<H3><A NAME="htoc12">3.2</A>&nbsp;&nbsp;The smbldap_bind.conf file</H3><!--SEC END -->

This file is only used by <I>root</I> to give bind parameters to the directory when modifications are asked.
It contains distinguised names and credentials to connect to
both the master and slave directories. A full example file is available
in section <A HREF="#configuration::file::smbldap::bind">8.1.2</A>.<BR>
<BR>
Let's have a look at all available parameters.
<UL><LI>
<TT>slaveDN</TT>&nbsp;: distinguished name used to bind to the slave server 
 <UL><LI>
 Example 1: <TT>slaveDN="cn=Manager,dc=example,dc=com"</TT> 
 <LI>Example 2: <TT>slaveDN=""</TT>
 <LI>Remark: this can be the manager account of the directory or
 any LDAP account that has sufficient permissions to read the full
 directory (Slave directory is only used for reading). Anonymous
 connections uses the second example form.
 </UL>
<LI><TT>slavePw</TT>&nbsp;: the credentials to bind to the slave server
 <UL><LI>
 Example 1: <TT>slavePw="secret"</TT> 
 <LI>Example 2: <TT>slavePw=""</TT>
 <LI>Remark: the password must be stored here in clear form. This
 file must then be readable only by root! All anonymous connections
 use the second form provided in our example.
 </UL>
<LI><TT>masterDN</TT>&nbsp;: the distinguished name used to bind to the master server
 <UL><LI>
 Example: <TT>masterDN="cn=Manager,dc=example,dc=com"</TT>
 <LI>Remark: this can be the manager account of the directory or
 any LDAP account that has enough permissions to modify the content
 of the directory. Anonymous access does not make any sense here.
</UL>
<LI><TT>masterPw</TT>&nbsp;: the credentials to bind to the master server
 <UL><LI>
 Example: <TT>masterPw="secret"</TT>
 <LI>Remark: the password must be in clear text. Be sure to protect
 this file against unauthorized readers!
 </UL>
</UL>
 <!--TOC section Using the scripts-->

<H2><A NAME="htoc13">4</A>&nbsp;&nbsp;Using the scripts</H2><!--SEC END -->

<!--TOC subsection Initial directory's population-->

<H3><A NAME="htoc14">4.1</A>&nbsp;&nbsp;Initial directory's population</H3><!--SEC END -->

You can initialize the LDAP directory using the
<TT>smbldap-populate</TT> script. To do that, the account defined in
the <TT>/etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf</TT> to access the
master directory <B>must</B> must be the manager account defined in the
directory configuration. On RedHat system, this file is
<TT>/etc/openldap/slapd.conf</TT> and the account is defined with
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>
  rootdn          "cn=Manager,dc=example,dc=com"
  rootpw          secret
</PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE>The <TT>smbldap_bind.conf</TT> file must then be configured so that
the parameters to connect to the master LDAP server match the previous ones:
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>
  masterDN="cn=Manager,dc=example,dc=com"
  masterPw="secret"
</PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE><BR>
Available options for this script are summarized in the table <A HREF="#table::populate">1</A>:
<BLOCKQUOTE><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
 <A NAME="code_epsilon_var"></A>
 <DIV ALIGN=center>
 <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD ALIGN=left NOWRAP>option</TD>
<TD ALIGN=left NOWRAP>definition</TD>
<TD ALIGN=left NOWRAP>default value</TD>
</TR>
<TR><TD ALIGN=left NOWRAP>-u <I>uidNumber</I></TD>
<TD ALIGN=left NOWRAP>first uidNumber to allocate</TD>
<TD ALIGN=left NOWRAP>1000</TD>
</TR>
<TR><TD ALIGN=left NOWRAP>-g <I>gidNumber</I></TD>
<TD ALIGN=left NOWRAP>first uidNumber to allocate</TD>
<TD ALIGN=left NOWRAP>1000</TD>
</TR>
<TR><TD ALIGN=left NOWRAP>-a <I>user</I></TD>
<TD ALIGN=left NOWRAP>administrator login name</TD>
<TD ALIGN=left NOWRAP>Administrator</TD>
</TR>
<TR><TD ALIGN=left NOWRAP>-b <I>user</I></TD>
<TD ALIGN=left NOWRAP>guest login name</TD>
<TD ALIGN=left NOWRAP>nobody</TD>
</TR>
<TR><TD ALIGN=left NOWRAP>-e <I>file</I></TD>
<TD ALIGN=left NOWRAP>export a init file</TD>
<TD ALIGN=left NOWRAP>&nbsp;</TD>
</TR>
<TR><TD ALIGN=left NOWRAP>-i <I>file</I></TD>
<TD ALIGN=left NOWRAP>import a init file</TD>
<TD ALIGN=left NOWRAP>&nbsp;</TD>
</TR></TABLE>
 </DIV>
 <BR>
<DIV ALIGN=center>Table 1: Options available for the <TT>smbldap-populate</TT> script</DIV><BR>

 <A NAME="table::populate"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
In the more general case, to set up your directory, simply use the
following command:
<PRE>
[root@etoile root]# smbldap-populate 
Using builtin directory structure
adding new entry: dc=example,dc=com
adding new entry: ou=Users,dc=example,dc=com
adding new entry: ou=Groups,dc=example,dc=com
adding new entry: ou=Computers,dc=example,dc=com
adding new entry: ou=Idmap,dc=example,dc=org
adding new entry: cn=NextFreeUnixId,dc=example,dc=org
adding new entry: uid=Administrator,ou=Users,dc=example,dc=com
adding new entry: uid=nobody,ou=Users,dc=example,dc=com
adding new entry: cn=Domain Admins,ou=Groups,dc=example,dc=com
adding new entry: cn=Domain Users,ou=Groups,dc=example,dc=com
adding new entry: cn=Domain Guests,ou=Groups,dc=example,dc=com
adding new entry: cn=Print Operators,ou=Groups,dc=example,dc=com
adding new entry: cn=Backup Operators,ou=Groups,dc=example,dc=com
adding new entry: cn=Replicator,ou=Groups,dc=example,dc=com
adding new entry: cn=Domain Computers,ou=Groups,dc=example,dc=com
</PRE>
After this step, if you don't want to use the <TT>cn=Manager,dc=example,dc=com</TT>
account anymore, you can create a dedicated account for Samba and the
smbldap-tools. See section <A HREF="#change::manager">8.2</A> for more details.<BR>
<BR>
The <TT>cn=NextFreeUnixId,dc=example,dc=org</TT> entry is only used to
defined the next uidNumber and gidNumber available for creating new
users and groups. The default values for those numbers are 1000. You
can change it with the <TT>-u</TT> and <TT>-g</TT> option. For
example, if you want the first available value for uidNumber and
gidNumber to be set to 1500, you can use the following command :
<PRE>
smbldap-populate -u 1550 -g 1500
</PRE>
<!--TOC subsection User management-->

<H3><A NAME="htoc15">4.2</A>&nbsp;&nbsp;User management</H3><!--SEC END -->

<!--TOC subsubsection Adding a user-->

<H4><A NAME="htoc16">4.2.1</A>&nbsp;&nbsp;Adding a user</H4><!--SEC END -->
<A NAME="add::user"></A>
To add a user, use the <TT>smbldap-useradd</TT> script. Available
options are summarized in the table <A HREF="#table::add::user">2</A>. If applicable,
default values are mentionned in the third column. Any string beginning with a
$ symbol refers to a parameter defined in the
<TT>/etc/opt/IDEALX/smbldap-tools/smbldap.conf</TT> configuration file.
<BLOCKQUOTE><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
 <DIV ALIGN=center>
 <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD VALIGN=top ALIGN=left>option</TD>
<TD VALIGN=top ALIGN=left>definition</TD>
<TD VALIGN=top ALIGN=left>example</TD>
<TD VALIGN=top ALIGN=left>default value</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-a</TD>
<TD VALIGN=top ALIGN=left>create a Windows account. Otherwise, only a Posix account
 is created</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-w</TD>
<TD VALIGN=top ALIGN=left>create a Windows Workstation account</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-i</TD>
<TD VALIGN=top ALIGN=left>create an interdomain trust account. See section
 <A HREF="#trust::account">4.4</A> for more details</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-u</TD>
<TD VALIGN=top ALIGN=left>set a uid value</TD>
<TD VALIGN=top ALIGN=left>-u 1003</TD>
<TD VALIGN=top ALIGN=left>first uid available</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-g</TD>
<TD VALIGN=top ALIGN=left>set a gid value</TD>
<TD VALIGN=top ALIGN=left>-g 1003</TD>
<TD VALIGN=top ALIGN=left>first gid available</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-G</TD>
<TD VALIGN=top ALIGN=left>add the new account to one or several supplementary
 groups (comma-separated)</TD>
<TD VALIGN=top ALIGN=left>-G 512,550</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-d</TD>
<TD VALIGN=top ALIGN=left>set the home directory</TD>
<TD VALIGN=top ALIGN=left>-d /var/user</TD>
<TD VALIGN=top ALIGN=left>$userHomePrefix/user</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-s</TD>
<TD VALIGN=top ALIGN=left>set the login shell</TD>
<TD VALIGN=top ALIGN=left>-s /bin/ksh</TD>
<TD VALIGN=top ALIGN=left>$userLoginShell</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-c</TD>
<TD VALIGN=top ALIGN=left>set the user gecos</TD>
<TD VALIGN=top ALIGN=left>-c "admin user"</TD>
<TD VALIGN=top ALIGN=left>$userGecos</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-m</TD>
<TD VALIGN=top ALIGN=left>creates user's home directory and copies /etc/skel
 into it</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-k</TD>
<TD VALIGN=top ALIGN=left>set the skeleton dir (with -m)</TD>
<TD VALIGN=top ALIGN=left>-k /etc/skel2</TD>
<TD VALIGN=top ALIGN=left>$skeletonDir</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-P</TD>
<TD VALIGN=top ALIGN=left>ends by invoking smbldap-passwd to set the user's
 password</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-A</TD>
<TD VALIGN=top ALIGN=left>user can change password ? 0 if no, 1 if yes</TD>
<TD VALIGN=top ALIGN=left>-A 1</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-B</TD>
<TD VALIGN=top ALIGN=left>user must change password at first session ? 0 if no, 1
 if yes</TD>
<TD VALIGN=top ALIGN=left>-B 1</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-C</TD>
<TD VALIGN=top ALIGN=left>set the samba home share</TD>
<TD VALIGN=top ALIGN=left>-C \\PDC\homes</TD>
<TD VALIGN=top ALIGN=left>$userSmbHome</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-D</TD>
<TD VALIGN=top ALIGN=left>set a letter associated with the home share</TD>
<TD VALIGN=top ALIGN=left>-D H:</TD>
<TD VALIGN=top ALIGN=left>$userHomeDrive</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-E</TD>
<TD VALIGN=top ALIGN=left>set DOS script to execute on login</TD>
<TD VALIGN=top ALIGN=left>-E common.bat</TD>
<TD VALIGN=top ALIGN=left>$userScript</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-F</TD>
<TD VALIGN=top ALIGN=left>set the profile directory</TD>
<TD VALIGN=top ALIGN=left>-F \\PDC\profiles\user</TD>
<TD VALIGN=top ALIGN=left>$userProfile</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-H</TD>
<TD VALIGN=top ALIGN=left>set the samba account control bits
 like'[NDHTUMWSLKI]'</TD>
<TD VALIGN=top ALIGN=left>-H [X]</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-N</TD>
<TD VALIGN=top ALIGN=left>set the canonical name of the user</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-S</TD>
<TD VALIGN=top ALIGN=left>set the surname of the user</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-M</TD>
<TD VALIGN=top ALIGN=left>local mailAddress (comma seperated)</TD>
<TD VALIGN=top ALIGN=left>-M testuser,aliasuser</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-T</TD>
<TD VALIGN=top ALIGN=left>forward mail address (comma seperated)</TD>
<TD VALIGN=top ALIGN=left>-T
 testuser@domain.org</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR></TABLE>
 </DIV>
 <BR>
<DIV ALIGN=center>Table 2: Options available to the <TT>smbldap-useradd</TT> script</DIV><BR>

 <A NAME="table::add::user"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>

For example, if you want to add a user named <I>user_admin</I> and who : 
<UL><LI>
is a windows user
<LI>must belong to the group of gid=512 ('Domain Admins' group)
<LI>has a home directory
<LI>does not have a login shell
<LI>has a homeDirectory set to /dev/null
<LI>does not have a roaming profile
<LI>and for whom we want to set a first login password
</UL>
you must invoke:
<PRE>
smbldap-useradd -a -G 512 -m -s /bin/false -d /dev/null -F "" -P user_admin
</PRE>
<!--TOC subsubsection Removing a user-->

<H4><A NAME="htoc17">4.2.2</A>&nbsp;&nbsp;Removing a user</H4><!--SEC END -->

To remove a user account, use the <TT>smbldap-userdel</TT> script.
Available options are
<BLOCKQUOTE><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
 <DIV ALIGN=center>
 <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD ALIGN=left NOWRAP>option</TD>
<TD ALIGN=left NOWRAP>definition</TD>
</TR>
<TR><TD ALIGN=left NOWRAP>-r</TD>
<TD ALIGN=left NOWRAP>remove home directory</TD>
</TR>
<TR><TD ALIGN=left NOWRAP>-R</TD>
<TD ALIGN=left NOWRAP>remove home directory interactively</TD>
</TR></TABLE>
 </DIV>
 <BR>
<DIV ALIGN=center>Table 3: Option available to the <TT>smbldap-userdel</TT> script</DIV><BR>

 <A NAME="table::del::user"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
For example, if you want to remove the <I>user1</I> account
from the LDAP directory, and if you also want to delete his home
directory, use the following command :
<PRE>
smbldap-userdel -r user1
</PRE>
Note: '-r' is dangerous as it may delete precious and unbackuped data,
please be careful.<BR>
<BR>
<!--TOC subsubsection Modifying a user-->

<H4><A NAME="htoc18">4.2.3</A>&nbsp;&nbsp;Modifying a user</H4><!--SEC END -->
<A NAME="modify::user"></A>
To modify a user account, use the <TT>smbldap-usermod</TT> script.
Availables options are listed in the table <A HREF="#table::modify::user">4</A>.
<BLOCKQUOTE><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
 <DIV ALIGN=center>
 <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD VALIGN=top ALIGN=left>option</TD>
<TD VALIGN=top ALIGN=left>definition</TD>
<TD VALIGN=top ALIGN=left>example</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-c</TD>
<TD VALIGN=top ALIGN=left>set the user gecos</TD>
<TD VALIGN=top ALIGN=left>-c "admin user"</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-d</TD>
<TD VALIGN=top ALIGN=left>set the home directory</TD>
<TD VALIGN=top ALIGN=left>-d /var/user</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-u</TD>
<TD VALIGN=top ALIGN=left>set a uid value</TD>
<TD VALIGN=top ALIGN=left>-u 1003</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-g</TD>
<TD VALIGN=top ALIGN=left>set a gid value</TD>
<TD VALIGN=top ALIGN=left>-g 1003</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-G</TD>
<TD VALIGN=top ALIGN=left>add the new account to one or several supplementary
 groups (comma-separated)</TD>
<TD VALIGN=top ALIGN=left>-G 512,550</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>	</TD>
<TD VALIGN=top ALIGN=left>			</TD>
<TD VALIGN=top ALIGN=left>-G -512,550</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>	</TD>
<TD VALIGN=top ALIGN=left>			</TD>
<TD VALIGN=top ALIGN=left>-G +512,550</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-s</TD>
<TD VALIGN=top ALIGN=left>set the login shell</TD>
<TD VALIGN=top ALIGN=left>-s /bin/ksh</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-N</TD>
<TD VALIGN=top ALIGN=left>set the canonical name of the user</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-S</TD>
<TD VALIGN=top ALIGN=left>set the surname of the user</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-P</TD>
<TD VALIGN=top ALIGN=left>ends by invoking smbldap-passwd to set the user's password</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-a</TD>
<TD VALIGN=top ALIGN=left>add sambaSAMAccount objectclass</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-e</TD>
<TD VALIGN=top ALIGN=left>set an expiration date for the password (format: YYYY-MM-DD HH:MM:SS)</TD>
<TD VALIGN=top ALIGN=left>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-A</TD>
<TD VALIGN=top ALIGN=left>user can change password ? 0 if no, 1 if yes</TD>
<TD VALIGN=top ALIGN=left>-A 1</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-B</TD>
<TD VALIGN=top ALIGN=left>user must change password at first session ? 0 if no, 1
 if yes</TD>
<TD VALIGN=top ALIGN=left>-B 1</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-C</TD>
<TD VALIGN=top ALIGN=left>set the samba home share</TD>
<TD VALIGN=top ALIGN=left>-C \\PDC\homes</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>	</TD>
<TD VALIGN=top ALIGN=left>	</TD>
<TD VALIGN=top ALIGN=left>-C ""</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-D</TD>
<TD VALIGN=top ALIGN=left>set a letter associated with the home share</TD>
<TD VALIGN=top ALIGN=left>-D H:</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>	</TD>
<TD VALIGN=top ALIGN=left>	</TD>
<TD VALIGN=top ALIGN=left>-D ""</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-E</TD>
<TD VALIGN=top ALIGN=left>set DOS script to execute on login</TD>
<TD VALIGN=top ALIGN=left>-E common.bat</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>	</TD>
<TD VALIGN=top ALIGN=left>	</TD>
<TD VALIGN=top ALIGN=left>-E ""</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-F</TD>
<TD VALIGN=top ALIGN=left>set the profile directory</TD>
<TD VALIGN=top ALIGN=left>-F \\PDC\profiles\user</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>	</TD>
<TD VALIGN=top ALIGN=left>	</TD>
<TD VALIGN=top ALIGN=left>-F ""</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-H</TD>
<TD VALIGN=top ALIGN=left>set the samba account control bits like'[NDHTUMWSLKI]'</TD>
<TD VALIGN=top ALIGN=left>-H [X]</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-I</TD>
<TD VALIGN=top ALIGN=left>disable a user account</TD>
<TD VALIGN=top ALIGN=left>-I 1</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-J</TD>
<TD VALIGN=top ALIGN=left>enable a user</TD>
<TD VALIGN=top ALIGN=left>-J 1</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-M</TD>
<TD VALIGN=top ALIGN=left>local mailAddress (comma seperated)</TD>
<TD VALIGN=top ALIGN=left>-M testuser,aliasuser</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-T</TD>
<TD VALIGN=top ALIGN=left>forward mail address (comma seperated)</TD>
<TD VALIGN=top ALIGN=left>-T 
 testuser@domain.org</TD>
</TR></TABLE>
 </DIV>
 <BR>
<DIV ALIGN=center>Table 4: Options available to the <TT>smbldap-usermod</TT> script</DIV><BR>

 <A NAME="table::modify::user"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
You can also use the <TT>smbldap-userinfo</TT> script to update user's information. This script can
also be used by users themselves to update their own informations listed in the tables
<A HREF="#table::modify::self::user">5</A> (adequats ACL must be set in the directory server). Available
options are&nbsp;:
<BLOCKQUOTE><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
 <DIV ALIGN=center>
 <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD VALIGN=top ALIGN=left>option</TD>
<TD VALIGN=top ALIGN=left>definition</TD>
<TD VALIGN=top ALIGN=left>example</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-f</TD>
<TD VALIGN=top ALIGN=left>set the full name's user</TD>
<TD VALIGN=top ALIGN=left>-f MyName</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-r</TD>
<TD VALIGN=top ALIGN=left>set the room number</TD>
<TD VALIGN=top ALIGN=left>-r 99</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-w</TD>
<TD VALIGN=top ALIGN=left>set the work phone number</TD>
<TD VALIGN=top ALIGN=left>-w 111111111</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-h</TD>
<TD VALIGN=top ALIGN=left>set the home phone number</TD>
<TD VALIGN=top ALIGN=left>-h 222222222</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-o</TD>
<TD VALIGN=top ALIGN=left>set other information (in gecos definition)</TD>
<TD VALIGN=top ALIGN=left>-o "second stage"</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left>-s</TD>
<TD VALIGN=top ALIGN=left>set the default bash</TD>
<TD VALIGN=top ALIGN=left>-s /bin/ksh</TD>
</TR></TABLE>
 </DIV>
 <BR>
<DIV ALIGN=center>Table 5: Options available to the <TT>smbldap-userinfo</TT> script</DIV><BR>

 <A NAME="table::modify::self::user"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
<!--TOC subsection Group management-->

<H3><A NAME="htoc19">4.3</A>&nbsp;&nbsp;Group management</H3><!--SEC END -->

<!--TOC subsubsection Adding a group-->

<H4><A NAME="htoc20">4.3.1</A>&nbsp;&nbsp;Adding a group</H4><!--SEC END -->

To add a new group in the LDAP directory, use the <TT>smbldap-groupadd</TT>
script. Available options are listed in the table
<A HREF="#table::add::group">6</A>.
<BLOCKQUOTE><DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV>
 <DIV ALIGN=center>
 <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=1>
<TR><TD VALIGN=top ALIGN=left NOWRAP>option</TD>
<TD VALIGN=top ALIGN=left>definition</TD>
<TD VALIGN=top ALIGN=left NOWRAP>example</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP>-a</TD>
<TD VALIGN=top ALIGN=left>add automatic group mapping entry</TD>
<TD VALIGN=top ALIGN=left NOWRAP>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP>-g <TT>gid</TT></TD>
<TD VALIGN=top ALIGN=left>set the <I>gidNumer</I> for this group to
 <I>gid</I></TD>
<TD VALIGN=top ALIGN=left NOWRAP><TT>-g 1002</TT></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP>-o</TD>
<TD VALIGN=top ALIGN=left>gidNumber is not unique</TD>
<TD VALIGN=top ALIGN=left NOWRAP>&nbsp;</TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP>-r <TT>group-rid</TT></TD>
<TD VALIGN=top ALIGN=left>set the rid of the group to
 <I>group-rid</I></TD>
<TD VALIGN=top ALIGN=left NOWRAP><TT>-r 1002</TT></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP>-s <TT>group-sid</TT></TD>
<TD VALIGN=top ALIGN=left>set the sid of the group to
 <I>group-sid</I></TD>
<TD VALIGN=top ALIGN=left NOWRAP><TT><FONT SIZE=1>-s
 S-1-5-21-3703471949-3718591838-2324585696-1002</FONT></TT></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP>-t <TT>group-type</TT></TD>
<TD VALIGN=top ALIGN=left>set the <I>sambaGroupType</I> to
 <I>group-type</I></TD>
<TD VALIGN=top ALIGN=left NOWRAP><TT>-t 2</TT></TD>
</TR>
<TR><TD VALIGN=top ALIGN=left NOWRAP>-p</TD>
<TD VALIGN=top ALIGN=left>print the gidNumber to stdout</TD>
<TD VALIGN=top ALIGN=left NOWRAP>&nbsp;</TD>
</TR></TABLE>
 </DIV>
 <BR>
<DIV ALIGN=center>Table 6: Options available for the <TT>smbldap-groupadd</TT> script</DIV><BR>

 <A NAME="table::add::group"></A>
<DIV ALIGN=center><HR WIDTH="80%" SIZE=2></DIV></BLOCKQUOTE>
<!--TOC subsubsection Removing a group-->

<H4><A NAME="htoc21">4.3.2</A>&nbsp;&nbsp;Removing a group</H4><!--SEC END -->

To remove the group named <TT>group1</TT>, just use the following
command :
<PRE>
smbldap-userdel group1
</PRE>
<!--TOC subsection Adding a interdomain trust account-->

<H3><A NAME="htoc22">4.4</A>&nbsp;&nbsp;Adding a interdomain trust account</H3><!--SEC END -->
<A NAME="trust::account"></A>
To add an interdomain trust account to the primary controller <I>trust-pdc</I>, use the <TT>-i</TT> option of
<TT>smbldap-useradd</TT> as follows :
<PRE>
[root@etoile root]# smbldap-useradd -i trust-pdc
New password : *******
Retype new password : *******
</PRE>
The script will terminate asking for a password for this trust
account. The account will be created in the directory branch where
all computer accounts are stored (<TT>ou=Computers</TT> by
default). The only two particularities of this account are that you are
setting a password for this account, and the flags of this account are
<TT>[I          ]</TT>.
 <!--TOC section Samba and the smbldap-tools scripts-->

<H2><A NAME="htoc23">5</A>&nbsp;&nbsp;Samba and the smbldap-tools scripts</H2><!--SEC END -->

<!--TOC subsection General configuration-->

<H3><A NAME="htoc24">5.1</A>&nbsp;&nbsp;General configuration</H3><!--SEC END -->

Samba can be configured to use the <FONT COLOR=purple>smbldap-tools</FONT> scripts. This allows
administrators to add, delete or modify user and group accounts for <FONT COLOR=purple>Microsoft Windows</FONT>
operating systems using, for example, User Manager utility under MS-Windows.
To enable the use of this utility, samba needs to be configured correctly. The
<TT>smb.conf</TT> configuration file must contain the following directives :
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>
ldap delete dn = Yes
add user script = /usr/local/sbin/smbldap-useradd -m "%u"
add machine script = /usr/local/sbin/smbldap-useradd -w "%u"
add group script = /usr/local/sbin/smbldap-groupadd -p "%g"
add user to group script = /usr/local/sbin/smbldap-groupmod -m "%u" "%g"
delete user from group script = /usr/local/sbin/smbldap-groupmod -x "%u" "%g"
set primary group script = /usr/local/sbin/smbldap-usermod -g "%g" "%u"
</PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE><BR>
Remark: the two directives <TT>delete user script</TT> et <TT>delete group
script</TT> can also be used. However, an error message can appear in User Manager
even if the operations actually succeed.
If you want to enable this behaviour, you need to add
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>
delete user script = /usr/local/sbin/smbldap-userdel "%u"
delete group script = /usr/local/sbin/smbldap-groupdel "%g"
</PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE><BR>
<!--TOC subsection Migrating an NT4 PDC to Samba3-->

<H3><A NAME="htoc25">5.2</A>&nbsp;&nbsp;Migrating an NT4 PDC to Samba3</H3><!--SEC END -->

The account migration procedure becomes really simple when samba is configured to use
the <FONT COLOR=purple>smbldap-tools</FONT>. Samba configuration (smb.conf file) must contain the
directive defined above to properly call the script for managing users, groups and computer accounts.
The migration process is outlined in the chapter 30 of the samba howto
<A HREF="http://sambafr.idealx.org/samba/docs/man/Samba-HOWTO-Collection/NT4Migration.html"><TT>http://sambafr.idealx.org/samba/docs/man/Samba-HOWTO-Collection/NT4Migration.html</TT></A>.
 <BR>
<BR>
<!--TOC section Frequently Asked Questions-->

<H2><A NAME="htoc26">6</A>&nbsp;&nbsp;Frequently Asked Questions</H2><!--SEC END -->

<!--TOC subsection How can i use old released uidNumber and gidNumber ?-->

<H3><A NAME="htoc27">6.1</A>&nbsp;&nbsp;How can i use old released uidNumber and gidNumber ?</H3><!--SEC END -->

There are two way to do this :
<UL><LI>
modify the <TT>cn=NextFreeUnixId,dc=example,dc=org</TT> and
 change the <TT>uidNumber</TT> and/or <TT>gidNumber</TT> value. This
 must be done manually. For example, if you want to use all available
 uidNumber and gidNumber higher then 1500, you need to create a
 <TT>update-NextFreeUnixId.ldif</TT> file containing :
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>dn: cn=NextFreeUnixId,dc=example,dc=org
changetype: modify
uidNumber: 1500
gidNumber: 1500
</PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE>
and then update the directory :
<PRE>
ldapmodify -x -D "cn=Manager,dc=example,dc=org" -w secret -f update-NextFreeUnixId.ldif
</PRE><LI>use the <TT>-u</TT> or <TT>-g</TT> option to the script you need to set the value you
 want to use
</UL>
<!--TOC subsection I always have this error: "Can't locate IO/Socket/SSL.pm"-->

<H3><A NAME="htoc28">6.2</A>&nbsp;&nbsp;I always have this error: "Can't locate IO/Socket/SSL.pm"</H3><!--SEC END -->

This happens when you want to use a certificate. In this case, you need to install the
IO-Socket-SSL Perl module.<BR>
<BR>
<!--TOC subsection I can't initialize the directory with <TT>smbldap-populate</TT>-->

<H3><A NAME="htoc29">6.3</A>&nbsp;&nbsp;I can't initialize the directory with <TT>smbldap-populate</TT></H3><!--SEC END -->

When I want to initialize the directory using the <TT>smbldap-populate</TT>
script, I get
<PRE>
[root@slave sbin]# smbldap-populate.pl
  Using builtin directory structure
  adding new entry: dc=example,dc=org
  Can't call method "code" without a package or object reference at
  /usr/local/sbin/smbldap-populate.pl line 270, &lt;GEN1&gt; line 2.
</PRE>Answer: check the TLS configuration
<UL><LI>
if you don't want to use TLS support, set the <TT>/etc/opt/IDEALX/smbldap-tools/smbldap.conf</TT> file
with
<PRE>
ldapSSL="0"
</PRE><LI>if you want TLS support, set the <TT>/etc/opt/IDEALX/smbldap-tools/smbldap.conf</TT> file with
<PRE>
ldapSSL="1"
</PRE>and check that the directory server is configured to accept TLS connections.
</UL>
<!--TOC subsection I can't join the domain with the <TT>root</TT> account-->

<H3><A NAME="htoc30">6.4</A>&nbsp;&nbsp;I can't join the domain with the <TT>root</TT> account</H3><!--SEC END -->

<UL><LI>
check that the root account has the sambaSamAccount objectclass
<LI>check that the directive <TT>add machine script</TT> is present and configured
</UL>
<!--TOC subsection I have the <TT>sambaSamAccount</TT> but i can't logged in-->

<H3><A NAME="htoc31">6.5</A>&nbsp;&nbsp;I have the <TT>sambaSamAccount</TT> but i can't logged in</H3><!--SEC END -->

Check that the <TT>sambaPwdLastSet</TT> attribute is not null (equal to 0)<BR>
<BR>
<!--TOC subsection I want to create machine account on the fly, but it does
 not works or I must do it twice-->

<H3><A NAME="htoc32">6.6</A>&nbsp;&nbsp;I want to create machine account on the fly, but it does
 not works or I must do it twice</H3><!--SEC END -->

<UL><LI>
The script defined with the <TT>add machine script</TT> must not add
the <TT>sambaSAMAccount</TT> objectclass of the machine account. The
script must only add the Posix machine account. Samba will add the <TT>sambaSAMAccount</TT> when
joining the domain.
<LI>Check that the <TT>add <B>machine</B> script</TT> is present in samba
 configuration file.
</UL>
<!--TOC subsection I can't manage the Oracle Internet Database-->

<H3><A NAME="htoc33">6.7</A>&nbsp;&nbsp;I can't manage the Oracle Internet Database</H3><!--SEC END -->

If you have an error message like :
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>
Function Not Implemented at /usr/local/sbin/smbldap_tools.pm line 187.
Function Not Implemented at /usr/local/sbin/smbldap_tools.pm line 627.
</PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE>For Oracle Database, all attributes that will be resquested to the directory must be indexed. Add a
new index for samba attributes and make sure that the following attributes are also indexed :
 uidNumber, gidNumber, memberUid, homedirectory, description, userPassword ...<BR>
<BR>
<!--TOC subsection The directive <TT>passwd program = /usr/local/sbin/smbldap-passwd -u %u</TT> is not
called, or i got a error message when changing the password from windows-->

<H3><A NAME="htoc34">6.8</A>&nbsp;&nbsp;The directive <TT>passwd program = /usr/local/sbin/smbldap-passwd -u %u</TT> is not
called, or i got a error message when changing the password from windows</H3><!--SEC END -->

The directive is called if you also set <TT>unix password sync = Yes</TT>.
Notes:
<UL><LI>
if you use OpenLDAP, none of those two options are needed. You just need <TT>ldap
passwd sync = Yes</TT>.
<LI>the script called here must only update the <TT>userPassword</TT> attribute. This is the
reason of the <TT>-u</TT> option. Samba passwords will be updated by samba itself.
<LI>the <TT>passwd chat</TT> directive must match what is prompted when using the
<TT>smbldap-passwd</TT> command
</UL>
<!--TOC subsection New computers account can't be set in ou=computers-->

<H3><A NAME="htoc35">6.9</A>&nbsp;&nbsp;New computers account can't be set in ou=computers</H3><!--SEC END -->
<A NAME="sec::bug::ou::computer"></A>
This is a known samba bug. There's a workarround: look at
<A HREF="http://marc.theaimsgroup.com/?l=samba&m=108439612826440&w=2"><TT>http://marc.theaimsgroup.com/?l=samba&amp;m=108439612826440&amp;w=2</TT></A><BR>
<BR>
<!--TOC subsection I can join the domain, but i can't log on-->

<H3><A NAME="htoc36">6.10</A>&nbsp;&nbsp;I can join the domain, but i can't log on</H3><!--SEC END -->

look at section <A HREF="#sec::bug::ou::computer">6.9</A><BR>
<BR>
<!--TOC subsection I can't create a user with <TT>smbldap-useradd</TT>-->

<H3><A NAME="htoc37">6.11</A>&nbsp;&nbsp;I can't create a user with <TT>smbldap-useradd</TT></H3><!--SEC END -->

When creating a new user account I get the following error message:
<PRE>
/usr/local/sbin/smbldap-useradd.pl: unknown group SID not set for unix group 513
</PRE>Answer: 
<UL><LI>
is nss_ldap correctly configured ?
<LI>is the default group's users mapped to the 'Domain Users' NT group ?
<PRE>
net groupmap add rid=513 unixgroup="Domain Users" ntgroup="Domain Users"
</PRE></UL>
<!--TOC subsection smbldap-useradd: Can't call method "get_value" on an undefined value at
/usr/local/sbin/smbldap-useradd line 154-->

<H3><A NAME="htoc38">6.12</A>&nbsp;&nbsp;smbldap-useradd: Can't call method "get_value" on an undefined value at
/usr/local/sbin/smbldap-useradd line 154</H3><!--SEC END -->

<UL><LI>
does the default group defined in smbldap.conf exist
 (defaultUserGid="513") ?
<LI>does the NT "Domain Users" group mapped to a unix
 group of rid 513 (see option <I>-r</I> of <TT>smbldap-groupadd</TT> and
 <TT>smbldap-groupmod</TT> to set a rid) ?
</UL>
<!--TOC subsection Typical errors on creating a new user or a new group-->

<H3><A NAME="htoc39">6.13</A>&nbsp;&nbsp;Typical errors on creating a new user or a new group</H3><!--SEC END -->
<A NAME="faq::error::add::user"></A>
<UL><LI>
i've got the following error: 
<PRE>
Could not find base dn, to get next uidNumber at /usr/local/sbin//smbldap_tools.pm line 909
</PRE><OL type=1><LI>
	you do not have created the object to defined the next uidNumber and gidNumber available.
	<UL><LI>
	for version 0.8.7&nbsp;: you can just run the <TT>smbldap-populate</TT> script that will
		update the sambaDomain entry to store those informations
	<LI>for version before 0.8.7&nbsp;: 
	You have updated the smbldap-tools to version 0.8.5 or newer.
	You have to do this manually. Create an file called <TT>add.ldif</TT> and containing
<PRE>
dn: cn=NextFreeUnixId,dc=example,dc=org
objectClass: inetOrgPerson
objectClass: sambaUnixIdPool
uidNumber: 1000
gidNumber: 1000
cn: NextFreeUnixId
sn: NextFreeUnixId
</PRE>	and then add the object with the ldapadd utility:
<PRE>
$ ldapadd -x -D "cn=Manager,dc=example,dc=org" -w secret -f add.ldif
</PRE>	Here, 1000 is the first available value for uidNumber and gidNumber (of course, if this value is
	already used by a user or a group, the first available after 1000 will be used).
	</UL><BR>
<BR>
<LI>The error also appear when there is a need for TLS (ldapTLS=1 in <TT>smbldap.conf</TT>) and
something is wrong with certificate naming or path settings.
</OL><BR>
<BR>
<LI>i've got the following error:
<PRE>
Use of uninitialized value in string at
/usr/local/sbin//smbldap\_tools.pm line 914.
Error: No DN specified at /usr/local/sbin//smbldap\_tools.pm line 919
</PRE>You have not updated the configuration file to defined the object where are sotred the next
uidNumber and gidNumber available. In our example, you have to add a nex entry in
<I>/etc/opt/IDEALX/smbldap-tools/smbldap.conf</I> containing :
<PRE>
# Where to store next uidNumber and gidNumber available
sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"
</PRE>btw, a new option is now available too: the domain to append to users. You can add to the
configuration file the following lines:
<PRE>
# Domain appended to the users "mail"-attribute
# when smbldap-useradd -M is used mailDomain="idealx.com"
</PRE><BR>
<BR>
<LI>i've got the following error:
<PRE>
Use of uninitialized value in concatenation (.) or string at /usr/local/sbin/smbldap-useradd line 183.
Use of uninitialized value in substitution (s///) at /usr/local/sbin/smbldap-useradd line 185.
Use of uninitialized value in string at /usr/local/sbin/smbldap-useradd line 264.
failed to add entry: homedirectory: value #0 invalid per syntax at /usr/local/sbin/smbldap-useradd line 280.
userHomeDirectory=User "jto" already member of the group "513".
failed to add entry: No such object at /usr/local/sbin/smbldap-useradd line 382.
</PRE>you have to change the variable name <TT>userHomePrefix</TT> to <TT>userHome</TT> in
<I>/etc/opt/IDEALX/smbldap-tools/smbldap.conf</I><BR>
<BR>
<LI>i've got the following error:
<PRE>
failed to add entry: referral missing at /usr/local/sbin/smbldap-useradd line 279, &lt;DATA&gt; line 283.
</PRE>you have to update the configuration file that defined users, groups and computers dn. Those
parameters must not be relative to the <TT>suffix</TT> parameter. A typical
configuration look like this :
<PRE>
usersdn="ou=Users,${suffix}"
computersdn="ou=Computers,${suffix}"
groupsdn="ou=Groups,${suffix}"
</PRE><BR>
<BR>
<LI>i've got the following error:
<PRE>
erreur LDAP: Can't contact master ldap server (IO::Socket::INET: Bad protocol 'tcp')
at /usr/local/sbin//smbldap_tools.pm line 153.
</PRE>remove <I>ldap</I> from <I>/etc/nsswitch.conf</I> for <I>services</I> list of possible check. For
example, if your ldap directory is not configured to give services information, you must have 
<PRE>
services    files
</PRE>and not
<PRE>
services:   ldap [NOTFOUND=return] files
</PRE></UL>

 
<!--TOC section Thanks-->

<H2><A NAME="htoc40">7</A>&nbsp;&nbsp;Thanks</H2><!--SEC END -->

<A NAME="thanks"></A>
People who have worked on this document are
<UL><LI>
Jérôme Tournier &lt;jerome.tournier@IDEALX.com&gt;
<LI>David Barth &lt;david.barth@IDEALX.com&gt;
<LI>Nat Makarevitch &lt;nat@IDEALX.com&gt;
</UL>
The authors would like to thank the following people for providing help with 
some of the more complicated subjects, for clarifying some of the internal 
workings of <FONT COLOR=purple>Samba</FONT> or <FONT COLOR=purple>OpenLDAP</FONT>, for pointing out errors or mistakes in 
previous versions of this document, or generally for making
suggestions :
<UL><LI>
IDEALX team :
 <UL><LI>
 Roméo Adekambi &lt;romeo.adekambi@IDEALX.com&gt;
 <LI>Aurelien Degremont &lt;adegremont@IDEALX.com&gt;
 <LI>Renaud Renard &lt;rrenard@IDEALX.com&gt;
 </UL>
<LI>John H Terpstra &lt;jht@samba.org&gt;
</UL>
 <!--TOC section Annexes-->

<H2><A NAME="htoc41">8</A>&nbsp;&nbsp;Annexes</H2><!--SEC END -->

<!--TOC subsection Full configuration files-->

<H3><A NAME="htoc42">8.1</A>&nbsp;&nbsp;Full configuration files</H3><!--SEC END -->
<A NAME="configuration::files"></A>
<!--TOC subsubsection The <TT>/etc/opt/IDEALX/smbldap-tools/smbldap.conf</TT> file-->

<H4><A NAME="htoc43">8.1.1</A>&nbsp;&nbsp;The <TT>/etc/opt/IDEALX/smbldap-tools/smbldap.conf</TT> file</H4><!--SEC END -->
<A NAME="configuration::file::smbldap"></A>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE># $Source: $
# $Id$
#
# smbldap-tools.conf : Q &amp; D configuration file for smbldap-tools

#  This code was developped by IDEALX (http://IDEALX.org/) and
#  contributors (their names can be found in the CONTRIBUTORS file).
#
#                 Copyright (C) 2001-2002 IDEALX
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
#  USA.

#  Purpose :
#       . be the configuration file for all smbldap-tools scripts

##############################################################################
#
# General Configuration
#
##############################################################################

# Put your own SID. To obtain this number do: "net getlocalsid".
# If not defined, parameter is taking from "net getlocalsid" return
SID="S-1-5-21-2252255531-4061614174-2474224977"

# Domain name the Samba server is in charged.
# If not defined, parameter is taking from smb.conf configuration file
# Ex: sambaDomain="IDEALX-NT"
sambaDomain="DOMSMB"

##############################################################################
#
# LDAP Configuration
#
##############################################################################

# Notes: to use to dual ldap servers backend for Samba, you must patch
# Samba with the dual-head patch from IDEALX. If not using this patch
# just use the same server for slaveLDAP and masterLDAP.
# Those two servers declarations can also be used when you have 
# . one master LDAP server where all writing operations must be done
# . one slave LDAP server where all reading operations must be done
#   (typically a replication directory)

# Slave LDAP server
# Ex: slaveLDAP=127.0.0.1
# If not defined, parameter is set to "127.0.0.1"
slaveLDAP="ldap.example.info"

# Slave LDAP port
# If not defined, parameter is set to "389"
slavePort="389"

# Master LDAP server: needed for write operations
# Ex: masterLDAP=127.0.0.1
# If not defined, parameter is set to "127.0.0.1"
masterLDAP="ldap.example.info"

# Master LDAP port
# If not defined, parameter is set to "389"
#masterPort="389"
masterPort="389"

# Use TLS for LDAP
# If set to 1, this option will use start_tls for connection
# (you should also used the port 389)
# If not defined, parameter is set to "0"
ldapTLS="1"

# Use SSL for LDAP
# If set to 1, this option will use SSL for connection
# (standard port for ldaps is 636)
# If not defined, parameter is set to "0"
ldapSSL="0"

# How to verify the server's certificate (none, optional or require)
# see "man Net::LDAP" in start_tls section for more details
verify="require"

# CA certificate
# see "man Net::LDAP" in start_tls section for more details
cafile="/etc/smbldap-tools/ca.pem"

# certificate to use to connect to the ldap server
# see "man Net::LDAP" in start_tls section for more details
clientcert="/etc/smbldap-tools/smbldap-tools.example.info.pem"

# key certificate to use to connect to the ldap server
# see "man Net::LDAP" in start_tls section for more details
clientkey="/etc/smbldap-tools/smbldap-tools.example.info.key"

# LDAP Suffix
# Ex: suffix=dc=IDEALX,dc=ORG
suffix="dc=example,dc=info"

# Where are stored Users
# Ex: usersdn="ou=Users,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for usersdn
usersdn="ou=Users,${suffix}"

# Where are stored Computers
# Ex: computersdn="ou=Computers,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for computersdn
computersdn="ou=Computers,${suffix}"

# Where are stored Groups
# Ex: groupsdn="ou=Groups,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for groupsdn
groupsdn="ou=Groups,${suffix}"

# Where are stored Idmap entries (used if samba is a domain member server)
# Ex: groupsdn="ou=Idmap,dc=IDEALX,dc=ORG"
# Warning: if 'suffix' is not set here, you must set the full dn for idmapdn
idmapdn="ou=Idmap,${suffix}"

# Where to store next uidNumber and gidNumber available for new users and groups
# If not defined, entries are stored in sambaDomainName object.
# Ex: sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"
# Ex: sambaUnixIdPooldn="cn=NextFreeUnixId,${suffix}"
sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}"

# Default scope Used
scope="sub"

# Unix password encryption (CRYPT, MD5, SMD5, SSHA, SHA, CLEARTEXT)
hash_encrypt="SSHA"

# if hash_encrypt is set to CRYPT, you may set a salt format.
# default is "%s", but many systems will generate MD5 hashed
# passwords if you use "$1$%.8s". This parameter is optional!
crypt_salt_format="%s"

##############################################################################
# 
# Unix Accounts Configuration
# 
##############################################################################

# Login defs
# Default Login Shell
# Ex: userLoginShell="/bin/bash"
userLoginShell="/bin/bash"

# Home directory
# Ex: userHome="/home/%U"
userHome="/home/%U"

# Default mode used for user homeDirectory
userHomeDirectoryMode="700"

# Gecos
userGecos="System User"

# Default User (POSIX and Samba) GID
defaultUserGid="513"

# Default Computer (Samba) GID
defaultComputerGid="515"

# Skel dir
skeletonDir="/etc/skel"

# Default password validation time (time in days) Comment the next line if
# you don't want password to be enable for defaultMaxPasswordAge days (be
# careful to the sambaPwdMustChange attribute's value)
defaultMaxPasswordAge="45"

##############################################################################
#
# SAMBA Configuration
#
##############################################################################

# The UNC path to home drives location (%U username substitution)
# Just set it to a null string if you want to use the smb.conf 'logon home'
# directive and/or disable roaming profiles
# Ex: userSmbHome="\\PDC-SMB3\%U"
userSmbHome="\\PDC-SRV\%U"

# The UNC path to profiles locations (%U username substitution)
# Just set it to a null string if you want to use the smb.conf 'logon path'
# directive and/or disable roaming profiles
# Ex: userProfile="\\PDC-SMB3\profiles\%U"
userProfile="\\PDC-SRV\profiles\%U"

# The default Home Drive Letter mapping
# (will be automatically mapped at logon time if home directory exist)
# Ex: userHomeDrive="H:"
userHomeDrive="H:"

# The default user netlogon script name (%U username substitution)
# if not used, will be automatically username.cmd
# make sure script file is edited under dos
# Ex: userScript="startup.cmd" # make sure script file is edited under dos
userScript="logon.bat"

# Domain appended to the users "mail"-attribute
# when smbldap-useradd -M is used
# Ex: mailDomain="idealx.com"
mailDomain="example.info"

##############################################################################
#
# SMBLDAP-TOOLS Configuration (default are ok for a RedHat)
#
##############################################################################

# Allows not to use smbpasswd (if with_smbpasswd == 0 in smbldap.conf) but
# prefer Crypt::SmbHash library
with_smbpasswd="0"
smbpasswd="/usr/bin/smbpasswd"

# Allows not to use slappasswd (if with_slappasswd == 0 in smbldap.conf)
# but prefer Crypt:: libraries
with_slappasswd="0"
slappasswd="/usr/sbin/slappasswd"

# comment out the following line to get rid of the default banner
# no_banner="1"

</PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE><BR>
<!--TOC subsubsection The <TT>/etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf</TT> file-->

<H4><A NAME="htoc44">8.1.2</A>&nbsp;&nbsp;The <TT>/etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf</TT> file</H4><!--SEC END -->
<A NAME="configuration::file::smbldap::bind"></A>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>############################
# Credential Configuration #
############################
# Notes: you can specify two differents configuration if you use a
# master ldap for writing access and a slave ldap server for reading access
# By default, we will use the same DN (so it will work for standard Samba
# release)
slaveDN="cn=Manager,dc=example,dc=info"
slavePw="secret"
masterDN="cn=Manager,dc=example,dc=info"
masterPw="secret"
</PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE><BR>
<!--TOC subsubsection The samba configuration file : <TT>/etc/samba/smb.conf</TT> -->

<H4><A NAME="htoc45">8.1.3</A>&nbsp;&nbsp;The samba configuration file : <TT>/etc/samba/smb.conf</TT> </H4><!--SEC END -->

<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE># Global parameters
[global]
 workgroup = DOMSMB
 netbios name = PDC-SRV
 security = user
 enable privileges = yes
 #interfaces = 192.168.5.11
 #username map = /etc/samba/smbusers
 server string = Samba Server %v
 #security = ads
 encrypt passwords = Yes
 min passwd length = 3
 #pam password change = no
 #obey pam restrictions = No

 # method 1:
 #unix password sync = no
 #ldap passwd sync = yes

 # method 2:
 unix password sync = yes
 ldap passwd sync = no
 passwd program = /usr/sbin/smbldap-passwd -u "%u"
 passwd chat = "Changing *\nNew password*" %n\n "*Retype new password*" %n\n"

 log level = 0
 syslog = 0
 log file = /var/log/samba/log.%U
 max log size = 100000
 time server = Yes
 socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
 mangling method = hash2
 Dos charset = 850
 Unix charset = ISO8859-1

 logon script = logon.bat
 logon drive = H:
        logon home = 
        logon path = 

 domain logons = Yes
 domain master = Yes
 os level = 65
 preferred master = Yes
 wins support = yes
 # passdb backend = ldapsam:"ldap://ldap1.company.com ldap://ldap2.company.com"
 passdb backend = ldapsam:ldap://127.0.0.1/
 ldap admin dn = cn=Manager,dc=company,dc=com
 #ldap admin dn = cn=samba,ou=DSA,dc=company,dc=com
 ldap suffix = dc=company,dc=com
        ldap group suffix = ou=Groups
        ldap user suffix = ou=Users
        ldap machine suffix = ou=Computers
 #ldap idmap suffix = ou=Idmap
        add user script = /usr/sbin/smbldap-useradd -m "%u"
        #ldap delete dn = Yes
        delete user script = /usr/sbin/smbldap-userdel "%u"
        add machine script = /usr/sbin/smbldap-useradd -t 0 -w "%u"
        add group script = /usr/sbin/smbldap-groupadd -p "%g" 
        #delete group script = /usr/sbin/smbldap-groupdel "%g"
        add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g"
        delete user from group script = /usr/sbin/smbldap-groupmod -x "%u" "%g"
 set primary group script = /usr/sbin/smbldap-usermod -g '%g' '%u'

 # printers configuration
 #printer admin = @"Print Operators"
 load printers = Yes
 create mask = 0640
 directory mask = 0750
 #force create mode = 0640
 #force directory mode = 0750
 nt acl support = No
 printing = cups
 printcap name = cups
 deadtime = 10
 guest account = nobody
 map to guest = Bad User
 dont descend = /proc,/dev,/etc,/lib,/lost+found,/initrd
 show add printer wizard = yes
 ; to maintain capital letters in shortcuts in any of the profile folders:
 preserve case = yes
 short preserve case = yes
 case sensitive = no

[netlogon]
 path = /home/netlogon/
 browseable = No
 read only = yes

[profiles]
 path = /home/profiles
 read only = no
 create mask = 0600
 directory mask = 0700
 browseable = No
 guest ok = Yes
 profile acls = yes
 csc policy = disable
 # next line is a great way to secure the profiles 
 #force user = %U 
 # next line allows administrator to access all profiles 
 #valid users = %U "Domain Admins"

[printers]
        comment = Network Printers
        #printer admin = @"Print Operators"
        guest ok = yes 
        printable = yes
        path = /home/spool/
        browseable = No
        read only  = Yes
        printable = Yes
        print command = /usr/bin/lpr -P%p -r %s
        lpq command = /usr/bin/lpq -P%p
        lprm command = /usr/bin/lprm -P%p %j
        # print command = /usr/bin/lpr -U%U@%M -P%p -r %s
        # lpq command = /usr/bin/lpq -U%U@%M -P%p
        # lprm command = /usr/bin/lprm -U%U@%M -P%p %j
        # lppause command = /usr/sbin/lpc -U%U@%M hold %p %j
        # lpresume command = /usr/sbin/lpc -U%U@%M release %p %j
        # queuepause command = /usr/sbin/lpc -U%U@%M stop %p
        # queueresume command = /usr/sbin/lpc -U%U@%M start %p

[print$]
        path = /home/printers
        guest ok = No
        browseable = Yes
        read only = Yes
        valid users = @"Print Operators"
        write list = @"Print Operators"
        create mask = 0664
        directory mask = 0775

[public]
 path = /tmp
 guest ok = yes
 browseable = Yes
 writable = yes
</PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE><BR>
<!--TOC subsubsection The OpenLDAP configuration file : <TT>/etc/openldap/slapd.conf</TT>-->

<H4><A NAME="htoc46">8.1.4</A>&nbsp;&nbsp;The OpenLDAP configuration file : <TT>/etc/openldap/slapd.conf</TT></H4><!--SEC END -->

<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>#
# See slapd.conf(5) for details on configuration options.
# This file should NOT be world readable.
#
include  /etc/openldap/schema/core.schema
include  /etc/openldap/schema/cosine.schema
include  /etc/openldap/schema/inetorgperson.schema
include  /etc/openldap/schema/nis.schema
include  /etc/openldap/schema/samba.schema

schemacheck on

# Allow LDAPv2 client connections.  This is NOT the default.
allow bind_v2

# Do not enable referrals until AFTER you have a working directory
# service AND an understanding of referrals.
#referral ldap://root.openldap.org

pidfile  /var/run/slapd.pid
argsfile /var/run/slapd.args

# Load dynamic backend modules:
# modulepath /usr/sbin/openldap
# moduleload back_bdb.la
# moduleload back_ldap.la
# moduleload back_ldbm.la
# moduleload back_passwd.la
# moduleload back_shell.la

# The next three lines allow use of TLS for encrypting connections using a
# dummy test certificate which you can generate by changing to
# /usr/share/ssl/certs, running "make slapd.pem", and fixing permissions on
# slapd.pem so that the ldap user or group can read it.  Your client software
# may balk at self-signed certificates, however.
#TLSCertificateFile /etc/openldap/ldap.company.com.pem
#TLSCertificateKeyFile /etc/openldap/ldap.company.com.key
#TLSCACertificateFile /etc/openldap/ca.pem
#TLSCipherSuite :SSLv3

# Sample security restrictions
# Require integrity protection (prevent hijacking)
# Require 112-bit (3DES or better) encryption for updates
# Require 63-bit encryption for simple bind
# security ssf=1 update_ssf=112 simple_bind=64

# Sample access control policy:
# Root DSE: allow anyone to read it
# Subschema (sub)entry DSE: allow anyone to read it
# Other DSEs:
#  Allow self write access
#  Allow authenticated users read access
#  Allow anonymous users to authenticate
# Directives needed to implement policy:
# access to dn.base="" by * read
# access to dn.base="cn=Subschema" by * read
# access to *
# by self write
# by users read
# by anonymous auth
#
# if no access controls are present, the default policy
# allows anyone and everyone to read anything but restricts
# updates to rootdn.  (e.g., "access to * by * read")
#
# rootdn can always read and write EVERYTHING!

#######################################################################
# ldbm and/or bdb database definitions
#######################################################################

database bdb
suffix  "dc=company,dc=com"
rootdn  "cn=Manager,dc=company,dc=com"
# Cleartext passwords, especially for the rootdn, should
# be avoided.  See slappasswd(8) and slapd.conf(5) for details.
# Use of strong authentication encouraged.
rootpw  secret
# rootpw  {crypt}ijFYNcSNctBYg

# The database directory MUST exist prior to running slapd AND 
# should only be accessible by the slapd and slap tools.
# Mode 700 recommended.
directory /var/lib/ldap
lastmod  on

# Indices to maintain for this database
index objectClass                       eq,pres
index ou,cn,sn,mail,givenname    eq,pres,sub
index uidNumber,gidNumber,memberUid     eq,pres
index loginShell   eq,pres
## required to support pdb_getsampwnam
index uid                       pres,sub,eq
## required to support pdb_getsambapwrid()
index displayName               pres,sub,eq
index nisMapName,nisMapEntry            eq,pres,sub
index sambaSID                eq
index sambaPrimaryGroupSID   eq
index sambaDomainName         eq
index default                sub


# users can authenticate and change their password
access to attrs=userPassword,sambaNTPassword,sambaLMPassword,sambaPwdMustChange,sambaPwdLastSet
      by dn="cn=Manager,dc=company,dc=com" write
      by self write
      by anonymous auth
      by * none

# those 2 parameters must be world readable for password aging to work correctly
# (or use a priviledge account in /etc/ldap.conf to bind to the directory)
access to attrs=shadowLastChange,shadowMax
      by dn="cn=Manager,dc=company,dc=com" write
      by self write
      by * read

# all others attributes are readable to everybody
access to *
      by * read

# Replicas of this database
#replogfile /var/lib/ldap/openldap-master-replog
#replica host=ldap-1.example.com:389 starttls=critical
#     bindmethod=sasl saslmech=GSSAPI
#     authcId=host/ldap-master.example.com@EXAMPLE.COM
</PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE><BR>
<!--TOC subsection Changing the administrative account (<TT>ldap admin
 dn</TT> in <TT>smb.conf</TT> file)-->

<H3><A NAME="htoc47">8.2</A>&nbsp;&nbsp;Changing the administrative account (<TT>ldap admin
 dn</TT> in <TT>smb.conf</TT> file)</H3><!--SEC END -->
<A NAME="change::manager"></A>
If you don't want to use the <TT>cn=Manager,dc=example,dc=com</TT>
account anymore, you can create a dedicated account for Samba and the
smbldap-tools scripts. To do
this, create an account named <I>samba</I> as follows (see
section <A HREF="#add::user">4.2.1</A> for a more detailed syntax) :
<PRE>
smbldap-useradd -s /bin/false -d /dev/null -P samba
</PRE>This command will ask you to set a password for this account. Let's
set it to <I>samba</I> for this example.
You then need to modify configuration files:
<UL><LI>
file <TT>/etc/opt/IDEALX/smbldap-tools/smbldap_bind.conf</TT>
 <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>
    slaveDN="uid=samba,ou=Users,dc=example,dc=com"
    slavePw="samba"
    masterDN="uid=samba,ou=Users,dc=example,dc=com"
    masterPw="samba"
  </PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE><LI>file <TT>/etc/samba/smb.conf</TT>
 <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>
    ldap admin dn = uid=samba,ou=Users,dc=example,dc=com
  </PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE>don't forget to also set the samba account password in
 <TT>secrets.tdb</TT> file : 
<PRE>
smbpasswd -w samba
</PRE><LI>file <TT>/etc/openldap/slapd.conf</TT>: give to the
 <I>samba</I> user permissions to modify some attributes: this
 user needs to be able to modify all the samba attributes and some
 others (uidNumber, gidNumber ...) :
 <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>
<TR><TD><TABLE BORDER=0 CELLPADDING=0
 CELLSPACING=0>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
<TD><TABLE BORDER=0 CELLPADDING="1" CELLSPACING=0>
<TR><TD><PRE>
# users can authenticate and change their password
access to attrs=userPassword,sambaNTPassword,sambaLMPassword,sambaPwdLastSet,sambaPwdMustChange
      by dn="uid=samba,ou=Users,dc=example,dc=com" write
      by self write
      by anonymous auth
      by * none
# some attributes need to be readable anonymously so that 'id user' can answer correctly
access to attrs=objectClass,entry,gecos,homeDirectory,uid,uidNumber,gidNumber,cn,memberUid
      by dn="uid=samba,ou=Users,dc=example,dc=com" write
      by * read
# somme attributes can be writable by users themselves
access to attrs=description,telephoneNumber
      by dn="uid=samba,ou=Users,dc=example,dc=com" write
      by self write
      by * read
# some attributes need to be writable for samba
access to attrs=cn,sambaLMPassword,sambaNTPassword,sambaPwdLastSet,sambaLogonTime,sambaLogoffTime,sambaKickoffTime,
 sambaPwdCanChange,sambaPwdMustChange,sambaAcctFlags,displayName,sambaHomePath,sambaHomeDrive,sambaLogonScript,
 sambaProfilePath,description,sambaUserWorkstations,sambaPrimaryGroupSID,sambaDomainName,sambaSID,sambaGroupType,
 sambaNextRid,sambaNextGroupRid,sambaNextUserRid,sambaAlgorithmicRidBase
      by dn="uid=samba,ou=Users,dc=example,dc=com" write
      by self read
      by * none
# samba need to be able to create the samba domain account
access to dn.base="dc=example,dc=com"
      by dn="uid=samba,ou=Users,dc=example,dc=com" write
      by * none
# samba need to be able to create new users account
access to dn="ou=Users,dc=example,dc=com"
      by dn="uid=samba,ou=Users,dc=example,dc=com" write
      by * none
# samba need to be able to create new groups account
access to dn="ou=Groups,dc=example,dc=com"
      by dn="uid=samba,ou=Users,dc=example,dc=com" write
      by * none
# samba need to be able to create new computers account
access to dn="ou=Computers,dc=example,dc=com"
      by dn="uid=samba,ou=Users,dc=example,dc=com" write
      by * none
# this can be omitted but we leave it: there could be other branch
# in the directory
access to *
      by self read
      by * none
  </PRE></TD>
</TR></TABLE></TD>
<TD BGCOLOR=black COLSPAN="1"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR>
<TR><TD BGCOLOR=black COLSPAN="3"><TABLE CELLSPACING="1" CELLPADDING=0 BORDER=0>
<TR><TD>
 </TD>
</TR></TABLE></TD>
</TR></TABLE></TD>
</TR></TABLE></UL>
<!--TOC subsection known bugs-->

<H3><A NAME="htoc48">8.3</A>&nbsp;&nbsp;known bugs</H3><!--SEC END -->

<UL><LI>
Option <I>-B</I> (user must change password) of
 <TT>smbldap-useradd</TT> does not have effect: when 
 <TT>smbldap-passwd</TT> script is called,
 <I>sambaPwdMustChange</I> attribute is rewrite.
</UL>
 
<!--BEGIN NOTES document-->
<HR WIDTH="50%" SIZE=1><DL><DT><A NAME="note1" HREF="#text1"><FONT SIZE=5>1</FONT></A><DD><A HREF="http://IDEALX.com/"><TT>http://IDEALX.com/</TT></A>
</DL>
<!--END NOTES-->
<!--HTMLFOOT-->


<DIV class="piedpage">
<HR>
<P>Documents&nbsp;: Copyright &copy; 2002 IDEALX S.A.S..
'IDEALX' is the property of IDEALX.
'Samba' is the property of Samba Team. All other trademarks belong to their respective owners.
</DIV>

<!--ENDHTML-->
<!--FOOTER-->
<HR SIZE=2>
<BLOCKQUOTE><EM>This document was translated from L<sup>A</sup>T<sub>E</sub>X by
</EM><A HREF="http://pauillac.inria.fr/~maranget/hevea/index.html"><EM>H<FONT SIZE=2><sup>E</sup></FONT>V<FONT SIZE=2><sup>E</sup></FONT>A</EM></A><EM>.
</EM></BLOCKQUOTE>
</BODY>
</HTML>