Docbook XML conversion: projdoc
[Samba/vl.git] / docs / docbook / projdoc / AdvancedNetworkAdmin.xml
blobdc2a78f5a67a8922c7fcc17ba44c8ef36dea9813
1 <chapter id="AdvancedNetworkManagement">
2 <chapterinfo>
3         &author.jht;
4     <pubdate>April 3 2003</pubdate>
5 </chapterinfo>
7 <title>Advanced Network Manangement</title>
9 <para>
10 This section attempts to document peripheral issues that are of great importance to network
11 administrators who want to improve network resource access control, to automate the user
12 environment, and to make their lives a little easier.
13 </para>
15 <sect1>
16 <title>Configuring Samba Share Access Controls</title>
18 <para>
19 This section deals with how to configure Samba per share access control restrictions.
20 By default samba sets no restrictions on the share itself. Restrictions on the share itself
21 can be set on MS Windows NT4/200x/XP shares. This can be a very effective way to limit who can
22 connect to a share. In the absence of specific restrictions the default setting is to allow
23 the global user <emphasis>Everyone</emphasis> Full Control (ie: Full control, Change and Read).
24 </para>
26 <para>
27 At this time Samba does NOT provide a tool for configuring access control setting on the Share
28 itself. Samba does have the capacity to store and act on access control settings, but  the only
29 way to create those settings is to use either the NT4 Server Manager or the Windows 200x MMC for
30 Computer Management.
31 </para>
33 <para>
34 Samba stores the per share access control settings in a file called <filename>share_info.tdb</filename>.
35 The location of this file on your system will depend on how samba was compiled. The default location
36 for samba's tdb files is under <filename>/usr/local/samba/var</filename>. If the <filename>tdbdump</filename>
37 utility has been compiled and installed on your system then you can examine the contents of this file
38 by: <userinput>tdbdump share_info.tdb</userinput>.
39 </para>
41 <sect2>
42 <title>Share Permissions Management</title>
44 <para>
45 The best tool for the task is platform dependant. Choose the best tool for your environmemt.
46 </para>
48 <sect3>
49 <title>Windows NT4 Workstation/Server</title>
50 <para>
51 The tool you need to use to manage share permissions on a Samba server is the NT Server Manager.
52 Server Manager is shipped with Windows NT4 Server products but not with Windows NT4 Workstation.
53 You can obtain the NT Server Manager for MS Windows NT4 Workstation from Microsoft - see details below.
54 </para>
56 <procedure>
57 <title>Instructions</title>
58 <step><para>
59 Launch the NT4 Server Manager, click on the Samba server you want to administer, then from the menu
60 select Computer, then click on the Shared Directories entry.
61 </para></step>
63 <step><para>
64         Now click on the share that you wish to manage, then click on the Properties tab, next click on
65         the Permissions tab. Now you can Add or change access control settings as you wish.
66 </para></step>
67 </procedure>
69 </sect3>
71 <sect3>
72 <title>Windows 200x/XP</title>
74 <para>
75 On MS Windows NT4/200x/XP system access control lists on the share itself are set using native
76 tools, usually from filemanager. For example, in Windows 200x: right click on the shared folder,
77 then select 'Sharing', then click on 'Permissions'. The default Windows NT4/200x permission allows
78 <emphasis>Everyone</emphasis> Full Control on the Share.
79 </para>
81 <para>
82 MS Windows 200x and later all comes with a tool called the 'Computer Management' snap-in for the
83 Microsoft Management Console (MMC). This tool is located by clicking on <filename>Control Panel ->
84 Administrative Tools -> Computer Management</filename>.
85 </para>
87 <procedure>
88 <title>Instructions</title>
89 <step><para>
90         After launching the MMC with the Computer Management snap-in, click on the menu item 'Action',
91         select 'Connect to another computer'. If you are not logged onto a domain you will be prompted
92         to enter a domain login user identifier and a password. This will authenticate you to the domain.
93         If you where already logged in with administrative privilidge this step is not offered.
94 </para></step>
96 <step><para>
97 If the Samba server is not shown in the Select Computer box, then type in the name of the target
98 Samba server in the field 'Name:'. Now click on the [+] next to 'System Tools', then on the [+]
99 next to 'Shared Folders' in the left panel.
100 </para></step>
102 <step><para>
103 Now in the right panel, double-click on the share you wish to set access control permissions on.
104 Then click on the tab 'Share Permissions'. It is now possible to add access control entities
105 to the shared folder. Do NOT forget to set what type of access (full control, change, read) you
106 wish to assign for each entry.
107 </para></step>
108 </procedure>
110 <warning>
111 <para>
112 Be careful. If you take away all permissions from the Everyone user without removing this user
113 then effectively no user will be able to access the share. This is a result of what is known as
114 ACL precidence. ie: Everyone with NO ACCESS means that MaryK who is part of the group Everyone
115 will have no access even if this user is given explicit full control access.
116 </para>
117 </warning>
119 </sect3>
120 </sect2>
121 </sect1>
123 <sect1>
124 <title>Remote Server Administration</title>
126 <para>
127 <emphasis>How do I get 'User Manager' and 'Server Manager'?</emphasis>
128 </para>
130 <para>
131 Since I don't need to buy an NT4 Server, how do I get the 'User Manager for Domains',
132 the 'Server Manager'?
133 </para>
135 <para>
136 Microsoft distributes a version of these tools called nexus for installation on Windows 9x / Me
137 systems.  The tools set includes:
138 </para>
140 <itemizedlist>
141         <listitem><para>Server Manager</para></listitem> 
142         <listitem><para>User Manager for Domains</para></listitem> 
143         <listitem><para>Event Viewer</para></listitem> 
144 </itemizedlist>
146 <para>
147 Click here to download the archived file <ulink 
148 url="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE">ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</ulink>
149 </para>
151 <para>
152 The Windows NT 4.0 version of the 'User Manager for 
153 Domains' and 'Server Manager' are available from Microsoft via ftp 
154 from <ulink url="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE">ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</ulink>
155 </para>
157 </sect1>
158 <sect1>
159 <title>Network Logon Script Magic</title>
161 <para>
162 This section needs work. Volunteer contributions most welcome. Please send your patches or updates
163 to <ulink url="mailto:jht@samba.org">John Terpstra</ulink>.
164 </para>
166 <para>
167 There are several opportunities for creating a custom network startup configuration environment.
168 </para>
170 <simplelist>
171         <member>No Logon Script</member>
172         <member>Simple universal Logon Script that applies to all users</member>
173         <member>Use of a conditional Logon Script that applies per user or per group attirbutes</member>
174         <member>Use of Samba's Preexec and Postexec functions on access to the NETLOGON share to create
175         a custom Logon Script and then execute it.</member>
176         <member>User of a tool such as KixStart</member>
177 </simplelist>
179 <para>
180 The Samba source code tree includes two logon script generation/execution tools. See <filename>examples</filename> directory <filename>genlogon</filename> and <filename>ntlogon</filename> subdirectories.
181 </para>
183 <para>
184 The following listings are from the genlogon directory.
185 </para>
187 <para>
188 This is the genlogon.pl file:
190 <programlisting>
191         #!/usr/bin/perl
192         #
193         # genlogon.pl
194         #
195         # Perl script to generate user logon scripts on the fly, when users
196         # connect from a Windows client.  This script should be called from smb.conf
197         # with the %U, %G and %L parameters. I.e:
198         #
199         #       root preexec = genlogon.pl %U %G %L
200         #
201         # The script generated will perform
202         # the following:
203         #
204         # 1. Log the user connection to /var/log/samba/netlogon.log
205         # 2. Set the PC's time to the Linux server time (which is maintained
206         #    daily to the National Institute of Standard's Atomic clock on the
207         #    internet.
208         # 3. Connect the user's home drive to H: (H for Home).
209         # 4. Connect common drives that everyone uses.
210         # 5. Connect group-specific drives for certain user groups.
211         # 6. Connect user-specific drives for certain users.
212         # 7. Connect network printers.
214         # Log client connection
215         #($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
216         ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
217         open LOG, ">>/var/log/samba/netlogon.log";
218         print LOG "$mon/$mday/$year $hour:$min:$sec - User $ARGV[0] logged into $ARGV[1]\n";
219         close LOG;
221         # Start generating logon script
222         open LOGON, ">/shared/netlogon/$ARGV[0].bat";
223         print LOGON "\@ECHO OFF\r\n";
225         # Connect shares just use by Software Development group
226         if ($ARGV[1] eq "SOFTDEV" || $ARGV[0] eq "softdev")
227         {
228                 print LOGON "NET USE M: \\\\$ARGV[2]\\SOURCE\r\n";
229         }
231         # Connect shares just use by Technical Support staff
232         if ($ARGV[1] eq "SUPPORT" || $ARGV[0] eq "support")
233         {
234                 print LOGON "NET USE S: \\\\$ARGV[2]\\SUPPORT\r\n";
235         }
237         # Connect shares just used by Administration staff
238         If ($ARGV[1] eq "ADMIN" || $ARGV[0] eq "admin")
239         {
240                 print LOGON "NET USE L: \\\\$ARGV[2]\\ADMIN\r\n";
241                 print LOGON "NET USE K: \\\\$ARGV[2]\\MKTING\r\n";
242         }
244         # Now connect Printers.  We handle just two or three users a little
245         # differently, because they are the exceptions that have desktop
246         # printers on LPT1: - all other user's go to the LaserJet on the
247         # server.
248         if ($ARGV[0] eq 'jim'
249             || $ARGV[0] eq 'yvonne')
250         {
251                 print LOGON "NET USE LPT2: \\\\$ARGV[2]\\LJET3\r\n";
252                 print LOGON "NET USE LPT3: \\\\$ARGV[2]\\FAXQ\r\n";
253         }
254         else
255         {
256                 print LOGON "NET USE LPT1: \\\\$ARGV[2]\\LJET3\r\n";
257                 print LOGON "NET USE LPT3: \\\\$ARGV[2]\\FAXQ\r\n";
258         }
260         # All done! Close the output file.
261         close LOGON;
262 </programlisting>
263 </para>
265 <para>
266 Those wishing to use more elaborate or capable logon processing system should check out the following sites:
267 </para>
269 <simplelist>
270         <member>http://www.craigelachie.org/rhacer/ntlogon</member>
271         <member>http://www.kixtart.org</member>
272         <member>http://support.microsoft.com/default.asp?scid=kb;en-us;189105</member>
273 </simplelist>
275 <sect2>
276 <title>Adding printers without user intervention</title>
278 <para>
279 Printers may be added automatically during logon script processing through the use of:
281 <programlisting>
282         rundll32 printui.dll,PrintUIEntry /?
283 </programlisting>
285 See the documentation in the Microsoft knowledgebase article no: 189105 referred to above.
286 </para>
287 </sect2>
289 </sect1>
290 </chapter>