source: server/other/samba/samba-config.xml@ 377584f

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 377584f was 377584f, checked in by Larry Lawrence <larry@…>, 21 years ago

added chapter intros 16, 18, 20

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@1177 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 7.1 KB
Line 
1<sect2>
2<title>Configuring Samba</title>
3<para>We will configure one Samba server (SAMBABOX) to act as a primary
4domain controller, as well as configure one domain client running
5Windows 2000 Server(WIN2KBOX) and acting as a member server of the
6domain. Detailed instructions will be given for adding WIN2KBOX to
7the domain due to the extra steps necessary. Instructions for adding
8Windows 95/98/XP clients can be found in the newly installed
9documentation by pointing a web browser to:</para>
10
11<screen><userinput><command>file:///usr/share/samba/swat/using_samba/ch03_01.html#ch03-55770.</command></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 Samba:</para>
18<screen><userinput><command>mkdir /var/lib/samba &amp;&amp;
19mkdir /var/lib/samba/netlogon &amp;&amp;
20mkdir /var/lib/samba/ntprofile &amp;&amp;
21mkdir /var/lib/samba/profiles &amp;&amp;
22chmod -R 1777 /var/lib/samba</command></userinput></screen>
23
24<para>And the Samba configuration file: </para>
25<screen><userinput><command>cat &gt; /etc/samba/smb.conf &lt;&lt; "EOF"</command>
26[global]
27 netbios name = SAMBABOX
28 workgroup = DOMAIN01
29 os level = 64
30 preferred master = yes
31 domain master = yes
32 local master = yes
33 security = user
34 encrypt passwords = yes
35 domain logons = yes
36 log file = /var/log/log.%m
37 log level = 1
38 logon path = \\%N\home\%u
39 logon drive = H:
40 logon home = \\homeserver\%u
41 logon script = logon.cmd
42[netlogon]
43 path = /var/lib/samba/netlogon
44 read only = yes
45 write list = ntadmin
46[profiles]
47 path = /var/lib/samba/ntprofile
48 read only = no
49 create mask = 0600
50 directory mask = 0700
51; World writable share for testing
52[tmp]
53comment = Temporary file space
54 path = /tmp
55 read only = no
56 public = yes
57[home]
58comment = Users' home directories
59 path = /home
60 read only = no
61 public = no
62<command>EOF</command></userinput></screen>
63
64<para>Now add the machine trust account for WIN2KBOX:</para>
65<screen><userinput><command>/usr/sbin/useradd -g 100 -d /dev/null -c \
66 "machine nickname" -s /bin/false win2kbox$ &amp;&amp;
67passwd -l win2kbox$ &amp;&amp;
68smbpasswd -a -m win2kbox</command></userinput></screen>
69
70<para>Create the Samba boot script:</para>
71<screen><userinput><command>cat &gt; /etc/rc.d/init.d/samba &lt;&lt; "EOF"</command>
72#!/bin/bash
73# Begin $rc_base/init.d/samba
74# Based on sysklogd script from LFS-3.1 and earlier.
75# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
76source /etc/sysconfig/rc
77source $rc_functions
78case "$1" in
79 start)
80 echo "Starting nmbd..."
81 loadproc /usr/sbin/nmbd -D
82 echo "Starting smbd..."
83 loadproc /usr/sbin/smbd -D
84 ;;
85 stop)
86 echo "Stopping smbd..."
87 killproc /usr/sbin/smbd
88 echo "Stopping nmbd..."
89 killproc /usr/sbin/nmbd
90 ;;
91 reload)
92 echo "Reloading smbd..."
93 reloadproc /usr/sbin/smbd
94 echo "Reloading nmbd..."
95 reloadproc /usr/sbin/nmbd
96 ;;
97 restart)
98 $0 stop
99 sleep 1
100 $0 start
101 ;;
102 status)
103 statusproc /usr/sbin/nmbd
104 statusproc /usr/sbin/smbd
105 ;;
106 *)
107 echo "Usage: $0 {start|stop|reload|restart|status}"
108 exit 1
109 ;;
110esac
111# End $rc_base/init.d/samba
112<command>EOF</command></userinput></screen>
113<para>Add the run level symlinks:</para>
114<screen><userinput>chmod 754 /etc/rc.d/init.d/samba &amp;&amp;
115ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc0.d/K48samba &amp;&amp;
116ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc1.d/K48samba &amp;&amp;
117ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc2.d/K48samba &amp;&amp;
118ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc3.d/S24samba &amp;&amp;
119ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc4.d/S24samba &amp;&amp;
120ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc5.d/S24samba &amp;&amp;
121ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc6.d/K48samba</userinput></screen>
122
123<para>Now, we'll use our new boot script to start Samba: </para>
124<screen><userinput><command>/etc/rc.d/init.d/samba start</command></userinput></screen>
125<para>We have to add the SAMBABOX root account to the Samba user list
126first in order to join WIN2KBOX to the DOMAIN01 domain: </para>
127
128<screen><userinput><command>smbpasswd -a root</command></userinput></screen>
129
130<para>After starting Samba and adding root to the Samba user list, the
131first machine we'll join to DOMAIN01 will be WIN2KBOX, the Windows
1322000 Server box we created the machine trust account for. On
133WIN2KBOX:</para>
134<screen><userinput>1. Right click on My Computer.
1352. Click on Properties.
1363. Click on the Network Identification notebook tab.
1374. Click on the Properties button.
1385. In the Computer Name: edit field enter WIN2KBOX.
1396. Click on the Domain: radio button and enter DOMAIN01 in the edit
140 field and click OK.
1417. When presented with the Domain Username And Password dialog box,
142 enter root and root's password on SAMBABOX and click OK.
1438. After the machine trust is negotiated, click the OK button in the
144 dialog box welcoming you to the DOMAIN01 domain.
1459. Click OK in the reboot reminder dialog box.
14610. Click OK to close the System Properties window.
14711. Click Yes to reboot WIN2KBOX.</userinput></screen></sect3>
148
149<sect3><title>Add a new user to the DOMAIN01 domain.</title>
150<para>Before logging on to WIN2KBOX, we will create a new user with
151 the following commands:</para>
152<screen><userinput><command>useradd -m win2kuser01 &amp;&amp;
153passwd win2kuser01 &amp;&amp;
154smbpasswd -a win2kuser01</command></userinput></screen></sect3>
155
156<sect3><title>Logging on to DOMAIN01.</title>
157<para>Now we will log on the domain as our newly created user as
158 follows:</para>
159<screen><userinput>1. Press Ctrl-Alt-Del to bring up the Log On to Windows dialog box.
1602. Enter the win2kuser01 name and password.
1613. Select DOMAIN01 from the Log on to: combination box and click OK.</userinput></screen>
162
163<para>Add the swat entry to <filename>/etc/services</filename>with the
164following command: </para>
165
166<screen><userinput><command>echo "swat 901/tcp" &gt;&gt; /etc/services</command></userinput></screen>
167
168<para>If <command>inetd</command> is used, the following command will add the
169swat entry to <filename>/etc/inetd.conf</filename>: </para>
170<screen><userinput><command>echo "swat stream tcp nowait.400 root /usr/sbin/swat swat" \
171 &gt;&gt; /etc/inetd.conf</command></userinput></screen>
172
173<para>If xinetd is used, the following command will add the swat entry
174to <filename>/etc/xinetd.conf</filename>: </para>
175<screen><userinput><command>cat &gt;&gt; /etc/xinetd.conf &lt;&lt; "EOF"</command>
176service swat
177{
178 port = 901
179 socket_type = stream
180 wait = no
181 only_from = 127.0.0.1
182 user = root
183 server = /usr/sbin/swat
184 log_on_failure += USERID
185}
186<command>EOF</command></userinput></screen>
187
188<para>The Samba Web Administration Tool, swat, can be launched with the
189following command on SAMBABOX: </para>
190<screen><userinput><command>lynx http://localhost:901</command></userinput></screen>
191<note><para>Be sure inetd is running, and issue a killall -HUP inetd
192before starting swat.</para></note>
193<para>The lynx browser is used in this demonstration, but is not
194necessary.</para></sect3>
195
196</sect2>
197
Note: See TracBrowser for help on using the repository browser.