| 1 | <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 25. Advanced Network Management</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="The Official Samba 3.0.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="prev" href="winbind.html" title="Chapter 24. Winbind: Use of Domain Accounts"><link rel="next" href="PolicyMgmt.html" title="Chapter 26. System and Account Policies"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 25. Advanced Network Management</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="winbind.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="PolicyMgmt.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="AdvancedNetworkManagement"></a>Chapter 25. Advanced Network Management</h2></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="orgname">Samba Team</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div><div><p class="pubdate">June 15 2005</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="AdvancedNetworkManagement.html#id2657588">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="AdvancedNetworkManagement.html#id2657615">Remote Server Administration</a></span></dt><dt><span class="sect1"><a href="AdvancedNetworkManagement.html#id2657758">Remote Desktop Management</a></span></dt><dd><dl><dt><span class="sect2"><a href="AdvancedNetworkManagement.html#id2657786">Remote Management from NoMachine.Com</a></span></dt><dt><span class="sect2"><a href="AdvancedNetworkManagement.html#id2658162">Remote Management with ThinLinc</a></span></dt></dl></dd><dt><span class="sect1"><a href="AdvancedNetworkManagement.html#id2658348">Network Logon Script Magic</a></span></dt><dd><dl><dt><span class="sect2"><a href="AdvancedNetworkManagement.html#id2658573">Adding Printers without User Intervention</a></span></dt><dt><span class="sect2"><a href="AdvancedNetworkManagement.html#id2658616">Limiting Logon Connections</a></span></dt></dl></dd></dl></div><p>
|
|---|
| 2 | <a class="indexterm" name="id2657576"></a>
|
|---|
| 3 | This section documents peripheral issues that are of great importance to network
|
|---|
| 4 | administrators who want to improve network resource access control, to automate the user
|
|---|
| 5 | environment, and to make their lives a little easier.
|
|---|
| 6 | </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2657588"></a>Features and Benefits</h2></div></div></div><p>
|
|---|
| 7 | Often the difference between a working network environment and a well-appreciated one can
|
|---|
| 8 | best be measured by the <span class="emphasis"><em>little things</em></span> that make everything work more
|
|---|
| 9 | harmoniously. A key part of every network environment solution is the ability to remotely
|
|---|
| 10 | manage MS Windows workstations, remotely access the Samba server, provide customized
|
|---|
| 11 | logon scripts, as well as other housekeeping activities that help to sustain more reliable
|
|---|
| 12 | network operations.
|
|---|
| 13 | </p><p>
|
|---|
| 14 | This chapter presents information on each of these areas. They are placed here, and not in
|
|---|
| 15 | other chapters, for ease of reference.
|
|---|
| 16 | </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2657615"></a>Remote Server Administration</h2></div></div></div><p>“<span class="quote">How do I get User Manager and Server Manager?</span>”</p><p>
|
|---|
| 17 | <a class="indexterm" name="id2657628"></a>
|
|---|
| 18 | <a class="indexterm" name="id2657635"></a>
|
|---|
| 19 | <a class="indexterm" name="id2657642"></a>
|
|---|
| 20 | Since I do not need to buy an <span class="application">NT4 server</span>, how do I get the User Manager for Domains
|
|---|
| 21 | and the Server Manager?
|
|---|
| 22 | </p><p>
|
|---|
| 23 | <a class="indexterm" name="id2657660"></a>
|
|---|
| 24 | <a class="indexterm" name="id2657667"></a>
|
|---|
| 25 | Microsoft distributes a version of these tools called <code class="filename">Nexus.exe</code> for installation
|
|---|
| 26 | on <span class="application">Windows 9x/Me</span> systems. The tools set includes:
|
|---|
| 27 | </p><div class="itemizedlist"><ul type="disc"><li><p>Server Manager</p></li><li><p>User Manager for Domains</p></li><li><p>Event Viewer</p></li></ul></div><p>
|
|---|
| 28 | Download the archived file at the Microsoft <a class="ulink" href="ftp://ftp.microsoft.com/Softlib/MSLFILES/NEXUS.EXE" target="_top">Nexus</a> link.
|
|---|
| 29 | </p><p>
|
|---|
| 30 | <a class="indexterm" name="id2657721"></a>
|
|---|
| 31 | <a class="indexterm" name="id2657728"></a>
|
|---|
| 32 | <a class="indexterm" name="id2657735"></a>
|
|---|
| 33 | The <span class="application">Windows NT 4.0</span> version of the User Manager for
|
|---|
| 34 | Domains and Server Manager are available from Microsoft
|
|---|
| 35 | <a class="ulink" href="ftp://ftp.microsoft.com/Softlib/MSLFILES/SRVTOOLS.EXE" target="_top">via ftp</a>.
|
|---|
| 36 | </p></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2657758"></a>Remote Desktop Management</h2></div></div></div><p>
|
|---|
| 37 | <a class="indexterm" name="id2657766"></a>
|
|---|
| 38 | <a class="indexterm" name="id2657773"></a>
|
|---|
| 39 | There are a number of possible remote desktop management solutions that range from free
|
|---|
| 40 | through costly. Do not let that put you off. Sometimes the most costly solution is the
|
|---|
| 41 | most cost effective. In any case, you will need to draw your own conclusions as to which
|
|---|
| 42 | is the best tool in your network environment.
|
|---|
| 43 | </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2657786"></a>Remote Management from NoMachine.Com</h3></div></div></div><p>
|
|---|
| 44 | <a class="indexterm" name="id2657795"></a>
|
|---|
| 45 | The following information was posted to the Samba mailing list at Apr 3 23:33:50 GMT 2003.
|
|---|
| 46 | It is presented in slightly edited form (with author details omitted for privacy reasons).
|
|---|
| 47 | The entire answer is reproduced below with some comments removed.
|
|---|
| 48 | </p><p>“<span class="quote">
|
|---|
| 49 | <a class="indexterm" name="id2657810"></a>
|
|---|
| 50 | I have a wonderful Linux/Samba server running as PDC for a network. Now I would like to add remote
|
|---|
| 51 | desktop capabilities so users outside could login to the system and get their desktop up from home or
|
|---|
| 52 | another country.
|
|---|
| 53 | </span>”</p><p>“<span class="quote">
|
|---|
| 54 | <a class="indexterm" name="id2657826"></a>
|
|---|
| 55 | <a class="indexterm" name="id2657833"></a>
|
|---|
| 56 | <a class="indexterm" name="id2657839"></a>
|
|---|
| 57 | <a class="indexterm" name="id2657846"></a>
|
|---|
| 58 | Is there a way to accomplish this? Do I need a Windows Terminal server? Do I need to configure it so
|
|---|
| 59 | it is a member of the domain or a BDC or PDC? Are there any hacks for MS Windows XP to enable remote login
|
|---|
| 60 | even if the computer is in a domain?
|
|---|
| 61 | </span>”</p><p>
|
|---|
| 62 | Answer provided: Check out the new offer of “<span class="quote">NX</span>” software from
|
|---|
| 63 | <a class="ulink" href="http://www.nomachine.com/" target="_top">NoMachine</a>.
|
|---|
| 64 | </p><p>
|
|---|
| 65 | <a class="indexterm" name="id2657877"></a>
|
|---|
| 66 | <a class="indexterm" name="id2657884"></a>
|
|---|
| 67 | <a class="indexterm" name="id2657890"></a>
|
|---|
| 68 | It implements an easy-to-use interface to the Remote X protocol as
|
|---|
| 69 | well as incorporating VNC/RFB and rdesktop/RDP into it, but at a speed
|
|---|
| 70 | performance much better than anything you may have ever seen.
|
|---|
| 71 | </p><p>
|
|---|
| 72 | <a class="indexterm" name="id2657904"></a>
|
|---|
| 73 | Remote X is not new at all, but what they did achieve successfully is
|
|---|
| 74 | a new way of compression and caching technologies that makes the thing
|
|---|
| 75 | fast enough to run even over slow modem/ISDN connections.
|
|---|
| 76 | </p><p>
|
|---|
| 77 | <a class="indexterm" name="id2657918"></a>
|
|---|
| 78 | <a class="indexterm" name="id2657925"></a>
|
|---|
| 79 | <a class="indexterm" name="id2657931"></a>
|
|---|
| 80 | <a class="indexterm" name="id2657938"></a>
|
|---|
| 81 | I test drove their (public) Red Hat machine in Italy, over a loaded
|
|---|
| 82 | Internet connection, with enabled thumbnail previews in KDE konqueror,
|
|---|
| 83 | which popped up immediately on “<span class="quote">mouse-over</span>”. From inside that (remote X)
|
|---|
| 84 | session I started a rdesktop session on another, a Windows XP machine.
|
|---|
| 85 | To test the performance, I played Pinball. I am proud to announce
|
|---|
| 86 | that my score was 631,750 points at first try.
|
|---|
| 87 | </p><p>
|
|---|
| 88 | <a class="indexterm" name="id2657957"></a>
|
|---|
| 89 | <a class="indexterm" name="id2657964"></a>
|
|---|
| 90 | <a class="indexterm" name="id2657970"></a>
|
|---|
| 91 | <a class="indexterm" name="id2657977"></a>
|
|---|
| 92 | NX performs better on my local LAN than any of the other “<span class="quote">pure</span>”
|
|---|
| 93 | connection methods I use from time to time: TightVNC, rdesktop or
|
|---|
| 94 | Remote X. It is even faster than a direct crosslink connection between
|
|---|
| 95 | two nodes.
|
|---|
| 96 | </p><p>
|
|---|
| 97 | <a class="indexterm" name="id2657994"></a>
|
|---|
| 98 | <a class="indexterm" name="id2658001"></a>
|
|---|
| 99 | <a class="indexterm" name="id2658008"></a>
|
|---|
| 100 | I even got sound playing from the Remote X app to my local boxes, and
|
|---|
| 101 | had a working “<span class="quote">copy'n'paste</span>” from an NX window (running a KDE session
|
|---|
| 102 | in Italy) to my Mozilla mailing agent. These guys are certainly doing
|
|---|
| 103 | something right!
|
|---|
| 104 | </p><p>
|
|---|
| 105 | I recommend test driving NX to anybody with a only a passing interest in remote computing
|
|---|
| 106 | the <a class="ulink" href="http://www.nomachine.com/testdrive.php" target="_top">NX</a> utility.
|
|---|
| 107 | </p><p>
|
|---|
| 108 | Just download the free-of-charge client software (available for Red Hat,
|
|---|
| 109 | SuSE, Debian and Windows) and be up and running within 5 minutes (they
|
|---|
| 110 | need to send you your account data, though, because you are assigned
|
|---|
| 111 | a real UNIX account on their testdrive.nomachine.com box).
|
|---|
| 112 | </p><p>
|
|---|
| 113 | They plan to get to the point were you can have NX application servers
|
|---|
| 114 | running as a cluster of nodes, and users simply start an NX session locally
|
|---|
| 115 | and can select applications to run transparently (apps may even run on
|
|---|
| 116 | another NX node, but pretend to be on the same as used for initial login,
|
|---|
| 117 | because it displays in the same window. You also can run it
|
|---|
| 118 | full-screen, and after a short time you forget that it is a remote session
|
|---|
| 119 | at all).
|
|---|
| 120 | </p><p>
|
|---|
| 121 | <a class="indexterm" name="id2658058"></a>
|
|---|
| 122 | Now the best thing for last: All the core compression and caching
|
|---|
| 123 | technologies are released under the GPL and available as source code
|
|---|
| 124 | to anybody who wants to build on it! These technologies are working,
|
|---|
| 125 | albeit started from the command line only (and very inconvenient to
|
|---|
| 126 | use in order to get a fully running remote X session up and running).
|
|---|
| 127 | </p><p>
|
|---|
| 128 | To answer your questions:
|
|---|
| 129 | </p><div class="itemizedlist"><ul type="disc"><li><p>
|
|---|
| 130 | You do not need to install a terminal server; XP has RDP support built in.
|
|---|
| 131 | </p></li><li><p>
|
|---|
| 132 | NX is much cheaper than Citrix and comparable in performance, probably faster.
|
|---|
| 133 | </p></li><li><p>
|
|---|
| 134 | You do not need to hack XP it just works.
|
|---|
| 135 | </p></li><li><p>
|
|---|
| 136 | You log into the XP box from remote transparently (and I think there is no
|
|---|
| 137 | need to change anything to get a connection, even if authentication is against a domain).
|
|---|
| 138 | </p></li><li><p>
|
|---|
| 139 | The NX core technologies are all Open Source and released under the GPL
|
|---|
| 140 | you can now use a (very inconvenient) command line at no cost,
|
|---|
| 141 | but you can buy a comfortable (proprietary) NX GUI front end for money.
|
|---|
| 142 | </p></li><li><p>
|
|---|
| 143 | <a class="indexterm" name="id2658121"></a>
|
|---|
| 144 | <a class="indexterm" name="id2658128"></a>
|
|---|
| 145 | <a class="indexterm" name="id2658134"></a>
|
|---|
| 146 | <a class="indexterm" name="id2658141"></a>
|
|---|
| 147 | <a class="indexterm" name="id2658148"></a>
|
|---|
| 148 | NoMachine is encouraging and offering help to OSS/Free Software implementations
|
|---|
| 149 | for such a front-end too, even if it means competition to them (they have written
|
|---|
| 150 | to this effect even to the LTSP, KDE, and GNOME developer mailing lists).
|
|---|
| 151 | </p></li></ul></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2658162"></a>Remote Management with ThinLinc</h3></div></div></div><p>
|
|---|
| 152 | Another alternative for remote access is <span class="emphasis"><em>ThinLinc</em></span> from Cendio.
|
|---|
| 153 | </p><p>
|
|---|
| 154 | <a class="indexterm" name="id2658178"></a>
|
|---|
| 155 | <a class="indexterm" name="id2658185"></a>
|
|---|
| 156 | <a class="indexterm" name="id2658192"></a>
|
|---|
| 157 | <a class="indexterm" name="id2658199"></a>
|
|---|
| 158 | <a class="indexterm" name="id2658206"></a>
|
|---|
| 159 | <a class="indexterm" name="id2658212"></a>
|
|---|
| 160 | <a class="indexterm" name="id2658219"></a>
|
|---|
| 161 | <a class="indexterm" name="id2658226"></a>
|
|---|
| 162 | ThinLinc is a terminal server solution that is available for Linux and Solaris based on standard
|
|---|
| 163 | protocols such as SSH, TightVNC, NFS and PulseAudio.
|
|---|
| 164 | </p><p>
|
|---|
| 165 | <a class="indexterm" name="id2658238"></a>
|
|---|
| 166 | <a class="indexterm" name="id2658245"></a>
|
|---|
| 167 | ThinLinc an be used both in the LAN environment to implement a Thin Client strategy for an organization, and as
|
|---|
| 168 | secure remote access solution for people working from remote locations, even over smallband connections.
|
|---|
| 169 | ThinLinc is free to use for a single concurrent user.
|
|---|
| 170 | </p><p>
|
|---|
| 171 | <a class="indexterm" name="id2658260"></a>
|
|---|
| 172 | <a class="indexterm" name="id2658266"></a>
|
|---|
| 173 | <a class="indexterm" name="id2658273"></a>
|
|---|
| 174 | The product can also be used as a frontend to access Windows Terminal Server or Citrix farms, or even Windows
|
|---|
| 175 | XP machines, securing the connection via the ssh protocol. The client is available both for Linux (supporting
|
|---|
| 176 | all Linux distributions as well as numerous thin terminals) and for Windows. A Java-based Web client is also
|
|---|
| 177 | available.
|
|---|
| 178 | </p><p>
|
|---|
| 179 | ThinLinc may be evaluated by connecting to Cendio's demo system, see
|
|---|
| 180 | <a class="ulink" href="http://www.cendio.com" target="_top">Cendio's</a> web site
|
|---|
| 181 | <a class="ulink" href="http://www.cendio.com/testdrive" target="_top">testdrive</a> center.
|
|---|
| 182 | </p><p>
|
|---|
| 183 | Cendio is a major contributor to several open source projects including
|
|---|
| 184 | <a class="ulink" href="http://www.tightvnc.com" target="_top">TightVNC</a>,
|
|---|
| 185 | <a class="ulink" href="http://pulseaudio.org" target="_top">PulseAudio</a> , unfsd,
|
|---|
| 186 | <a class="ulink" href="http://www.python.org" target="_top">Python</a> and
|
|---|
| 187 | <a class="ulink" href="http://www.rdesktop.org" target="_top">rdesktop</a>.
|
|---|
| 188 | </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2658348"></a>Network Logon Script Magic</h2></div></div></div><p>
|
|---|
| 189 | There are several opportunities for creating a custom network startup configuration environment.
|
|---|
| 190 | </p><div class="itemizedlist"><ul type="disc"><li><p>No Logon Script.</p></li><li><p>Simple universal Logon Script that applies to all users.</p></li><li><p>Use of a conditional Logon Script that applies per-user or per-group attributes.</p></li><li><p>Use of Samba's preexec and postexec functions on access to the NETLOGON share to create
|
|---|
| 191 | a custom logon script and then execute it.</p></li><li><p>User of a tool such as KixStart.</p></li></ul></div><p>
|
|---|
| 192 | The Samba source code tree includes two logon script generation/execution tools.
|
|---|
| 193 | See <code class="filename">examples</code> directory <code class="filename">genlogon</code> and
|
|---|
| 194 | <code class="filename">ntlogon</code> subdirectories.
|
|---|
| 195 | </p><p>
|
|---|
| 196 | The following listings are from the genlogon directory.
|
|---|
| 197 | </p><p>
|
|---|
| 198 | <a class="indexterm" name="id2658418"></a>
|
|---|
| 199 | This is the <code class="filename">genlogon.pl</code> file:
|
|---|
| 200 |
|
|---|
| 201 | </p><pre class="programlisting">
|
|---|
| 202 | #!/usr/bin/perl
|
|---|
| 203 | #
|
|---|
| 204 | # genlogon.pl
|
|---|
| 205 | #
|
|---|
| 206 | # Perl script to generate user logon scripts on the fly, when users
|
|---|
| 207 | # connect from a Windows client. This script should be called from
|
|---|
| 208 | # smb.conf with the %U, %G and %L parameters. I.e:
|
|---|
| 209 | #
|
|---|
| 210 | # root preexec = genlogon.pl %U %G %L
|
|---|
| 211 | #
|
|---|
| 212 | # The script generated will perform
|
|---|
| 213 | # the following:
|
|---|
| 214 | #
|
|---|
| 215 | # 1. Log the user connection to /var/log/samba/netlogon.log
|
|---|
| 216 | # 2. Set the PC's time to the Linux server time (which is maintained
|
|---|
| 217 | # daily to the National Institute of Standards Atomic clock on the
|
|---|
| 218 | # internet.
|
|---|
| 219 | # 3. Connect the user's home drive to H: (H for Home).
|
|---|
| 220 | # 4. Connect common drives that everyone uses.
|
|---|
| 221 | # 5. Connect group-specific drives for certain user groups.
|
|---|
| 222 | # 6. Connect user-specific drives for certain users.
|
|---|
| 223 | # 7. Connect network printers.
|
|---|
| 224 |
|
|---|
| 225 | # Log client connection
|
|---|
| 226 | #($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
|---|
| 227 | ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
|---|
| 228 | open LOG, ">>/var/log/samba/netlogon.log";
|
|---|
| 229 | print LOG "$mon/$mday/$year $hour:$min:$sec";
|
|---|
| 230 | print LOG " - User $ARGV[0] logged into $ARGV[1]\n";
|
|---|
| 231 | close LOG;
|
|---|
| 232 |
|
|---|
| 233 | # Start generating logon script
|
|---|
| 234 | open LOGON, ">/shared/netlogon/$ARGV[0].bat";
|
|---|
| 235 | print LOGON "\@ECHO OFF\r\n";
|
|---|
| 236 |
|
|---|
| 237 | # Connect shares just use by Software Development group
|
|---|
| 238 | if ($ARGV[1] eq "SOFTDEV" || $ARGV[0] eq "softdev")
|
|---|
| 239 | {
|
|---|
| 240 | print LOGON "NET USE M: \\\\$ARGV[2]\\SOURCE\r\n";
|
|---|
| 241 | }
|
|---|
| 242 |
|
|---|
| 243 | # Connect shares just use by Technical Support staff
|
|---|
| 244 | if ($ARGV[1] eq "SUPPORT" || $ARGV[0] eq "support")
|
|---|
| 245 | {
|
|---|
| 246 | print LOGON "NET USE S: \\\\$ARGV[2]\\SUPPORT\r\n";
|
|---|
| 247 | }
|
|---|
| 248 |
|
|---|
| 249 | # Connect shares just used by Administration staff
|
|---|
| 250 | If ($ARGV[1] eq "ADMIN" || $ARGV[0] eq "admin")
|
|---|
| 251 | {
|
|---|
| 252 | print LOGON "NET USE L: \\\\$ARGV[2]\\ADMIN\r\n";
|
|---|
| 253 | print LOGON "NET USE K: \\\\$ARGV[2]\\MKTING\r\n";
|
|---|
| 254 | }
|
|---|
| 255 |
|
|---|
| 256 | # Now connect Printers. We handle just two or three users a little
|
|---|
| 257 | # differently, because they are the exceptions that have desktop
|
|---|
| 258 | # printers on LPT1: - all other user's go to the LaserJet on the
|
|---|
| 259 | # server.
|
|---|
| 260 | if ($ARGV[0] eq 'jim'
|
|---|
| 261 | || $ARGV[0] eq 'yvonne')
|
|---|
| 262 | {
|
|---|
| 263 | print LOGON "NET USE LPT2: \\\\$ARGV[2]\\LJET3\r\n";
|
|---|
| 264 | print LOGON "NET USE LPT3: \\\\$ARGV[2]\\FAXQ\r\n";
|
|---|
| 265 | }
|
|---|
| 266 | else
|
|---|
| 267 | {
|
|---|
| 268 | print LOGON "NET USE LPT1: \\\\$ARGV[2]\\LJET3\r\n";
|
|---|
| 269 | print LOGON "NET USE LPT3: \\\\$ARGV[2]\\FAXQ\r\n";
|
|---|
| 270 | }
|
|---|
| 271 |
|
|---|
| 272 | # All done! Close the output file.
|
|---|
| 273 | close LOGON;
|
|---|
| 274 | </pre><p>
|
|---|
| 275 | </p><p>
|
|---|
| 276 | Those wishing to use a more elaborate or capable logon processing system should check out these sites:
|
|---|
| 277 | </p><div class="itemizedlist"><ul type="disc"><li><p><a class="ulink" href="http://www.craigelachie.org/rhacer/ntlogon" target="_top">http://www.craigelachie.org/rhacer/ntlogon</a></p></li><li><p><a class="ulink" href="http://www.kixtart.org" target="_top">http://www.kixtart.org</a></p></li></ul></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2658573"></a>Adding Printers without User Intervention</h3></div></div></div><p>
|
|---|
| 278 | <a class="indexterm" name="id2658581"></a>
|
|---|
| 279 | Printers may be added automatically during logon script processing through the use of:
|
|---|
| 280 | </p><pre class="screen">
|
|---|
| 281 | <code class="prompt">C:\> </code><strong class="userinput"><code>rundll32 printui.dll,PrintUIEntry /?</code></strong>
|
|---|
| 282 | </pre><p>
|
|---|
| 283 |
|
|---|
| 284 | See the documentation in the <a class="ulink" href="http://support.microsoft.com/default.asp?scid=kb;en-us;189105" target="_top">Microsoft Knowledge Base article 189105</a>.
|
|---|
| 285 | </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2658616"></a>Limiting Logon Connections</h3></div></div></div><p>
|
|---|
| 286 | Sometimes it is necessary to limit the number of concurrent connections to a
|
|---|
| 287 | Samba shared resource. For example, a site may wish to permit only one network
|
|---|
| 288 | logon per user.
|
|---|
| 289 | </p><p>
|
|---|
| 290 | The Samba <em class="parameter"><code>preexec script</code></em> parameter can be used to permit only one
|
|---|
| 291 | connection per user. Though this method is not foolproof and may have side effects,
|
|---|
| 292 | the following contributed method may inspire someone to provide a better solution.
|
|---|
| 293 | </p><p>
|
|---|
| 294 | This is not a perfect solution because Windows clients can drop idle connections
|
|---|
| 295 | with an auto-reconnect capability that could result in the appearance that a share
|
|---|
| 296 | is no longer in use, while actually it is. Even so, it demonstrates the principle
|
|---|
| 297 | of use of the <em class="parameter"><code>preexec script</code></em> parameter.
|
|---|
| 298 | </p><p>
|
|---|
| 299 | The following share configuration demonstrates use of the script shown in <a class="link" href="AdvancedNetworkManagement.html#Tpees" title="Example 25.1. Script to Enforce Single Resource Logon">“Script to Enforce Single Resource Logon”</a>.
|
|---|
| 300 | </p><pre class="programlisting">
|
|---|
| 301 | [myshare]
|
|---|
| 302 | ...
|
|---|
| 303 | preexec script = /sbin/PermitSingleLogon.sh
|
|---|
| 304 | preexec close = Yes
|
|---|
| 305 | ...
|
|---|
| 306 | </pre><p>
|
|---|
| 307 | </p><div class="example"><a name="Tpees"></a><p class="title"><b>Example 25.1. Script to Enforce Single Resource Logon</b></p><div class="example-contents"><pre class="screen">
|
|---|
| 308 | #!/bin/bash
|
|---|
| 309 |
|
|---|
| 310 | IFS="-"
|
|---|
| 311 | RESULT=$(smbstatus -S -u $1 2> /dev/null | awk 'NF \
|
|---|
| 312 | > 6 {print $1}' | sort | uniq -d)
|
|---|
| 313 |
|
|---|
| 314 | if [ "X${RESULT}" == X ]; then
|
|---|
| 315 | exit 0
|
|---|
| 316 | else
|
|---|
| 317 | exit 1
|
|---|
| 318 | fi
|
|---|
| 319 | </pre></div></div><br class="example-break"></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="winbind.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="optional.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="PolicyMgmt.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 24. Winbind: Use of Domain Accounts </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 26. System and Account Policies</td></tr></table></div></body></html>
|
|---|