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
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>AppendixA.Appendix: A Collection of Useful Tid-bits</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"><link rel="start" href="index.html" title="Samba-3 by Example"><link rel="up" href="index.html" title="Samba-3 by Example"><link rel="prev" href="HA.html" title="Chapter13.Performance, Reliability, and Availability"><link rel="next" href="gpl.html" title="AppendixB.GNU General Public License"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">AppendixA.Appendix: A Collection of Useful Tid-bits</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="HA.html">Prev</a></td><th width="60%" align="center"></th><td width="20%" align="right"><a accesskey="n" href="gpl.html">Next</a></td></tr></table><hr></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="appendix"></a>AppendixA.Appendix: A Collection of Useful Tid-bits</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="appendix.html#domjoin">Joining a Domain: Windows 200x/XP Professional</a></span></dt><dt><span class="sect1"><a href="appendix.html#id2596337">Samba System File Location</a></span></dt><dt><span class="sect1"><a href="appendix.html#id2596757">Starting Samba</a></span></dt><dt><span class="sect1"><a href="appendix.html#id2597092">DNS Configuration Files</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix.html#id2597104">The Forward Zone File for the Loopback Adaptor</a></span></dt><dt><span class="sect2"><a href="appendix.html#id2597153">The Reverse Zone File for the Loopback Adaptor</a></span></dt><dt><span class="sect2"><a href="appendix.html#id2597293">DNS Root Server Hint File</a></span></dt></dl></dd><dt><span class="sect1"><a href="appendix.html#altldapcfg">Alternative LDAP Database Initialization</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix.html#id2597353">Initialization of the LDAP Database</a></span></dt></dl></dd><dt><span class="sect1"><a href="appendix.html#id2597909">The LDAP Account Manager</a></span></dt><dt><span class="sect1"><a href="appendix.html#ch12-SUIDSGID">Effect of Setting File and Directory SUID/SGID Permissions Explained</a></span></dt><dt><span class="sect1"><a href="appendix.html#ch12dblck">Shared Data Integrity</a></span></dt><dd><dl><dt><span class="sect2"><a href="appendix.html#id2599324">Microsoft Access</a></span></dt><dt><span class="sect2"><a href="appendix.html#id2599471">Act! Database Sharing</a></span></dt><dt><span class="sect2"><a href="appendix.html#id2599555">Opportunistic Locking Controls</a></span></dt></dl></dd></dl></div><p><a class="indexterm" name="id2595728"></a><a class="indexterm" name="id2595735"></a>
Information presented here is considered to be either basic or well-known material that is informative
yet helpful. Over the years, I have observed an interesting behavior. There is an expectation that
the process for joining a Windows client to a Samba-controlled Windows Domain may somehow involve steps
different from doing so with Windows NT4 or a Windows ADS Domain. Be assured that the steps are identical,
as shown in the example given below.
</p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="domjoin"></a>Joining a Domain: Windows 200x/XP Professional</h2></div></div></div><p><a class="indexterm" name="id2595768"></a>
Microsoft Windows NT/200x/XP Professional platforms can participate in Domain Security.
This section steps through the process for making a Windows 200x/XP Professional machine a
member of a Domain Security environment. It should be noted that this process is identical
when joining a domain that is controlled by Windows NT4/200x as well as a Samba PDC.
</p><div class="procedure"><ol type="1"><li><p>
Click <span class="guimenu">Start</span>.
</p></li><li><p>
Right-click <span class="guimenu">My Computer</span>, and then select <span class="guimenuitem">Properties</span>.
</p></li><li><p>
The opening panel is the same one that can be reached by clicking <span class="guimenu">System</span> on the Control Panel.
See <a href="appendix.html#wxpp001" title="FigureA.1.The General Panel.">???</a>.
</p><div class="figure"><a name="wxpp001"></a><p class="title"><b>FigureA.1.The General Panel.</b></p><div class="mediaobject"><img src="images/wxpp001.png" alt="The General Panel."></div></div><p>
</p></li><li><p>
Click the <span class="guimenu">Computer Name</span> tab.
This panel shows the <span class="guimenuitem">Computer Description</span>, the <span class="guimenuitem">Full computer name</span>,
and the <span class="guimenuitem">Workgroup</span> or <span class="guimenuitem">Domain name</span>.
</p><p>
Clicking the <span class="guimenu">Network ID</span> button launches the configuration wizard. Do not use this with
Samba-3. If you wish to change the computer name, or join or leave the domain, click the <span class="guimenu">Change</span> button.
See <a href="appendix.html#wxpp004" title="FigureA.2.The Computer Name Panel.">???</a>.
</p><div class="figure"><a name="wxpp004"></a><p class="title"><b>FigureA.2.The Computer Name Panel.</b></p><div class="mediaobject"><img src="images/wxpp004.png" alt="The Computer Name Panel."></div></div><p>
</p></li><li><p>
Click on <span class="guimenu">Change</span>. This panel shows that our example machine (TEMPTATION) is in a workgroup called WORKGROUP.
We join the domain called MIDEARTH. See <a href="appendix.html#wxpp006" title="FigureA.3.The Computer Name Changes Panel.">???</a>.
</p><div class="figure"><a name="wxpp006"></a><p class="title"><b>FigureA.3.The Computer Name Changes Panel.</b></p><div class="mediaobject"><img src="images/wxpp006.png" alt="The Computer Name Changes Panel."></div></div><p>
</p></li><li><p>
Enter the name <span class="guimenu">MIDEARTH</span> in the field below the Domain radio button.
</p><p>
This panel shows that our example machine (TEMPTATION) is set to join the domain called MIDEARTH. See <a href="appendix.html#wxpp007" title="FigureA.4.The Computer Name Changes Panel Domain MIDEARTH.">???</a>.
</p><div class="figure"><a name="wxpp007"></a><p class="title"><b>FigureA.4.The Computer Name Changes Panel Domain MIDEARTH.</b></p><div class="mediaobject"><img src="images/wxpp007.png" alt="The Computer Name Changes Panel Domain MIDEARTH."></div></div><p>
</p></li><li><p>
Now click the <span class="guimenu">OK</span> button. A dialog box should appear to allow you to provide the credentials (username and password)
of a Domain administrative account that has the rights to add machines to the Domain.
</p><p>
Enter the name “<span class="quote"><span class="emphasis"><em>root</em></span></span>” and the root password from your Samba-3 server. See <a href="appendix.html#wxpp008" title="FigureA.5.Computer Name Changes User name and Password Panel.">???</a>.
</p><div class="figure"><a name="wxpp008"></a><p class="title"><b>FigureA.5.Computer Name Changes User name and Password Panel.</b></p><div class="mediaobject"><img src="images/wxpp008.png" alt="Computer Name Changes User name and Password Panel."></div></div><p>
</p></li><li><p>
Click <span class="guimenu">OK</span>.
</p><p>
The “<span class="quote"><span class="emphasis"><em>Welcome to the MIDEARTH domain</em></span></span>” dialog box should appear. At this point, the machine must be rebooted.
Joining the domain is now complete.
</p></li></ol></div><p><a class="indexterm" name="id2596217"></a><a class="indexterm" name="id2596225"></a>
The screen capture shown in <a href="appendix.html#wxpp007" title="FigureA.4.The Computer Name Changes Panel Domain MIDEARTH.">???</a> has a button labeled <span class="guimenu">More...</span>. This button opens a
panel in which you can set (or change) the Primary DNS suffix of the computer. This is a parameter that mainly affects members
of Microsoft Active Directory. Active Directory is heavily oriented around the DNS name space.
</p><p><a class="indexterm" name="id2596253"></a><a class="indexterm" name="id2596261"></a>
Where NetBIOS technology uses WINS as well as UDP broadcast as key mechanisms for name resolution, Active Directory servers
register their services with the Microsoft Dynamic DNS server. Windows clients must be able to query the correct DNS server
to find the services (like which machines are Domain Controllers or which machines have the Netlogon service running).
</p><p><a class="indexterm" name="id2596280"></a>
The default setting of the Primary DNS suffix is the Active Directory domain name. When you change the Primary DNS suffix,
this does not affect Domain Membership, but it can break network browsing and the ability to resolve your computer name to
a valid IP address.
</p><p>
The Primary DNS suffix parameter principally affects MS Windows clients that are members of an Active Directory domain.
Where the client is a member of a Samba Domain, it is preferable to leave this field blank.
</p><p><a class="indexterm" name="id2596306"></a>
According to Microsoft documentation, “<span class="quote"><span class="emphasis"><em>If this computer belongs to a group with <tt class="constant">Group Policy</tt>
enabled on <span><b class="command">Primary DNS suffice of this computer</b></span>, the string specified in the Group Policy is used
as the primary DNS suffix and you might need to restart your computer to view the correct setting. The local setting is
used only if Group Policy is disabled or unspecified.</em></span></span>”
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2596337"></a>Samba System File Location</h2></div></div></div><p><a class="indexterm" name="id2596344"></a><a class="indexterm" name="id2596352"></a><a class="indexterm" name="id2596360"></a>
One of the frustrations expressed by subscribers to the Samba mailing lists revolves around the choice of where the default Samba Team
build and installation process locates its Samba files. The location, chosen in the early 1990s, for the default installation is
in the <tt class="filename">/usr/local/samba</tt> directory. This is a perfectly reasonable location, particularly given all the other
Open Source software that installs into the <tt class="filename">/usr/local</tt> subdirectories.
</p><p>
Several UNIX vendors, and Linux vendors in particular, elected to locate the Samba files in a location other than the Samba Team
default.
</p><p><a class="indexterm" name="id2596396"></a><a class="indexterm" name="id2596407"></a><a class="indexterm" name="id2596415"></a><a class="indexterm" name="id2596426"></a><a class="indexterm" name="id2596434"></a><a class="indexterm" name="id2596445"></a><a class="indexterm" name="id2596453"></a><a class="indexterm" name="id2596461"></a><a class="indexterm" name="id2596469"></a><a class="indexterm" name="id2596476"></a><a class="indexterm" name="id2596484"></a><a class="indexterm" name="id2596492"></a><a class="indexterm" name="id2596500"></a><a class="indexterm" name="id2596508"></a><a class="indexterm" name="id2596516"></a><a class="indexterm" name="id2596524"></a>
Linux vendors, working in conjunction with the Free Standards Group (FSG), Linux Standards Base (LSB), and File Hierarchy
System (FHS), have elected to locate the configuration files under the <tt class="filename">/etc/samba</tt> directory, common binary
files (those used by users) in the <tt class="filename">/usr/bin</tt> directory, and the administrative files (daemons) in the
<tt class="filename">/usr/sbin</tt> directory. Support files for the Samba Web Admin Tool (SWAT) are located under the
<tt class="filename">/usr/share</tt> directory, either in <tt class="filename">/usr/share/samba/swat</tt> or in
<tt class="filename">/usr/share/swat</tt>. There are additional support files for <span><b class="command">smbd</b></span> in the
<tt class="filename">/usr/lib/samba</tt> directory tree. The files located there include the dynamically loadable modules for the
passdb backend as well as for the VFS modules.
</p><p><a class="indexterm" name="id2596593"></a><a class="indexterm" name="id2596601"></a><a class="indexterm" name="id2596609"></a>
Samba creates run-time control files and generates log files. The run-time control files (tdb and dat files) are stored in
the <tt class="filename">/var/lib/samba</tt> directory. Log files are created in <tt class="filename">/var/log/samba.</tt>
</p><p>
When Samba is built and installed using the default Samba Team process, all files are located under the
<tt class="filename">/usr/local/samba</tt> directory tree. This makes it simple to find the files that Samba owns.
</p><p><a class="indexterm" name="id2596648"></a>
One way to find the Samba files that are installed on your UNIX/Linux system is to search for the location
of all files called <span><b class="command">smbd</b></span>. Here is an example:
</p><pre class="screen">
<tt class="prompt">root# </tt> find / -name smbd -print
</pre><p>
You can find the location of the configuration files by running:
</p><pre class="screen">
<tt class="prompt">root# </tt> /path-to-binary-file/smbd -b | more
...
Paths:
SBINDIR: /usr/sbin
BINDIR: /usr/bin
SWATDIR: /usr/share/samba/swat
CONFIGFILE: /etc/samba/smb.conf
LOGFILEBASE: /var/log/samba
LMHOSTSFILE: /etc/samba/lmhosts
LIBDIR: /usr/lib/samba
SHLIBEXT: so
LOCKDIR: /var/lib/samba
PIDDIR: /var/run/samba
SMB_PASSWD_FILE: /etc/samba/smbpasswd
PRIVATE_DIR: /etc/samba
...
</pre><p>
If you wish to locate the Samba version, just run:
</p><pre class="screen">
<tt class="prompt">root# </tt> /path-to-binary-file/smbd -V
Version 3.0.12-SUSE
</pre><p>
</p><p>
Many people have been caught by installation of Samba using the default Samba Team process when it was already installed
by the platform vendor's method. If your platform uses RPM format packages, you can check to see if Samba is installed by
executing:<a class="indexterm" name="id2596721"></a>
</p><pre class="screen">
<tt class="prompt">root# </tt> rpm -qa | grep samba
samba3-pdb-3.0.12-1
samba3-vscan-0.3.5-0
samba3-winbind-3.0.12-1
samba3-3.0.12-1
samba3-python-3.0.12-1
samba3-utils-3.0.12-1
samba3-doc-3.0.12-1
samba3-client-3.0.12-1
samba3-cifsmount-3.0.12-1
</pre><p><a class="indexterm" name="id2596744"></a>
The package names, of course, vary according to how the vendor, or the binary package builder, prepared them.
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2596757"></a>Starting Samba</h2></div></div></div><p><a class="indexterm" name="id2596764"></a>
Samba essentially consists of two or three daemons. A daemon is a UNIX application that runs in the background and provides services.
An example of a service is the Apache Web server for which the daemon is called <span><b class="command">httpd</b></span>. In the case of Samba, there
are three daemons, two of which are needed as a minimum.
</p><p>
The Samba server is made up of the following daemons:
</p><div class="example"><a name="ch12SL"></a><p class="title"><b>ExampleA.1.A Useful Samba Control Script for SuSE Linux</b></p><pre class="screen">
#!/bin/bash
#
# Script to start/stop samba
# Locate this in /sbin as a file called 'samba'
RCD=/etc/rc.d
if [ z$1 == 'z' ]; then
echo $0 - No arguments given; must be start or stop.
exit
fi
if [ $1 == 'start' ]; then
${RCD}/nmb start
${RCD}/smb start
${RCD}/winbind start
fi
if [ $1 == 'stop' ]; then
${RCD}/smb stop
${RCD}/winbind stop
${RCD}/nmb stop
fi
if [ $1 == 'restart' ]; then
${RCD}/smb stop
${RCD}/winbind stop
${RCD}/nmb stop
sleep 5
${RCD}/nmb start
${RCD}/smb start
${RCD}/winbind start
fi
exit 0
</pre></div><div class="variablelist"><dl><dt><span class="term">nmbd</span></dt><dd><p>
<a class="indexterm" name="id2596826"></a>
<a class="indexterm" name="id2596833"></a>
This daemon handles all name registration and resolution requests. It is the primary vehicle involved
in network browsing. It handles all UDP-based protocols. The <span><b class="command">nmbd</b></span> daemon should
be the first command started as part of the Samba startup process.
</p></dd><dt><span class="term">smbd</span></dt><dd><p>
<a class="indexterm" name="id2596862"></a>
<a class="indexterm" name="id2596869"></a>
This daemon handles all TCP/IP-based connection services for file- and print-based operations. It also
manages local authentication. It should be started immediately following the startup of <span><b class="command">nmbd</b></span>.
</p></dd><dt><span class="term">winbindd</span></dt><dd><p>
<a class="indexterm" name="id2596898"></a>
<a class="indexterm" name="id2596905"></a>
This daemon should be started when Samba is a member of a Windows NT4 or ADS Domain. IT is also needed when
Samba has trust relationships with another Domain. The <span><b class="command">winbindd</b></span> daemon will check the
<tt class="filename">smb.conf</tt> file for the presence of the <i class="parameter"><tt>idmap uid</tt></i> and <i class="parameter"><tt>idmap gid</tt></i>
parameters. If they are not found, <span><b class="command">winbindd</b></span> bails out and refuses to start.
</p></dd></dl></div><p>
When Samba has been packaged by an operating system vendor, the startup process is typically a custom feature of its
integration into the platform as a whole. Please refer to your operating system platform administration manuals for
specific information pertaining to correct management of Samba startup.
</p><div class="example"><a name="ch12RHscript"></a><p class="title"><b>ExampleA.2.</b></p><pre class="screen">
#!/bin/sh
#
# chkconfig: 345 81 35
# description: Starts and stops the Samba smbd and nmbd daemons \
# used to provide SMB network services.
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
CONFIG=/etc/samba/smb.conf
# Check that smb.conf exists.
[ -f $CONFIG ] || exit 0
# See how we were called.
case "$1" in
start)
echo -n "Starting SMB services: "
daemon smbd -D; daemon nmbd -D; echo;
touch /var/lock/subsys/smb
;;
stop)
echo -n "Shutting down SMB services: "
smbdpids=`ps guax | grep smbd | grep -v grep | awk '{print $2}'`
for pid in $smbdpids; do
kill -TERM $pid
done
killproc nmbd -TERM; rm -f /var/lock/subsys/smb
echo ""
;;
status)
status smbd; status nmbd;
;;
restart)
echo -n "Restarting SMB services: "
$0 stop; $0 start;
echo "done."
;;
*)
echo "Usage: smb {start|stop|restart|status}"
exit 1
esac
</pre></div><p><a class="indexterm" name="id2597013"></a>
SUSE Linux implements individual control over each Samba daemon. A samba control script that can be conveniently
executed from the command line is shown in <a href="appendix.html#ch12SL" title="ExampleA.1.A Useful Samba Control Script for SuSE Linux">???</a>. This can be located in the directory
<tt class="filename">/sbin</tt> in a file called <tt class="filename">samba</tt>. This type of control script should be
owned by user root and group root, and set so that only root can execute it.
</p><p><a class="indexterm" name="id2597049"></a>
A sample startup script for a Red Hat Linux system is shown in <a href="appendix.html#ch12RHscript" title="ExampleA.2.">???</a>.
This file could be located in the directory <tt class="filename">/etc/rc.d</tt> and can be called
<tt class="filename">samba</tt>. A similar startup script is required to control <span><b class="command">winbind</b></span>.
If you want to find more information regarding startup scripts please refer to the packaging section of
the Samba source code distribution tarball. The packaging files for each platform include a
startup control file.
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2597092"></a>DNS Configuration Files</h2></div></div></div><p>
The following files are common to all DNS server configurations. Rather than repeat them multiple times, they
are presented here for general reference.
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2597104"></a>The Forward Zone File for the Loopback Adaptor</h3></div></div></div><p>
The forward zone file for the loopback address never changes. An example file is shown
in <a href="appendix.html#loopback" title="ExampleA.3.DNS Localhost Forward Zone File: /var/lib/named/localhost.zone">???</a>. All traffic destined for an IP address that is hosted on a
physical interface on the machine itself is routed to the loopback adaptor. This is
a fundamental design feature of the TCP/IP protocol implementation. The loopback adaptor
is called <tt class="constant">localhost</tt>.
</p><div class="example"><a name="loopback"></a><p class="title"><b>ExampleA.3.DNS Localhost Forward Zone File: <tt class="filename">/var/lib/named/localhost.zone</tt></b></p><pre class="screen">
$TTL 1W
@ IN SOA @ root (
42 ; serial
2D ; refresh
4H ; retry
6W ; expiry
1W ) ; minimum
IN NS @
IN A 127.0.0.1
</pre></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2597153"></a>The Reverse Zone File for the Loopback Adaptor</h3></div></div></div><p>
The reverse zone file for the loopback address as shown in <a href="appendix.html#dnsloopy" title="ExampleA.4.DNS Localhost Reverse Zone File: /var/lib/named/127.0.0.zone">???</a>
is necessary so that references to the address <tt class="constant">127.0.0.1</tt> can be
resolved to the correct name of the interface.
</p><div class="example"><a name="dnsloopy"></a><p class="title"><b>ExampleA.4.DNS Localhost Reverse Zone File: <tt class="filename">/var/lib/named/127.0.0.zone</tt></b></p><pre class="screen">
$TTL 1W
@ IN SOA localhost. root.localhost. (
42 ; serial
2D ; refresh
4H ; retry
6W ; expiry
1W ) ; minimum
IN NS localhost.
1 IN PTR localhost.
</pre></div><div class="example"><a name="roothint"></a><p class="title"><b>ExampleA.5.DNS Root Name Server Hint File: <tt class="filename">/var/lib/named/root.hint</tt></b></p><pre class="screen">
; This file is made available by InterNIC under anonymous FTP as
; file /domain/named.root
; on server FTP.INTERNIC.NET
; last update: Nov 5, 2002. Related version of root zone: 2002110501
; formerly NS.INTERNIC.NET
. 3600000 IN NS A.ROOT-SERVERS.NET.
A.ROOT-SERVERS.NET. 3600000 A 198.41.0.4
; formerly NS1.ISI.EDU
. 3600000 NS B.ROOT-SERVERS.NET.
B.ROOT-SERVERS.NET. 3600000 A 128.9.0.107
; formerly C.PSI.NET
. 3600000 NS C.ROOT-SERVERS.NET.
C.ROOT-SERVERS.NET. 3600000 A 192.33.4.12
; formerly TERP.UMD.EDU
. 3600000 NS D.ROOT-SERVERS.NET.
D.ROOT-SERVERS.NET. 3600000 A 128.8.10.90
; formerly NS.NASA.GOV
. 3600000 NS E.ROOT-SERVERS.NET.
E.ROOT-SERVERS.NET. 3600000 A 192.203.230.10
; formerly NS.ISC.ORG
. 3600000 NS F.ROOT-SERVERS.NET.
F.ROOT-SERVERS.NET. 3600000 A 192.5.5.241
; formerly NS.NIC.DDN.MIL
. 3600000 NS G.ROOT-SERVERS.NET.
G.ROOT-SERVERS.NET. 3600000 A 192.112.36.4
; formerly AOS.ARL.ARMY.MIL
. 3600000 NS H.ROOT-SERVERS.NET.
H.ROOT-SERVERS.NET. 3600000 A 128.63.2.53
; formerly NIC.NORDU.NET
. 3600000 NS I.ROOT-SERVERS.NET.
I.ROOT-SERVERS.NET. 3600000 A 192.36.148.17
; operated by VeriSign, Inc.
. 3600000 NS J.ROOT-SERVERS.NET.
J.ROOT-SERVERS.NET. 3600000 A 192.58.128.30
; housed in LINX, operated by RIPE NCC
. 3600000 NS K.ROOT-SERVERS.NET.
K.ROOT-SERVERS.NET. 3600000 A 193.0.14.129
; operated by IANA
. 3600000 NS L.ROOT-SERVERS.NET.
L.ROOT-SERVERS.NET. 3600000 A 198.32.64.12
; housed in Japan, operated by WIDE
. 3600000 NS M.ROOT-SERVERS.NET.
M.ROOT-SERVERS.NET. 3600000 A 202.12.27.33
; End of File
</pre></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2597293"></a>DNS Root Server Hint File</h3></div></div></div><p>
The content of the root hints file as shown in <a href="appendix.html#roothint" title="ExampleA.5.DNS Root Name Server Hint File: /var/lib/named/root.hint">???</a> changes slowly over time.
Periodically this file should be updated from the source shown. Because
of its size this file is located at the end of this appendix.
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="altldapcfg"></a>Alternative LDAP Database Initialization</h2></div></div></div><p><a class="indexterm" name="id2597324"></a><a class="indexterm" name="id2597336"></a>
The following procedure may be used as an alternative means of configuring
the initial LDAP database. Many administrators prefer to have greater control
over how system files get configured.
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2597353"></a>Initialization of the LDAP Database</h3></div></div></div><p><a class="indexterm" name="id2597360"></a><a class="indexterm" name="id2597368"></a><a class="indexterm" name="id2597379"></a>
The first step to get the LDAP server ready for action is to create the LDIF file from
which the LDAP database will be preloaded. This is necessary to create the containers
into which the user, group, and so on, accounts is written. It is also necessary to
preload the well-known Windows NT Domain Groups, as they must have the correct SID so
that they can be recognized as special NT Groups by the MS Windows clients.
</p><div class="procedure"><a name="ldapinit"></a><ol type="1"><li><p>
Create a directory in which to store the files you use to generate
the LDAP LDIF file for your system. Execute the following:
</p><pre class="screen">
<tt class="prompt">root# </tt> mkdir /etc/openldap/SambaInit
<tt class="prompt">root# </tt> chown root.root /etc/openldap/SambaInit
<tt class="prompt">root# </tt> chmod 700 /etc/openldap/SambaInit
</pre><p>
</p></li><li><p>
Install the files shown in <a href="appendix.html#ch6-ldapreconfa" title="ExampleA.6.LDAP Pre-configuration Script: SMBLDAP-ldif-preconfig.sh Part A">???</a>, <a href="appendix.html#ch6-ldapreconfb" title="ExampleA.7.LDAP Pre-configuration Script: SMBLDAP-ldif-preconfig.sh Part B">???</a>,
and <a href="appendix.html#ch6-ldapreconfc" title="ExampleA.8.LDAP Pre-configuration Script: SMBLDAP-ldif-preconfig.sh Part C">???</a> into the directory
<tt class="filename">/etc/openldap/SambaInit/SMBLDAP-ldif-preconfig.sh.</tt> These three files are,
respectively, Part A, B, and C of the <tt class="filename">SMBLDAP-ldif-preconfig.sh</tt> file.
</p></li><li><p>
Install the files shown in <a href="appendix.html#ch6-ldifpata" title="ExampleA.9.LDIF Pattern File Used to Pre-configure LDAP Part A">???</a> and <a href="appendix.html#ch6-ldifpatb" title="ExampleA.10.LDIF Pattern File Used to Pre-configure LDAP Part B">???</a> into the directory
<tt class="filename">/etc/openldap/SambaInit/nit-ldif.pat.</tt> These two files are
Part A and B, respectively, of the <tt class="filename">init-ldif.pat</tt> file.
</p></li><li><p>
Change to the <tt class="filename">/etc/openldap/SambaInit</tt> directory. Execute the following:
</p><pre class="screen">
<tt class="prompt">root# </tt> ./SMBLDAP-ldif-preconfig.sh
How do you wish to refer to your organization?
Suggestions:
Black Tire Company, Inc.
Cat With Hat Ltd.
How would you like your organization name to appear?
Your organization name is: My Organization
Enter a new name is this is not what you want, press Enter to Continue.
Name [My Organization]: Abmas Inc.
Samba Config File Location [/etc/samba/smb.conf]:
Enter a new full path or press Enter to continue.
Samba Config File Location [/etc/samba/smb.conf]:
Domain Name: MEGANET2
Domain SID: S-1-5-21-3504140859-1010554828-2431957765
The name of your Internet domain is now needed in a special format
as follows, if your domain name is mydomain.org, what we need is
the information in the form of:
Domain ID: mydomain
Top level: org
If your fully qualified hostname is: snoopy.bazaar.garagesale.net
where "snoopy" is the name of the machine,
Then the information needed is:
Domain ID: garagesale
Top Level: net
Found the following domain name: abmas.biz
I think the bit we are looking for might be: abmas
Enter the domain name or press Enter to continue:
The top level organization name I will use is: biz
Enter the top level org name or press Enter to continue:
<tt class="prompt">root# </tt>
</pre><p>
This creates a file called <tt class="filename">MEGANET2.ldif</tt>.
</p></li><li><p>
It is now time to preload the LDAP database with the following
command:
</p><pre class="screen">
<tt class="prompt">root# </tt> slapadd -v -l MEGANET2.ldif
added: "dc=abmas,dc=biz" (00000001)
added: "cn=Manager,dc=abmas,dc=biz" (00000002)
added: "ou=People,dc=abmas,dc=biz" (00000003)
added: "ou=Computers,dc=abmas,dc=biz" (00000004)
added: "ou=Groups,dc=abmas,dc=biz" (00000005)
added: "ou=Domains,dc=abmas,dc=biz" (00000006)
added: "sambaDomainName=MEGANET2,ou=Domains,dc=abmas,dc=biz" (00000007)
added: "cn=domadmins,ou=Groups,dc=abmas,dc=biz" (00000008)
added: "cn=domguests,ou=Groups,dc=abmas,dc=biz" (00000009)
added: "cn=domusers,ou=Groups,dc=abmas,dc=biz" (0000000a)
</pre><p>
You should verify that the account information was correctly loaded by executing:
</p><pre class="screen">
<tt class="prompt">root# </tt> slapcat
dn: dc=abmas,dc=biz
objectClass: dcObject
objectClass: organization
dc: abmas
o: Abmas Inc.
description: Posix and Samba LDAP Identity Database
structuralObjectClass: organization
entryUUID: af552f8e-c4a1-1027-9002-9421e01bf474
creatorsName: cn=manager,dc=abmas,dc=biz
modifiersName: cn=manager,dc=abmas,dc=biz
createTimestamp: 20031217055747Z
modifyTimestamp: 20031217055747Z
entryCSN: 2003121705:57:47Z#0x0001#0#0000
...
dn: cn=domusers,ou=Groups,dc=abmas,dc=biz
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 513
cn: domusers
sambaSID: S-1-5-21-3504140859-1010554828-2431957765-513
sambaGroupType: 2
displayName: Domain Users
description: Domain Users
structuralObjectClass: posixGroup
entryUUID: af7e98ba-c4a1-1027-900b-9421e01bf474
creatorsName: cn=manager,dc=abmas,dc=biz
modifiersName: cn=manager,dc=abmas,dc=biz
createTimestamp: 20031217055747Z
modifyTimestamp: 20031217055747Z
entryCSN: 2003121705:57:47Z#0x000a#0#0000
</pre><p>
</p></li><li><p>
Your LDAP database is ready for testing. You can now start the LDAP server
using the system tool for your Linux operating system. For SUSE Linux, you can
do this as follows:
</p><pre class="screen">
<tt class="prompt">root# </tt> rcldap start
</pre><p>
</p></li><li><p>
It is now a good idea to validate that the LDAP server is running correctly.
Execute the following:
</p><pre class="screen">
<tt class="prompt">root# </tt> ldapsearch -x -b "dc=abmas,dc=biz" "(ObjectClass=*)"
# extended LDIF
#
# LDAPv3
# base <dc=abmas,dc=biz> with scope sub
# filter: (ObjectClass=*)
# requesting: ALL
#
# abmas.biz
dn: dc=abmas,dc=biz
objectClass: dcObject
objectClass: organization
dc: abmas
o: Abmas Inc.
description: Posix and Samba LDAP Identity Database
...
# domusers, Groups, abmas.biz
dn: cn=domusers,ou=Groups,dc=abmas,dc=biz
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 513
cn: domusers
sambaSID: S-1-5-21-3504140859-1010554828-2431957765-513
sambaGroupType: 2
displayName: Domain Users
description: Domain Users
# search result
search: 2
result: 0 Success
# numResponses: 11
# numEntries: 10
</pre><p>
Your LDAP server is ready for creation of additional accounts.
</p></li></ol></div></div><div class="example"><a name="ch6-ldapreconfa"></a><p class="title"><b>ExampleA.6.LDAP Pre-configuration Script: <tt class="filename">SMBLDAP-ldif-preconfig.sh</tt> Part A</b></p><pre class="screen">
#!/bin/bash
#
# This script prepares the ldif LDAP load file only
#
# Pattern File Name
file=init-ldif.pat
# The name of my organization
ORGNAME="My Organization"
# My Internet domain. ie: if my domain is: buckets.org, INETDOMAIN="buckets"
INETDOMAIN="my-domain"
# In the above case, md domain is: buckets.org, TLDORG="org"
TLDORG="org"
# This is the Samba Domain/Workgroup Name
DOMNAME="MYWORKGROUP"
#
# Here We Go ...
#
cat <<EOF
How do you wish to refer to your organization?
Suggestions:
Black Tire Company, Inc.
Cat With Hat Ltd.
How would you like your organization name to appear?
EOF
echo "Your organization name is: $ORGNAME"
echo
echo "Enter a new name or, press Enter to Continue."
echo
</pre></div><div class="example"><a name="ch6-ldapreconfb"></a><p class="title"><b>ExampleA.7.LDAP Pre-configuration Script: <tt class="filename">SMBLDAP-ldif-preconfig.sh</tt> Part B</b></p><pre class="screen">
echo -e -n "Name [$ORGNAME]: "
read name
if [ ! -z "$name" ]; then
ORGNAME=${name}
fi
echo
sed "s/ORGNAME/${ORGNAME}/g" < $file > $file.tmp1
# Try to find smb.conf
if [ -e /usr/local/samba/lib/smb.conf ]; then
CONF=/usr/local/samba/lib/smb.conf
elif [ -e /etc/samba/smb.conf ]; then
CONF=/etc/samba/smb.conf
fi
echo "Samba Config File Location [$CONF]: "
echo
echo "Enter a new full path or press Enter to continue."
echo
echo -n "Samba Config File Location [$CONF]: "
read name
if [ ! -z "$name" ]; then
CONF=$name
fi
echo
# Find the name of our Domain/Workgroup
DOMNAME=`grep -i workgroup ${CONF} | sed "s/ //g" | cut -f2 -d=`
echo Domain Name: $DOMNAME
echo
sed "s/DOMNAME/${DOMNAME}/g" < $file.tmp1 > $file.tmp2
DOMSID=`net getlocalsid ${DOMNAME} | cut -f2 -d: | sed "s/ //g"`
echo Domain SID: $DOMSID
sed "s/DOMSID/${DOMSID}/g" < $file.tmp2 > $file.tmp1
</pre></div><div class="example"><a name="ch6-ldapreconfc"></a><p class="title"><b>ExampleA.8.LDAP Pre-configuration Script: <tt class="filename">SMBLDAP-ldif-preconfig.sh</tt> Part C</b></p><pre class="screen">
cat >>EOL
The name of your Internet domain is now needed in a special format
as follows, if your domain name is mydomain.org, what we need is
the information in the form of:
Domain ID: mydomain
Top level: org
If your fully qualified hostname is: snoopy.bazaar.garagesale.net
where "snoopy" is the name of the machine,
Then the information needed is:
Domain ID: garagesale
Top Level: net
EOL
INETDOMAIN=`hostname -d | cut -f1 -d.`
echo Found the following domain name: `hostname -d`
echo "I think the bit we are looking for might be: $INETDOMAIN"
echo
echo -n "Enter the domain name or press Enter to continue: "
read domnam
if [ ! -z $domnam ]; then
INETDOMAIN=$domnam
fi
echo
sed "s/INETDOMAIN/${INETDOMAIN}/g" < $file.tmp1 > $file.tmp2
TLDORG=`hostname -d | sed "s/${INETDOMAIN}.//g"`
echo "The top level organization name I will use is: ${TLDORG}"
echo
echo -n "Enter the top level org name or press Enter to continue: "
read domnam
if [ ! -z $domnam ]; then
TLDORG=$domnam
fi
sed "s/TLDORG/${TLDORG}/g" < $file.tmp2 > $DOMNAME.ldif
rm $file.tmp*
exit 0
</pre></div><div class="example"><a name="ch6-ldifpata"></a><p class="title"><b>ExampleA.9.LDIF Pattern File Used to Pre-configure LDAP Part A</b></p><pre class="screen">
dn: dc=INETDOMAIN,dc=TLDORG
objectClass: dcObject
objectClass: organization
dc: INETDOMAIN
o: ORGNAME
description: Posix and Samba LDAP Identity Database
dn: cn=Manager,dc=INETDOMAIN,dc=TLDORG
objectClass: organizationalRole
cn: Manager
description: Directory Manager
dn: ou=People,dc=INETDOMAIN,dc=TLDORG
objectClass: top
objectClass: organizationalUnit
ou: People
dn: ou=Computers,dc=INETDOMAIN,dc=TLDORG
objectClass: top
objectClass: organizationalUnit
ou: Computers
dn: ou=Groups,dc=INETDOMAIN,dc=TLDORG
objectClass: top
objectClass: organizationalUnit
ou: Groups
dn: ou=Idmap,dc=INETDOMAIN,dc=TLDORG
objectClass: top
objectClass: organizationalUnit
ou: Idmap
dn: sambaDomainName=DOMNAME,ou=Domains,dc=INETDOMAIN,dc=TLDORG
objectClass: sambaDomain
sambaDomainName: DOMNAME
sambaSID: DOMSID
sambaAlgorithmicRidBase: 1000
structuralObjectClass: sambaDomain
</pre></div><div class="example"><a name="ch6-ldifpatb"></a><p class="title"><b>ExampleA.10.LDIF Pattern File Used to Pre-configure LDAP Part B</b></p><pre class="screen">
dn: cn=domadmins,ou=Groups,dc=INETDOMAIN,dc=TLDORG
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 512
cn: domadmins
sambaSID: DOMSID-512
sambaGroupType: 2
displayName: Domain Admins
description: Domain Administrators
dn: cn=domguests,ou=Groups,dc=INETDOMAIN,dc=TLDORG
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 514
cn: domguests
sambaSID: DOMSID-514
sambaGroupType: 2
displayName: Domain Guests
description: Domain Guests Users
dn: cn=domusers,ou=Groups,dc=INETDOMAIN,dc=TLDORG
objectClass: posixGroup
objectClass: sambaGroupMapping
gidNumber: 513
cn: domusers
sambaSID: DOMSID-513
sambaGroupType: 2
displayName: Domain Users
description: Domain Users
</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2597909"></a>The LDAP Account Manager</h2></div></div></div><p><a class="indexterm" name="id2597916"></a><a class="indexterm" name="id2597924"></a><a class="indexterm" name="id2597935"></a><a class="indexterm" name="id2597942"></a><a class="indexterm" name="id2597950"></a><a class="indexterm" name="id2597958"></a><a class="indexterm" name="id2597966"></a>
The LDAP Account Manager (LAM) is an application suite that has been written in PHP.
LAM can be used with any Web server that has PHP4 support. It connects to the LDAP
server either using unencrypted connections or via SSL. LAM can be used to manage
Posix accounts as well as SambaSAMAccounts for users, groups, and Windows machines
(hosts).
</p><p>
LAM is available from the <a href="http://sourceforge.net/projects/lam/" target="_top">LAM</a>
home page and from its mirror sites. LAM has been released under the GNU GPL version 2.
The current version of LAM is 0.4.3. Release of version 0.5 is expected some time early
in 2004.
</p><p><a class="indexterm" name="id2597998"></a><a class="indexterm" name="id2598006"></a><a class="indexterm" name="id2598014"></a>
Requirements:
</p><div class="itemizedlist"><ul type="disc"><li><p>A web server that will work with PHP4.</p></li><li><p>PHP4 (available from the <a href="http://www.php.net/" target="_top">
PHP</a> home page.)</p></li><li><p>OpenLDAP 2.0 or later.</p></li><li><p>A Web browser that supports CSS.</p></li><li><p>Perl.</p></li><li><p>The gettext package.</p></li><li><p>mcrypt + mhash (optional since version 0.4.3).</p></li><li><p>It is also a good idea to install SSL support.</p></li></ul></div><p>
LAM is a useful tool that provides a simple Web-based device that can be used to
manage the contents of the LDAP directory to:<a class="indexterm" name="id2598077"></a><a class="indexterm" name="id2598086"></a><a class="indexterm" name="id2598094"></a>
</p><div class="itemizedlist"><ul type="disc"><li><p>Display user/group/host and Domain entries.</p></li><li><p>Manages entries (Add/Delete/Edit).</p></li><li><p>Filter and sort entries.</p></li><li><p>Set LAM administrator accounts.</p></li><li><p>Store and use multiple operating profiles.</p></li><li><p>Edit organizational units (OUs).</p></li><li><p>Upload accounts from a file.</p></li><li><p></p>Is compatible with Samba-2.2.x and Samba-3.</li></ul></div><p>
When correctly configured, LAM allows convenient management of UNIX (Posix) and Samba
user, group, and windows domain member machine accounts.
</p><p><a class="indexterm" name="id2598153"></a><a class="indexterm" name="id2598161"></a><a class="indexterm" name="id2598169"></a><a class="indexterm" name="id2598177"></a>
The default password is “<span class="quote"><span class="emphasis"><em>lam.</em></span></span>” It is highly recommended that you use only
an SSL connection to your Web server for all remote operations involving LAM. If you
want secure connections, you must configure your Apache Web server to permit connections
to LAM using only SSL.
</p><div class="procedure"><a name="ch6-laminst"></a><ol type="1"><li><p>
Extract the LAM package with:
</p><pre class="screen">
<tt class="prompt">root# </tt> tar xzf ldap-account-manager_0.4.3.tar.gz
</pre><p>
Alternately, install the LAM RPM for your system using the following example for
example:
</p><pre class="screen">
<tt class="prompt">root# </tt> rpm -Uvh ldap-account-manager-0.4.3-1.noarch.rpm
</pre><p>
</p></li><li><p>
Copy the extracted files to the document root directory of your Web server.
For example, on SuSE Linux Enterprise Server 8, copy to the
<tt class="filename">/srv/web/htdocs</tt> directory.
</p></li><li><p><a class="indexterm" name="id2598255"></a>
Set file permissions using the following commands:
</p><pre class="screen">
<tt class="prompt">root# </tt> chown -R wwwrun.www /srv/www/htdocs/lam
<tt class="prompt">root# </tt> chmod 755 /srv/www/htdocs/lam/sess
<tt class="prompt">root# </tt> chmod 755 /srv/www/htdocs/lam/tmp
<tt class="prompt">root# </tt> chmod 755 /srv/www/htdocs/lam/config
<tt class="prompt">root# </tt> chmod 755 /srv/www/htdocs/lam/lib/*pl
</pre><p>
</p></li><li><p><a class="indexterm" name="id2598309"></a>
Using your favorite editor create the following <tt class="filename">config.cfg</tt>
LAM configuration file:
</p><pre class="screen">
<tt class="prompt">root# </tt> cd /srv/www/htdocs/lam/config
<tt class="prompt">root# </tt> cp config.cfg_sample config.cfg
<tt class="prompt">root# </tt> vi config.cfg
</pre><p><a class="indexterm" name="id2598352"></a><a class="indexterm" name="id2598363"></a>
An example file is shown in <a href="appendix.html#lamcfg" title="ExampleA.11.Example LAM Configuration File config.cfg">???</a>.
This is the minimum configuration that must be completed. The LAM profile
file can be created using a convenient wizard that is part of the LAM
configuration suite.
</p></li><li><p>
Start your Web server then, using your Web browser, connect to
<a href="http://localhost/lam" target="_top">LAM</a> URL. Click on the
the <i class="parameter"><tt>Configuration Login</tt></i> link then click on the
Configuration Wizard link to begin creation of the default profile so that
LAM can connect to your LDAP server. Alternately, copy the
<tt class="filename">lam.conf_sample</tt> file to a file called
<tt class="filename">lam.conf</tt> then, using your favorite editor,
change the settings to match local site needs.
</p></li></ol></div><p><a class="indexterm" name="id2598425"></a>
An example of a working file is shown here in <a href="appendix.html#lamconf" title="ExampleA.12.LAM Profile Control File lam.conf">???</a>.
This file has been stripped of comments to keep the size small. The comments
and help information provided in the profile file that the wizard creates
is very useful and will help many administrators to avoid pitfalls.
Your configuration file obviously reflects the configuration options that
are preferred at your site.
</p><p><a class="indexterm" name="id2598450"></a>
It is important that your LDAP server is running at the time that LAM is
being configured. This permits you to validate correct operation.
An example of the LAM login screen is provided in <a href="appendix.html#lam-login" title="FigureA.6.The LDAP Account Manager Login Screen">???</a>.
</p><div class="figure"><a name="lam-login"></a><p class="title"><b>FigureA.6.The LDAP Account Manager Login Screen</b></p><div class="mediaobject"><img src="images/lam-login.png" width="270" alt="The LDAP Account Manager Login Screen"></div></div><p><a class="indexterm" name="id2598516"></a>
The LAM configuration editor has a number of options that must be managed correctly.
An example of use of the LAM configuration editor is shown in <a href="appendix.html#lam-config" title="FigureA.7.The LDAP Account Manager Configuration Screen">???</a>.
It is important that you correctly set the minimum and maximum UID/GID values that are
permitted for use at your site. The default values may not be compatible with a need to
modify initial default account values for well-known Windows network users and groups.
The best work-around is to temporarily set the minimum values to zero (0) to permit
the initial settings to be made. Do not forget to reset these to sensible values before
using LAM to add additional users and groups.
</p><div class="figure"><a name="lam-config"></a><p class="title"><b>FigureA.7.The LDAP Account Manager Configuration Screen</b></p><div class="mediaobject"><img src="images/lam-config.png" width="270" alt="The LDAP Account Manager Configuration Screen"></div></div><p><a class="indexterm" name="id2598591"></a>
LAM has some nice, but unusual features. For example, one unexpected feature in most application
screens permits the generation of a PDF file that lists configuration information. This is a well
thought out facility. This option has been edited out of the following screen shots to conserve
space.
</p><p><a class="indexterm" name="id2598607"></a>
When you log onto LAM the opening screen drops you right into the user manager as shown in
<a href="appendix.html#lam-user" title="FigureA.8.The LDAP Account Manager User Edit Screen">???</a>. This is a logical action as it permits the most-needed facility
to be used immediately. The editing of an existing user, as with the addition of a new user,
is easy to follow and very clear in both layout and intent. It is a simple matter to edit
generic settings, UNIX specific parameters, and then Samba account requirements. Each step
involves clicking a button that intuitively drives you through the process. When you have
finished editing simply press the <span class="guimenu">Final</span> button.
</p><div class="figure"><a name="lam-user"></a><p class="title"><b>FigureA.8.The LDAP Account Manager User Edit Screen</b></p><div class="mediaobject"><img src="images/lam-users.png" width="270" alt="The LDAP Account Manager User Edit Screen"></div></div><p>
The edit screen for groups is shown in <a href="appendix.html#lam-group" title="FigureA.9.The LDAP Account Manager Group Edit Screen">???</a>. As with the edit screen
for user accounts, group accounts may be rapidly dealt with. <a href="appendix.html#lam-group-mem" title="FigureA.10.The LDAP Account Manager Group Membership Edit Screen">???</a>
shown a sub-screen from the group editor that permits users to be assigned secondary group
memberships.
</p><div class="figure"><a name="lam-group"></a><p class="title"><b>FigureA.9.The LDAP Account Manager Group Edit Screen</b></p><div class="mediaobject"><img src="images/lam-groups.png" width="270" alt="The LDAP Account Manager Group Edit Screen"></div></div><div class="figure"><a name="lam-group-mem"></a><p class="title"><b>FigureA.10.The LDAP Account Manager Group Membership Edit Screen</b></p><div class="mediaobject"><img src="images/lam-group-members.png" width="270" alt="The LDAP Account Manager Group Membership Edit Screen"></div></div><p><a class="indexterm" name="id2598792"></a><a class="indexterm" name="id2598800"></a>
The final screen presented here is one that you should not normally need to use. Host accounts will
be automatically managed using the smbldap-tools scripts. This means that the screen <a href="appendix.html#lam-host" title="FigureA.11.The LDAP Account Manager Host Edit Screen">???</a>
will, in most cases, not be used.
</p><div class="figure"><a name="lam-host"></a><p class="title"><b>FigureA.11.The LDAP Account Manager Host Edit Screen</b></p><div class="mediaobject"><img src="images/lam-hosts.png" width="270" alt="The LDAP Account Manager Host Edit Screen"></div></div><p>
One aspect of LAM that may annoy some users is the way it forces certain conventions on
the administrator. For example, LAM does not permit the creation of Windows user and group
accounts that contain upper-case characters or spaces even though the underlying UNIX/Linux
operating system may exhibit no problems with them. Given the propensity for using upper-case
characters and spaces (particularly in the default Windows account names) this may cause
some annoyance. For the rest, LAM is a very useful administrative tool.
</p><div class="example"><a name="lamcfg"></a><p class="title"><b>ExampleA.11.Example LAM Configuration File <tt class="filename">config.cfg</tt></b></p><pre class="screen">
# password to add/delete/rename configuration profiles
password: not24get
# default profile, without ".conf"
default: lam
</pre></div><div class="example"><a name="lamconf"></a><p class="title"><b>ExampleA.12.LAM Profile Control File <tt class="filename">lam.conf</tt></b></p><pre class="screen">
ServerURL: ldap://massive.abmas.org:389
Admins: cn=Manager,dc=abmas,dc=biz
Passwd: not24get
usersuffix: ou=People,dc=abmas,dc=biz
groupsuffix: ou=Groups,dc=abmas,dc=biz
hostsuffix: ou=Computers,dc=abmas,dc=biz
domainsuffix: ou=Domains,dc=abmas,dc=biz
MinUID: 0
MaxUID: 65535
MinGID: 0
MaxGID: 65535
MinMachine: 20000
MaxMachine: 25000
userlistAttributes: #uid;#givenName;#sn;#uidNumber;#gidNumber
grouplistAttributes: #cn;#gidNumber;#memberUID;#description
hostlistAttributes: #cn;#description;#uidNumber;#gidNumber
maxlistentries: 30
defaultLanguage: en_GB:ISO-8859-1:English (Britain)
scriptPath:
scriptServer:
samba3: yes
cachetimeout: 5
pwdhash: SSHA
</pre></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ch12-SUIDSGID"></a>Effect of Setting File and Directory SUID/SGID Permissions Explained</h2></div></div></div><a class="indexterm" name="id2598949"></a><a class="indexterm" name="id2598956"></a><p>
The setting of the SUID/SGID bits on the file or directory permissions flag has particular
consequences. If the file is executable and the SUID bit is set, it executes with the privilege
of (with the UID of) the owner of the file. For example, if you are logged onto a system as
a normal user (let's say as the user <tt class="constant">bobj</tt>), and you execute a file that is owned
by the user <tt class="constant">root</tt> (uid = 0), and the file has the SUID bit set, then the file is
executed as if you had logged in as the user <tt class="constant">root</tt> and then executed the file.
The SUID bit effectively gives you (as <tt class="constant">bobj</tt>) administrative privilege for the
use of that executable file.
</p><p>
The setting of the SGID bit does precisely the same as the effect of the SUID bit, except that it
applies the privilege to the UNIX group setting. In other words, the file executes with the force
of capability of the group.
</p><p>
When the SUID/SGID permissions are set on a directory, all files that are created within that directory
is automatically given the ownership of the SUID user and the SGID group, as per the ownership
of the directory in which the file is created. This means that the system level <span><b class="command">create()</b></span>
function executes with the SUID user and/or SGID group of the directory in which the file is
created.
</p><p>
If you want to obtain the SUID behavior, simply execute the following command:
</p><pre class="screen">
<tt class="prompt">root# </tt> chmod u+s file-or-directory
</pre><p>
To set the SGID properties on a file or a directory, execute this command:
</p><pre class="screen">
<tt class="prompt">root# </tt> chmod g+s file-or-directory
</pre><p>
And to set both SUID and SGID properties, execute the following:
</p><pre class="screen">
<tt class="prompt">root# </tt> chmod ug+s file-or-directory
</pre><p>
</p><p>
Let's consider the example of a directory <tt class="filename">/data/accounts</tt>. The permissions on this
directory before setting both SUID and SGID on this directory are:
</p><pre class="screen">
<tt class="prompt">root# </tt> ls -al /data/accounts
total 1
drwxr-xr-x 10 root root 232 Dec 18 17:08 .
drwxr-xr-x 21 root root 600 Dec 17 23:15 ..
drwxrwxrwx 2 bobj Domain Users 48 Dec 18 17:08 accounts/
drwx------ 2 root root 48 Jan 26 2002 lost+found
</pre><p>
In this example, if the user <tt class="constant">maryv</tt> creates a file, it would be owned by her.
If <tt class="constant">maryv</tt> has the primary group of <tt class="constant">Accounts</tt>, the file is
owned by the group <tt class="constant">Accounts</tt> as shown in this listing:
</p><pre class="screen">
<tt class="prompt">root# </tt> ls -al /data/accounts/maryvfile.txt
drw-rw-r-- 2 maryv Accounts 12346 Dec 18 17:53
</pre><p>
</p><p>
Now you set the SUID and SGID and check the result as follows:
</p><pre class="screen">
<tt class="prompt">root# </tt> chmod ug+s /data/accounts
<tt class="prompt">root# </tt> ls -al /data/accounts
total 1
drwxr-xr-x 10 root root 232 Dec 18 17:08 .
drwxr-xr-x 21 root root 600 Dec 17 23:15 ..
drwsrwsr-x 2 bobj Domain Users 48 Dec 18 17:08 accounts
drwx------ 2 root root 48 Jan 26 2002 lost+found
</pre><p>
If <tt class="constant">maryv</tt> creates a file in this directory after this change has been made, the
file is owned by the user <tt class="constant">bobj</tt>, and the group is set to the group
<tt class="constant">Domain Users</tt> as shown here:
</p><pre class="screen">
<tt class="prompt">root# </tt> chmod ug+s /data/accounts
<tt class="prompt">root# </tt> ls -al /data/accounts/maryvfile.txt
total 1
drw-rw-r-- 2 bobj Domain Users 12346 Dec 18 18:11 maryvfile.txt
</pre><p>
</p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ch12dblck"></a>Shared Data Integrity</h2></div></div></div><p><a class="indexterm" name="id2599187"></a><a class="indexterm" name="id2599195"></a>
The integrity of shared data is often viewed as a particularly emotional issue, especially where
there are concurrent problems with multi-user data access. Contrary to the assertions of some who have
experienced problems in either area, the cause has nothing to do with the phases of the moons of Jupiter.
</p><p>
The solution to concurrent multi-user data access problems must consider three separate areas
from which the problem may stem:<a class="indexterm" name="id2599223"></a><a class="indexterm" name="id2599235"></a><a class="indexterm" name="id2599246"></a>
</p><div class="itemizedlist"><ul type="disc"><li><p>application level locking controls.</p></li><li><p>client side locking controls.</p></li><li><p>server side locking controls.</p></li></ul></div><p><a class="indexterm" name="id2599279"></a><a class="indexterm" name="id2599287"></a>
Many database applications use some form of application-level access control. An example of one
well-known application that uses application-level locking is Microsoft Access. Detailed guidance
is provided given that this is the most common application for which problems have been reported.
</p><p><a class="indexterm" name="id2599303"></a><a class="indexterm" name="id2599311"></a>
Common applications that are affected by client- and server-side locking controls include MS
Excel and Act!. Important locking guidance is provided here.
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2599324"></a>Microsoft Access</h3></div></div></div><p>
The best advice that can be given is to carefully read the Microsoft knowledge base articles that
cover this area. Examples of relevant documents includes:
</p><div class="itemizedlist"><ul type="disc"><li><p>http://support.microsoft.com/default.aspx?scid=kb;en-us;208778</p></li><li><p>http://support.microsoft.com/default.aspx?scid=kb;en-us;299373</p></li></ul></div><p><a class="indexterm" name="id2599351"></a><a class="indexterm" name="id2599362"></a>
Make sure that your MS Access database file is configured for multi-user access (not set for
exclusive open). Open MS Access on each client workstation then set the following: <span class="guimenu">(Menu bar) Tools</span>+<span class="guimenu">Options</span>+<span class="guimenu">[tab] General</span>. Set network path to Default database folder: <tt class="filename">\\server\share\folder</tt>.
</p><p>
You can configure MS Access file sharing behavior as follows: click <span class="guimenu">[tab] Advanced</span>.
Set:<a class="indexterm" name="id2599413"></a>
</p><div class="itemizedlist"><ul type="disc"><li><p>Default open mode: Shared</p></li><li><p>Default Record Locking: Edited Record</p></li><li><p>Open databases using record_level locking</p></li></ul></div><p><a class="indexterm" name="id2599442"></a>
You must now commit the changes so that they will take effect. To do so, click
<span class="guimenu">Apply</span><span class="guimenu">Ok</span>. At this point, you should exit MS Access, restart
it and then validate that these settings have not changed.
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2599471"></a>Act! Database Sharing</h3></div></div></div><p><a class="indexterm" name="id2599478"></a><a class="indexterm" name="id2599486"></a>
Where the server sharing the ACT! database(s) is running Samba, Windows NT, 200x or XP, you
must disable opportunistic locking on the server and all workstations. Failure to do so
results in data corruption. This information is available from the Act! Web site
knowledge-base articles
<a href="http://itdomino.saleslogix.com/act.nsf/docid/1998223162925" target="_top">1998223162925</a>
as well as from article
<a href="http://itdomino.saleslogix.com/act.nsf/docid/200110485036" target="_top">200110485036</a>.
</p><p><a class="indexterm" name="id2599516"></a><a class="indexterm" name="id2599524"></a>
These documents clearly state that opportunistic locking must be disabled on both
the server (Samba in the case we are interested in here), as well as on every workstation
from which the centrally shared Act! database will be accessed. Act! provides
a tool called <span><b class="command">Act!Diag</b></span> that may be used to disable all workstation
registry settings that may otherwise interfere with the operation of Act!
Registered Act! users may download this utility from the Act! Web
<a href="http://www.act.com/support/updates/index.cfm" target="_top">site.</a>
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2599555"></a>Opportunistic Locking Controls</h3></div></div></div><p><a class="indexterm" name="id2599562"></a>
Third-party Windows applications may not be compatible with the use of opportunistic file
and record locking. For applications that are known not to be compatible,<sup>[<a name="id2599574" href="#ftn.id2599574">14</a>]</sup> oplock
support may need to be disabled both on the Samba server and on the Windows workstations.
</p><p><a class="indexterm" name="id2599589"></a><a class="indexterm" name="id2599596"></a><a class="indexterm" name="id2599604"></a>
Oplocks enable a Windows client to cache parts of a file that are being
edited. Another windows client may then request to open the file with the
ability to write to it. The server will then ask the original workstation
that had the file open with a write lock to release it's lock. Before
doing so, that workstation must flush the file from cache memory to the
disk or network drive.
</p><p><a class="indexterm" name="id2599626"></a>
Disabling of Oplocks usage may require server and client changes.
Oplocks may be disabled by file, by file pattern, on the share, or on the
samba server.
</p><p>
The following are examples showing how Oplock support may be managed using
Samba <tt class="filename">smb.conf</tt> file settings:
</p><pre class="screen">
By file: veto oplock files = myfile.mdb
By Pattern: veto oplock files = /*.mdb/
On the Share: oplocks = No
level2 oplocks = No
On the server:
(in [global]) oplocks = No
level2 oplocks = No
</pre><p>
</p><p>
The following registry entries on Microsoft Windows XP Professional, 2000 Professional and Windows NT4
workstation clients must be configured as shown here:
</p><pre class="screen">
REGEDIT4
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Services\LanmanServer\Parameters]
"EnableOplocks"=dword:00000000
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\
Services\LanmanWorkstation\Parameters]
"UseOpportunisticLocking"=dword:00000000
</pre><p>
</p><p>
Comprehensive coverage of file and record locking controls is provided in TOSHARG Chapter 13.
The information provided in that chapter was obtained from a wide variety of sources.
</p></div></div><div class="footnotes"><br><hr width="100" align="left"><div class="footnote"></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="HA.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="index.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="gpl.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter13.Performance, Reliability, and Availability</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">AppendixB.GNU General Public License</td></tr></table></div></body></html>
|