trying to get HEAD building again. If you want the code
[nivanova/samba-autobuild/.git] / docs / docbook / projdoc / AdvancedNetworkAdmin.xml
1 <chapter id="AdvancedNetworkManagement">
2 <chapterinfo>
3         &author.jht;
4     <pubdate>April 3 2003</pubdate>
5 </chapterinfo>
6
7 <title>Advanced Network Management</title>
8
9 <para>
10 This section documents 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>
14
15 <sect1>
16 <title>Features and Benefits</title>
17
18 <para>
19 Often the difference between a working network environment and a well appreciated one can
20 best be measured by the <emphasis>little things</emphasis> that makes everything work more
21 harmoniously. A key part of every network environment solution is the ability to remotely
22 manage MS Windows workstations, to remotely access the Samba server, to provide customised
23 logon scripts, as well as other house keeping activities that help to sustain more reliable
24 network operations.
25 </para>
26
27 <para>
28 This chapter presents information on each of these area. They are placed here, and not in
29 other chapters, for ease of reference.
30 </para>
31
32 </sect1>
33
34 <sect1>
35 <title>Remote Server Administration</title>
36
37 <para>
38 <emphasis>How do I get 'User Manager' and 'Server Manager'?</emphasis>
39 </para>
40
41 <para>
42         Since I don't need to buy an <application>NT4 Server</application>, how do I get the 'User Manager for Domains',
43 the 'Server Manager'?
44 </para>
45
46 <para>
47 Microsoft distributes a version of these tools called nexus for installation 
48 on <application>Windows 9x / Me</application> systems.  The tools set includes:
49 </para>
50
51 <simplelist>
52         <member>Server Manager</member>
53         <member>User Manager for Domains</member>
54         <member>Event Viewer</member>
55 </simplelist>
56
57 <para>
58 Click here to download the archived file <ulink 
59 url="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE">ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE</ulink>
60 </para>
61
62 <para>
63 The <application>Windows NT 4.0</application> version of the 'User Manager for 
64 Domains' and 'Server Manager' are available from Microsoft via ftp 
65 from <ulink url="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE">ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE</ulink>
66 </para>
67
68 </sect1>
69
70 <sect1>
71 <title>Remote Desktop Management</title>
72
73 <para>
74 There are a number of possible remote desktop management solutions that range from free
75 through costly. Do not let that put you off. Sometimes the most costly solutions is the
76 most cost effective. In any case, you will need to draw your own conclusions as to which
77 is the best tool in your network environment.
78 </para>
79
80         <sect2>
81         <title>Remote Management from NoMachines.Com</title>
82
83         <para>
84         The following information was posted to the Samba mailing list at Apr 3 23:33:50 GMT 2003.
85         It is presented in slightly edited form (with author details omitted for privacy reasons).
86         The entire answer is reproduced below with some comments removed.
87         </para>
88
89 <para>
90 <screen>
91 &gt; I have a wonderful linux/samba server running as PDC for a network.
92 &gt; Now I would like to add remote desktop capabilities so that
93 &gt; users outside could login to the system and get their desktop up from
94 &gt; home or another country..
95 &gt;
96 &gt; Is there a way to accomplish this? Do I need a windows terminal server?
97 &gt; Do I need to configure it so that it is a member of the domain or a
98 &gt; BDC,PDC? Are there any hacks for MS Windows XP to enable remote login
99 &gt; even if the computer is in a domain?
100 &gt;
101 &gt; Any ideas/experience would be appreciated :)
102 </screen>
103 </para>
104
105         <para>
106         Answer provided: Check out the new offer from NoMachine, "NX" software:
107         <ulink url="http://www.nomachine.com/">http://www.nomachine.com/</ulink>.
108         </para>
109
110         <para>
111         It implements a very easy-to-use interface to the remote X protocol as
112         well as incorporating VNC/RFB and rdesktop/RDP into it, but at a speed
113         performance much better than anything you may have ever seen...
114         </para>
115
116         <para>
117         Remote X is not new at all -- but what they did achieve successfully is
118         a new way of compression and caching technologies which makes the thing
119         fast enough to run even over slow modem/ISDN connections.
120         </para>
121
122         <para>
123         I could test drive their (public) RedHat machine in Italy, over a loaded
124         internet connection, with enabled thumbnail previews in KDE konqueror
125         which popped up immediately on "mouse-over". From inside that (remote X)
126         session I started a rdesktop session on another, a Windows XP machine.
127         To test the performance, I played Pinball. I am proud to announce here
128         that my score was 631750 points at first try...
129         </para>
130
131         <para>
132         NX performs better on my local LAN than any of the other "pure"
133         connection methods I am using from time to time: TightVNC, rdesktop or
134         remote X. It is even faster than a direct crosslink connection between
135         two nodes.
136         </para>
137
138         <para>
139         I even got sound playing from the remote X app to my local boxes, and
140         had a working "copy'n'paste" from an NX  window (running a KDE session
141         in Italy) to my Mozilla mailing agent... These guys are certainly doing
142         something right!
143         </para>
144
145         <para>
146         I recommend to test drive NX to anybody with a only a remote interest
147         in remote computing
148         <ulink url="http://www.nomachine.com/testdrive.php">http://www.nomachine.com/testdrive.php</ulink>.
149         </para>
150
151         <para>
152         Just download the free of charge client software (available for RedHat,
153         SuSE, Debian and Windows) and be up and running within 5 minutes (they
154         need to send you your account data, though, because you are assigned
155         a real Unix account on their testdrive.nomachine.com box...
156         </para>
157
158         <para>
159         They plan to get to the point were you can have NX application servers
160         running as a cluster of nodes, and users simply start an NX session locally,
161         and can select applications to run transparently (apps may even run on
162         another NX node, but pretend to be on the same as used for initial login,
163         because it displays in the same window.... well, you also can run it
164         fullscreen, and after a short time you forget that it is a remote session
165         at all).
166         </para>
167
168         <para>
169         Now the best thing at the end: all the core compression and caching
170         technologies are released under the GPL and available as source code
171         to anybody who wants to build on it! These technologies are working,
172         albeit started from the command line only (and very inconvenient to
173         use in order to get a fully running remote X session up and running....)
174         </para>
175
176         <para>
177         To answer your questions:
178         </para>
179
180         <itemizedlist>
181                 <listitem><para>
182                 You don't need to install a terminal server; XP has RDP support built in.
183                 </para></listitem>
184
185                 <listitem><para>
186                 NX is much cheaper than Citrix -- and comparable in performance, probably faster
187                 </para></listitem>
188
189                 <listitem><para>
190                 You don't need to hack XP -- it just works
191                 </para></listitem>
192
193                 <listitem><para>
194                 You log into the XP box from remote transparently (and I think there is no
195                 need to change anything to get a connection, even if authentication is against a domain)
196                 </para></listitem>
197
198                 <listitem><para>
199                 The NX core technologies are all Open Source and released under the GPL --
200                 you can today use a (very inconvenient) commandline to use it at no cost,
201                 but you can buy a comfortable (proprietary) NX GUI frontend for money
202                 </para></listitem>
203
204                 <listitem><para>
205                 NoMachine are encouraging and offering help to OSS/Free Software implementations
206                 for such a frontend too, even if it means competition to them (they have written
207                 to this effect even to the LTSP, KDE and GNOME developer mailing lists)
208                 </para></listitem>
209         </itemizedlist>
210
211         </sect2>
212
213 </sect1>
214
215 <sect1>
216 <title>Network Logon Script Magic</title>
217
218 <para>
219 This section needs work. Volunteer contributions most welcome. Please send your patches or updates
220 to <ulink url="mailto:jht@samba.org">John Terpstra</ulink>.
221 </para>
222
223 <para>
224 There are several opportunities for creating a custom network startup configuration environment.
225 </para>
226
227 <simplelist>
228         <member>No Logon Script</member>
229         <member>Simple universal Logon Script that applies to all users</member>
230         <member>Use of a conditional Logon Script that applies per user or per group attributes</member>
231         <member>Use of Samba's Preexec and Postexec functions on access to the NETLOGON share to create
232         a custom Logon Script and then execute it.</member>
233         <member>User of a tool such as KixStart</member>
234 </simplelist>
235
236 <para>
237 The Samba source code tree includes two logon script generation/execution tools.
238 See <filename>examples</filename> directory <filename>genlogon</filename> and
239 <filename>ntlogon</filename> subdirectories.
240 </para>
241
242 <para>
243 The following listings are from the genlogon directory.
244 </para>
245
246 <para>
247 This is the <filename>genlogon.pl</filename> file:
248
249 <programlisting>
250         #!/usr/bin/perl
251         #
252         # genlogon.pl
253         #
254         # Perl script to generate user logon scripts on the fly, when users
255         # connect from a Windows client.  This script should be called from smb.conf
256         # with the %U, %G and %L parameters. I.e:
257         #
258         #       root preexec = genlogon.pl %U %G %L
259         #
260         # The script generated will perform
261         # the following:
262         #
263         # 1. Log the user connection to /var/log/samba/netlogon.log
264         # 2. Set the PC's time to the Linux server time (which is maintained
265         #    daily to the National Institute of Standard's Atomic clock on the
266         #    internet.
267         # 3. Connect the user's home drive to H: (H for Home).
268         # 4. Connect common drives that everyone uses.
269         # 5. Connect group-specific drives for certain user groups.
270         # 6. Connect user-specific drives for certain users.
271         # 7. Connect network printers.
272
273         # Log client connection
274         #($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
275         ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
276         open LOG, ">>/var/log/samba/netlogon.log";
277         print LOG "$mon/$mday/$year $hour:$min:$sec - User $ARGV[0] logged into $ARGV[1]\n";
278         close LOG;
279
280         # Start generating logon script
281         open LOGON, ">/shared/netlogon/$ARGV[0].bat";
282         print LOGON "\@ECHO OFF\r\n";
283
284         # Connect shares just use by Software Development group
285         if ($ARGV[1] eq "SOFTDEV" || $ARGV[0] eq "softdev")
286         {
287                 print LOGON "NET USE M: \\\\$ARGV[2]\\SOURCE\r\n";
288         }
289
290         # Connect shares just use by Technical Support staff
291         if ($ARGV[1] eq "SUPPORT" || $ARGV[0] eq "support")
292         {
293                 print LOGON "NET USE S: \\\\$ARGV[2]\\SUPPORT\r\n";
294         }
295
296         # Connect shares just used by Administration staff
297         If ($ARGV[1] eq "ADMIN" || $ARGV[0] eq "admin")
298         {
299                 print LOGON "NET USE L: \\\\$ARGV[2]\\ADMIN\r\n";
300                 print LOGON "NET USE K: \\\\$ARGV[2]\\MKTING\r\n";
301         }
302
303         # Now connect Printers.  We handle just two or three users a little
304         # differently, because they are the exceptions that have desktop
305         # printers on LPT1: - all other user's go to the LaserJet on the
306         # server.
307         if ($ARGV[0] eq 'jim'
308             || $ARGV[0] eq 'yvonne')
309         {
310                 print LOGON "NET USE LPT2: \\\\$ARGV[2]\\LJET3\r\n";
311                 print LOGON "NET USE LPT3: \\\\$ARGV[2]\\FAXQ\r\n";
312         }
313         else
314         {
315                 print LOGON "NET USE LPT1: \\\\$ARGV[2]\\LJET3\r\n";
316                 print LOGON "NET USE LPT3: \\\\$ARGV[2]\\FAXQ\r\n";
317         }
318
319         # All done! Close the output file.
320         close LOGON;
321 </programlisting>
322 </para>
323
324 <para>
325 Those wishing to use more elaborate or capable logon processing system should check out the following sites:
326 </para>
327
328 <simplelist>
329         <member><ulink url="http://www.craigelachie.org/rhacer/ntlogon">http://www.craigelachie.org/rhacer/ntlogon</ulink></member>
330         <member><ulink url="http://www.kixtart.org">http://www.kixtart.org</ulink></member>
331         <member><ulink url="http://support.microsoft.com/default.asp?scid=kb;en-us;189105">http://support.microsoft.com/default.asp?scid=kb;en-us;189105</ulink></member>
332 </simplelist>
333
334 <sect2>
335 <title>Adding printers without user intervention</title>
336
337 <para>
338 Printers may be added automatically during logon script processing through the use of:
339
340 <programlisting>
341         rundll32 printui.dll,PrintUIEntry /?
342 </programlisting>
343
344 See the documentation in the <ulink url="http://support.microsoft.com/default.asp?scid=kb;en-us;189105">Microsoft knowledgebase article no: 189105</ulink>.
345 </para>
346 </sect2>
347
348 </sect1>
349
350 <sect1>
351 <title>Common Errors</title>
352
353 <para>
354 The information provided in this chapter has been reproduced from postings on the samba@samba.org
355 mailing list. No implied endorsement or recommendation is offered. Administrators should conduct 
356 their own evaluation of alternatives and are encouraged to draw their own conclusions.
357 </para>
358
359 </sect1>
360
361 </chapter>