source: server/other/samba/samba-config.xml@ 9905a3c

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 9905a3c was 9905a3c, checked in by Bruce Dubbs <bdubbs@…>, 21 years ago

Added openldap and fixed numereous typos

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