source: server/other/samba/samba-config.xml@ e01c31ad

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 v1_0 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 e01c31ad was b44b8b1, checked in by Billy O 'Connor <billyoc@…>, 21 years ago

xml cleanups, << changed to &lt;&lt, etc.

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

  • Property mode set to 100644
File size: 7.0 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<para><screen><userinput>
12file:///usr/share/samba/swat/using_samba/ch03_01.html#ch03-55770
13.</userinput></screen></para>
14
15<sect3><title>Config files</title>
16<para><userinput>
17/etc/samba/smb.conf, /etc/rc.d/init.d/samba </userinput></para>
18
19<para>First we set up some directories needed by Samba:</para>
20<para><screen><userinput>
21mkdir /var/lib/samba &amp;&amp;
22mkdir /var/lib/samba/netlogon &amp;&amp;
23mkdir /var/lib/samba/ntprofile &amp;&amp;
24mkdir /var/lib/samba/profiles &amp;&amp;
25chmod -R 1777 /var/lib/samba
26</userinput></screen></para>
27
28<para>And the Samba configuration file: </para>
29<para><screen><userinput>
30cat &gt; /etc/samba/smb.conf &lt;&lt; "EOF"
31[global]
32 netbios name = SAMBABOX
33 workgroup = DOMAIN01
34 os level = 64
35 preferred master = yes
36 domain master = yes
37 local master = yes
38 security = user
39 encrypt passwords = yes
40 domain logons = yes
41 log file = /var/log/log.%m
42 log level = 1
43 logon path = \\%N\home\%u
44 logon drive = H:
45 logon home = \\homeserver\%u
46 logon script = logon.cmd
47[netlogon]
48 path = /var/lib/samba/netlogon
49 read only = yes
50 write list = ntadmin
51[profiles]
52 path = /var/lib/samba/ntprofile
53 read only = no
54 create mask = 0600
55 directory mask = 0700
56; World writable share for testing
57[tmp]
58comment = Temporary file space
59 path = /tmp
60 read only = no
61 public = yes
62[home]
63comment = Users' home directories
64 path = /home
65 read only = no
66 public = no
67EOF
68</userinput></screen></para>
69
70<para>Now add the machine trust account for WIN2KBOX:</para>
71<para><screen><userinput>
72/usr/sbin/useradd -g 100 -d /dev/null -c \
73 "machine nickname" -s /bin/false win2kbox$ &amp;&amp;
74passwd -l win2kbox$ &amp;&amp;
75smbpasswd -a -m win2kbox
76</userinput></screen></para>
77
78<para>Create the Samba boot script:</para>
79<para><screen><userinput>
80cat &gt; /etc/rc.d/init.d/samba &lt;&lt; "EOF"
81#!/bin/bash
82# Begin $rc_base/init.d/samba
83# Based on sysklogd script from LFS-3.1 and earlier.
84# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
85source /etc/sysconfig/rc
86source $rc_functions
87case "$1" in
88 start)
89 echo "Starting nmbd..."
90 loadproc /usr/sbin/nmbd -D
91 echo "Starting smbd..."
92 loadproc /usr/sbin/smbd -D
93 ;;
94 stop)
95 echo "Stopping smbd..."
96 killproc /usr/sbin/smbd
97 echo "Stopping nmbd..."
98 killproc /usr/sbin/nmbd
99 ;;
100 reload)
101 echo "Reloading smbd..."
102 reloadproc /usr/sbin/smbd
103 echo "Reloading nmbd..."
104 reloadproc /usr/sbin/nmbd
105 ;;
106 restart)
107 $0 stop
108 sleep 1
109 $0 start
110 ;;
111 status)
112 statusproc /usr/sbin/nmbd
113 statusproc /usr/sbin/smbd
114 ;;
115 *)
116 echo "Usage: $0 {start|stop|reload|restart|status}"
117 exit 1
118 ;;
119esac
120# End $rc_base/init.d/samba
121EOF
122
123</userinput></screen></para>
124<para>Add the run level symlinks:</para>
125<para><screen><userinput>
126chmod 754 /etc/rc.d/init.d/samba &amp;&amp;
127ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc0.d/K48samba &amp;&amp;
128ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc1.d/K48samba &amp;&amp;
129ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc2.d/K48samba &amp;&amp;
130ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc3.d/S24samba &amp;&amp;
131ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc4.d/S24samba &amp;&amp;
132ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc5.d/S24samba &amp;&amp;
133ln -s /etc/rc.d/init.d/samba /etc/rc.d/rc6.d/K48samba
134</userinput></screen></para>
135
136<para>Now, we'll use our new boot script to start Samba: </para>
137<para><screen><userinput>
138/etc/rc.d/init.d/samba start
139</userinput></screen></para>
140<para>We have to add the SAMBABOX root account to the Samba user list
141first in order to join WIN2KBOX to the DOMAIN01 domain: </para>
142
143<para><screen><userinput>
144smbpasswd -a root
145</userinput></screen></para>
146
147<para>After starting Samba and adding root to the Samba user list, the
148first machine we'll join to DOMAIN01 will be WIN2KBOX, the Windows
1492000 Server box we created the machine trust account for. On
150WIN2KBOX:</para><para><screen><userinput>
151
1521. Right click on My Computer.
1532. Click on Properties.
1543. Click on the Network Identification notebook tab.
1554. Click on the Properties button.
1565. In the Computer Name: edit field enter WIN2KBOX.
1576. Click on the Domain: radio button and enter DOMAIN01 in the edit
158 field and click OK.
1597. When presented with the Domain Username And Password dialog box,
160 enter root and root's password on SAMBABOX and click OK.
1618. After the machine trust is negotiated, click the OK button in the
162 dialog box welcoming you to the DOMAIN01 domain.
1639. Click OK in the reboot reminder dialog box.
16410. Click OK to close the System Properties window.
16511. Click Yes to reboot WIN2KBOX.
166</userinput></screen></para></sect3>
167
168<sect3><title>Add a new user to the DOMAIN01 domain.</title>
169<para>Before logging on to WIN2KBOX, we will create a new user with
170 the following commands:</para>
171<para><screen><userinput>
172useradd -m win2kuser01 &amp;&amp;
173passwd win2kuser01 &amp;&amp;
174smbpasswd -a win2kuser01
175</userinput></screen></para></sect3>
176
177<sect3><title>Logging on to DOMAIN01.</title>
178<para>Now we will log on the the domain as our newly created user as
179 follows:</para>
180<para><screen><userinput>
1811. Press Ctrl-Alt-Del to bring up the Log On to Windows dialog box.
1822. Enter the win2kuser01 name and password.
1833. Select DOMAIN01 from the Log on to: combination box and click OK.
184</userinput></screen></para>
185
186<para>Add the swat entry to <filename>/etc/services</filename>with the
187following command: </para>
188
189<para><screen><userinput>
190echo "swat 901/tcp" &gt;&gt; /etc/services
191</userinput></screen></para>
192
193<para>If inetd is used, the following command will add the swat entry
194to <filename>/etc/inetd.conf</filename>: </para>
195<para><screen><userinput>
196echo "swat stream tcp nowait.400 root /usr/sbin/swat swat" \
197 &gt;&gt; /etc/inetd.conf
198</userinput></screen></para>
199
200<para>If xinetd is used, the following command will add the swat entry
201to <filename>/etc/xinetd.conf</filename>: </para>
202<para><screen><userinput>
203cat &gt;&gt; /etc/xinetd.conf &lt;&lt; "EOF"
204service swat
205{
206 port = 901
207 socket_type = stream
208 wait = no
209 only_from = 127.0.0.1
210 user = root
211 server = /usr/sbin/swat
212 log_on_failure += USERID
213}
214EOF
215</userinput></screen></para>
216
217<para>The Samba Web Administration Tool, swat, can be launched with the
218following command on SAMBABOX: </para>
219<para><screen><userinput>
220lynx http://localhost:901
221</userinput></screen></para>
222<note><para>Be sure inetd is running, and issue a killall -HUP inetd
223before starting swat.</para></note>
224<para>The lynx browser is used in this demonstration, but is not
225necessary.</para></sect3>
226
227</sect2>
228
Note: See TracBrowser for help on using the repository browser.