1 | <sect2>
|
---|
2 | <title>Configuring <application>Samba</application></title>
|
---|
3 | <para>We will configure one <application>Samba</application> server (SAMBABOX)
|
---|
4 | to act as a primary domain controller, as well as configure one domain client
|
---|
5 | running Windows 2000 Server(WIN2KBOX) and acting as a member server of the
|
---|
6 | domain. Detailed instructions will be given for adding WIN2KBOX to
|
---|
7 | the domain due to the extra steps necessary. Instructions for adding
|
---|
8 | Windows 95/98/XP clients can be found in the newly installed
|
---|
9 | documentation by pointing a web browser to:</para>
|
---|
10 |
|
---|
11 | <screen><userinput>file:///usr/share/samba/swat/using_samba/ch03_01.html#ch03-55770.</userinput></screen>
|
---|
12 |
|
---|
13 | <sect3><title>Config files</title>
|
---|
14 | <para><filename>/etc/samba/smb.conf</filename>,
|
---|
15 | <filename>/etc/rc.d/init.d/samba </filename></para>
|
---|
16 |
|
---|
17 | <para>First we set up some directories needed by <application>Samba
|
---|
18 | </application>:</para>
|
---|
19 | <screen><userinput><command>mkdir /var/lib/samba &&
|
---|
20 | mkdir /var/lib/samba/netlogon &&
|
---|
21 | mkdir /var/lib/samba/ntprofile &&
|
---|
22 | mkdir /var/lib/samba/profiles &&
|
---|
23 | chmod -R 1777 /var/lib/samba</command></userinput></screen>
|
---|
24 |
|
---|
25 | <para>And the <application>Samba</application> configuration file: </para>
|
---|
26 | <screen><userinput><command>cat > /etc/samba/smb.conf << "EOF"</command>
|
---|
27 | [global]
|
---|
28 | netbios name = SAMBABOX
|
---|
29 | workgroup = DOMAIN01
|
---|
30 | os level = 64
|
---|
31 | preferred master = yes
|
---|
32 | domain master = yes
|
---|
33 | local master = yes
|
---|
34 | security = user
|
---|
35 | encrypt passwords = yes
|
---|
36 | domain logons = yes
|
---|
37 | log file = /var/log/log.%m
|
---|
38 | log level = 1
|
---|
39 | logon path = \\%N\home\%u\windows
|
---|
40 | logon drive = H:
|
---|
41 | logon home = \\homeserver\%u\windows
|
---|
42 | logon script = logon.cmd
|
---|
43 | [netlogon]
|
---|
44 | path = /var/lib/samba/netlogon
|
---|
45 | read only = yes
|
---|
46 | write list = ntadmin
|
---|
47 | [profiles]
|
---|
48 | path = /var/lib/samba/ntprofile
|
---|
49 | read only = no
|
---|
50 | create mask = 0600
|
---|
51 | directory mask = 0700
|
---|
52 | ; World writable share for testing
|
---|
53 | [tmp]
|
---|
54 | comment = Temporary file space
|
---|
55 | path = /tmp
|
---|
56 | read only = no
|
---|
57 | public = yes
|
---|
58 | [home]
|
---|
59 | comment = Users' home directories
|
---|
60 | path = /home
|
---|
61 | read only = no
|
---|
62 | public = no
|
---|
63 | <command>EOF</command></userinput></screen>
|
---|
64 |
|
---|
65 | <para>Now add the machine trust account for WIN2KBOX:</para>
|
---|
66 | <screen><userinput><command>/usr/sbin/useradd -g 100 -d /dev/null -c \
|
---|
67 | "machine nickname" -s /bin/false win2kbox$ &&
|
---|
68 | passwd -l win2kbox$ &&
|
---|
69 | smbpasswd -a -m win2kbox</command></userinput></screen>
|
---|
70 |
|
---|
71 | <para>Install <filename>/etc/rc.d/init.d/samba</filename>
|
---|
72 | init script included in the <xref linkend="intro-important-bootscripts"/> package.</para>
|
---|
73 |
|
---|
74 | <screen><userinput><command>make install-samba</command></userinput></screen>
|
---|
75 |
|
---|
76 | <para>Now, we'll use our new boot script to start <application>Samba
|
---|
77 | </application>: </para>
|
---|
78 | <screen><userinput><command>/etc/rc.d/init.d/samba start</command></userinput></screen>
|
---|
79 | <para>We have to add the SAMBABOX root account to the <application>Samba
|
---|
80 | </application> user list first in order to join WIN2KBOX to the DOMAIN01
|
---|
81 | domain: </para>
|
---|
82 |
|
---|
83 | <screen><userinput><command>smbpasswd -a root</command></userinput></screen>
|
---|
84 |
|
---|
85 | <para>After starting <application>Samba</application> and adding root to
|
---|
86 | the <application>Samba</application> user list, the first machine we'll join
|
---|
87 | to DOMAIN01 will be WIN2KBOX, the Windows 2000 Server box we created the
|
---|
88 | machine trust account for. On WIN2KBOX:</para>
|
---|
89 | <screen><userinput>1. Right click on My Computer.
|
---|
90 | 2. Click on Properties.
|
---|
91 | 3. Click on the Network Identification notebook tab.
|
---|
92 | 4. Click on the Properties button.
|
---|
93 | 5. In the Computer Name: edit field enter WIN2KBOX.
|
---|
94 | 6. Click on the Domain: radio button and enter DOMAIN01 in the edit
|
---|
95 | field and click OK.
|
---|
96 | 7. When presented with the Domain Username And Password dialog box,
|
---|
97 | enter root and root's password on SAMBABOX and click OK.
|
---|
98 | 8. After the machine trust is negotiated, click the OK button in the
|
---|
99 | dialog box welcoming you to the DOMAIN01 domain.
|
---|
100 | 9. Click OK in the reboot reminder dialog box.
|
---|
101 | 10. Click OK to close the System Properties window.
|
---|
102 | 11. Click Yes to reboot WIN2KBOX.</userinput></screen></sect3>
|
---|
103 |
|
---|
104 | <sect3><title>Add a new user to the DOMAIN01 domain.</title>
|
---|
105 | <para>Before logging on to WIN2KBOX, we will create a new user with
|
---|
106 | the following commands:</para>
|
---|
107 | <screen><userinput><command>useradd -m win2kuser01 &&
|
---|
108 | passwd win2kuser01 &&
|
---|
109 | smbpasswd -a win2kuser01</command></userinput></screen></sect3>
|
---|
110 |
|
---|
111 | <sect3><title>Logging on to DOMAIN01.</title>
|
---|
112 | <para>Now we will log on the domain as our newly created user as
|
---|
113 | follows:</para>
|
---|
114 | <screen><userinput>1. Press Ctrl-Alt-Del to bring up the Log On to Windows dialog box.
|
---|
115 | 2. Enter the win2kuser01 name and password.
|
---|
116 | 3. Select DOMAIN01 from the Log on to: combination box and click OK.</userinput></screen>
|
---|
117 |
|
---|
118 | <para>Add the swat entry to <filename>/etc/services</filename>with the
|
---|
119 | following command: </para>
|
---|
120 |
|
---|
121 | <screen><userinput><command>echo "swat 901/tcp" >> /etc/services</command></userinput></screen>
|
---|
122 |
|
---|
123 | <para>If <command>inetd</command> is used, the following command will add the
|
---|
124 | swat entry to <filename>/etc/inetd.conf</filename>: </para>
|
---|
125 | <screen><userinput><command>echo "swat stream tcp nowait.400 root /usr/sbin/swat swat" \
|
---|
126 | >> /etc/inetd.conf</command></userinput></screen>
|
---|
127 |
|
---|
128 | <para>If xinetd is used, the following command will add the swat entry
|
---|
129 | to <filename>/etc/xinetd.conf</filename>: </para>
|
---|
130 | <screen><userinput><command>cat >> /etc/xinetd.conf << "EOF"</command>
|
---|
131 | service swat
|
---|
132 | {
|
---|
133 | port = 901
|
---|
134 | socket_type = stream
|
---|
135 | wait = no
|
---|
136 | only_from = 127.0.0.1
|
---|
137 | user = root
|
---|
138 | server = /usr/sbin/swat
|
---|
139 | log_on_failure += USERID
|
---|
140 | }
|
---|
141 | <command>EOF</command></userinput></screen>
|
---|
142 |
|
---|
143 | <para>The Samba Web Administration Tool, <acronym>SWAT</acronym>, can be
|
---|
144 | launched with the following command on SAMBABOX: </para>
|
---|
145 | <screen><userinput><command>lynx http://localhost:901</command></userinput></screen>
|
---|
146 | <note><para>Be sure <command>inetd</command> is running, and issue a
|
---|
147 | <command>killall -HUP inetd</command> before starting
|
---|
148 | <acronym>SWAT</acronym>.</para></note>
|
---|
149 | <para>The <application>Lynx</application> browser is used in this
|
---|
150 | demonstration, but is not necessary.</para></sect3>
|
---|
151 |
|
---|
152 | </sect2>
|
---|
153 |
|
---|