a74de94c67928db3bea5ade237dc0c8677bcec35
[samba.git] / docs / textdocs / DOMAIN.txt
1 Contributor:    Samba Team
2 Updated:        June 27, 1997
3
4 Subject:        Network Logons and Roving Profiles
5 ===========================================================================
6
7 A domain and a workgroup are exactly the same thing in terms of network
8 traffic, except for the client logon sequence. Some kind of distributed
9 authentication database is associated with a domain (there are quite a few
10 choices) and this adds so much flexibility that many people think of a
11 domain as a completely different entity to a workgroup. From Samba's 
12 point of view a client connecting to a service presents an authentication
13 token, and it if it is valid they have access. Samba does not care what
14 mechanism was used to generate that token in the first place.
15
16 The SMB client logging on to a domain has an expectation that every other
17 server in the domain should accept the same authentication information.
18 However the network browsing functionality of domains and workgroups is
19 identical and is explained in BROWSING.txt.
20
21 Issues related to the single-logon network model are discussed in this
22 document.  Samba supports domain logons, network logon scripts, and user
23 profiles.  The support is still experimental, but it seems to work.
24
25 The support is also not complete.  Samba does not yet support the sharing
26 of the Windows NT-style SAM database with other systems.  However this is
27 only one way of having a shared user database: exactly the same effect can
28 be achieved by having all servers in a domain share a distributed NIS,
29 Kerberos or other authentication database. These other options may or may
30 not involve changes to the client software, that depends on the combination
31 of client OS, server OS and authentication protocol.
32
33 When an SMB client in a domain wishes to logon it broadcast requests for a
34 logon server.  The first one to reply gets the job, and validates its
35 password using whatever mechanism the Samba administrator has installed.
36 It is possible (but very stupid) to create a domain where the user
37 database is not shared between servers, ie they are effectively workgroup
38 servers advertising themselves as participating in a domain.  This
39 demonstrates how authentication is quite different from but closely
40 involved with domains.
41
42 Another thing commonly associated with single-logon domains is remote
43 administration over the SMB protocol.  Again, there is no reason why this
44 cannot be implemented with an underlying username database which is
45 different from the Windows NT SAM.  Support for the Remote Administration
46 Protocol is planned for a future release of Samba.
47
48 The domain support works for WfWg, and Win95 clients.  Support for Windows
49 NT and OS/2 clients is still being worked on and is still experimental.
50 Support for profiles is confirmed as working for Win95, NT 4.0 and NT 3.51,
51 although NT Workstation requires manual configuration of user accounts with
52 NT's "User Manager for Domains", and no automatic profile location support
53 is available using samba, although it has been confirmed as possible to use
54 an NT server to specify that the location of profiles is on a samba server.
55
56 The help of an NT server can be enlisted, both for profile storage and
57 for user authentication.  For details on user authentication, see
58 security_level.txt.  For details on profile storage, see below.
59
60
61 Using these features you can make your clients verify their logon via
62 the Samba server, make clients run a batch file when they logon to
63 the network and download their preferences, desktop and start menu.
64
65
66 Configuration Instructions:     Network Logons
67 ==========================================
68
69 To use domain logons and profiles you need to do the following:
70
71
72 1) Setup nmbd and smbd by configuring smb.conf so that Samba is
73    acting as the master browser. See <your OS>_INSTALL.txt and BROWSING.txt
74    for details.
75
76 2) Setup a WINS server (see NetBIOS.txt) and configure all your clients
77    to use that WINS service.  [lkcl 12jul97 - problems occur where
78    clients do not pick up the profiles properly unless they are using a
79    WINS server.  this is still under investigation].
80
81 3) Create a share called [netlogon] in your smb.conf. This share should
82    be readable by all users, and probably should not be writeable. This
83    share will hold your network logon scripts, and the CONFIG.POL file
84    (Note: for details on the CONFIG.POL file, how to use it, what it is,
85    refer to the Microsoft Windows NT Administration documentation.
86    The format of these files is not known, so you will need to use
87    Microsoft tools).
88
89 For example I have used:
90
91    [netlogon]
92     path = /data/dos/netlogon
93     writeable = no
94     guest ok = no
95
96 Note that it is important that this share is not writeable by ordinary
97 users, in a secure environment: ordinary users should not be allowed
98 to modify or add files that another user's computer would then download
99 when they log in.
100
101 4) in the [global] section of smb.conf set the following:
102
103    domain logons = yes
104    logon script = %U.bat
105
106 The choice of batch file is, of course, up to you. The above would
107 give each user a separate batch file as the %U will be changed to
108 their username automatically. The other standard % macros may also be
109 used. You can make the batch files come from a subdirectory by using
110 something like:
111
112    logon script = scripts\%U.bat
113
114 5) create the batch files to be run when the user logs in. If the batch
115    file doesn't exist then no batch file will be run. 
116
117 In the batch files you need to be careful to use DOS style cr/lf line
118 endings. If you don't then DOS may get confused. I suggest you use a
119 DOS editor to remotely edit the files if you don't know how to produce
120 DOS style files under unix.
121
122 6) Use smbclient with the -U option for some users to make sure that
123    the \\server\NETLOGON share is available, the batch files are
124    visible and they are readable by the users.
125
126 7) you will probabaly find that your clients automatically mount the
127    \\SERVER\NETLOGON share as drive z: while logging in. You can put
128    some useful programs there to execute from the batch files.
129
130 NOTE: You must be using "security = user" or "security = server" for
131 domain logons to work correctly.  Share level security won't work
132 correctly.
133
134
135
136 Configuration Instructions:     Setting up Roaming User Profiles
137 ================================================================
138
139 In the [global] section of smb.conf set the following (for example):
140
141   logon path = \\profileserver\profileshare\profilepath\%U\moreprofilepath
142
143 The default for this option is \\%L\%U, namely \\sambaserver\username,
144 The \\L%\%U services is created automatically by the [homes] service.
145
146 If you are using a samba server for the profiles, you _must_ make the
147 share specified in the logon path browseable.  Windows 95 appears to
148 check that it can see the share and any subdirectories within that share
149 specified by the logon path option, rather than just connecting straight
150 away.  It also attempts to create the components of the full path for
151 you.  If the creation of any component fails, or if it cannot see any
152 component of the path, the profile creation / reading fails.
153
154
155 Windows 95
156 ----------
157
158 When a user first logs in on Windows 95, the file user.DAT is created,
159 as are folders "Start Menu", "Desktop", "Programs" and "Nethood".  
160 These directories and their contents will be merged with the local
161 versions stored in c:\windows\profiles\username on subsequent logins,
162 taking the most recent from each.  You will need to use the [global]
163 options "preserve case = yes", "short case preserve = yes" and
164 "case sensitive = no" in order to maintain capital letters in shortcuts
165 in any of the profile folders.
166
167 The user.DAT file contains all the user's preferences.  If you wish to
168 enforce a set of preferences, rename their user.DAT file to user.MAN,
169 and deny them write access to this file.
170
171 2) On the Windows 95 machine, go to Control Panel | Passwords and
172    select the User Profiles tab.  Select the required level of
173    roaming preferences.  Press OK, but do _not_ allow the computer
174    to reboot.
175
176 3) On the Windows 95 machine, go to Control Panel | Network |
177    Client for Microsoft Networks | Preferences.  Select 'Log on to
178    NT Domain'.  Then, ensure that the Primary Logon is 'Client for
179    Microsoft Networks'.  Press OK, and this time allow the computer
180    to reboot.
181
182 Under Windows 95, Profiles are downloaded from the Primary Logon.
183 If you have the Primary Logon as 'Client for Novell Networks', then
184 the profiles and logon script will be downloaded from your Novell
185 Server.  If you have the Primary Logon as 'Windows Logon', then the
186 profiles will be loaded from the local machine - a bit against the
187 concept of roaming profiles, if you ask me.
188
189 You will now find that the Microsoft Networks Login box contains
190 [user, password, domain] instead of just [user, password].  Type in
191 the samba server's domain name (or any other domain known to exist,
192 but bear in mind that the user will be authenticated against this
193 domain and profiles downloaded from it, if that domain logon server
194 supports it), user name and user's password.
195
196 Once the user has been successfully validated, the Windows 95 machine
197 will inform you that 'The user has not logged on before' and asks you
198 if you wish to save the user's preferences?  Select 'yes'.
199
200 Once the Windows 95 client comes up with the desktop, you should be able
201 to examine the contents of the directory specified in the "logon path"
202 on the samba server and verify that the "Desktop", "Start Menu",
203 "Programs" and "Nethood" folders have been created.
204
205 These folders will be cached locally on the client, and updated when
206 the user logs off (if you haven't made them read-only by then :-).
207 You will find that if the user creates further folders or short-cuts,
208 that the client will merge the profile contents downloaded with the
209 contents of the profile directory already on the local client, taking
210 the newest folders and short-cuts from each set.
211
212 If you have made the folders / files read-only on the samba server,
213 then you will get errors from the w95 machine on logon and logout, as
214 it attempts to merge the local and the remote profile.  Basically, if
215 you have any errors reported by the w95 machine, check the unix file
216 permissions and ownership rights on the profile directory contents,
217 on the samba server.
218
219
220 If you have problems creating user profiles, you can reset the user's
221 local desktop cache, as shown below.  When this user then next logs in,
222 they will be told that they are logging in "for the first time".
223
224
225 1) instead of logging in under the [user, password, domain] dialog],
226    press escape.
227
228 2) run the regedit.exe program, and look in:
229
230      HKEY_LOCAL_MACHINE\Windows\CurrentVersion\ProfileList
231
232    you will find an entry, for each user, of ProfilePath.  Note the
233    contents of this key (likely to be c:\windows\profiles\username),
234    then delete the key ProfilePath for the required user.
235
236    [Exit the registry editor].
237
238 3) WARNING - before deleting the contents of the directory listed in
239    the ProfilePath (this is likely to be c:\windows\profiles\username),
240    ask them if they have any important files stored on their desktop
241    or in their start menu.  delete the contents of the directory
242    ProfilePath (making a backup if any of the files are needed).
243
244    This will have the effect of removing the local (read-only hidden
245    system file) user.DAT in their profile directory, as well as the
246    local "desktop", "nethood", "start menu" and "programs" folders.
247
248 4) search for the user's .PWL password-cacheing file in the c:\windows
249    directory, and delete it.
250
251 5) log off the windows 95 client.
252
253 6) check the contents of the profile path (see "logon path" described
254    above), and delete the user.DAT or user.MAN file for the user,
255    making a backup if required.  
256
257
258 If all else fails, increase samba's debug log levels to between 3 and 10,
259 and / or run a packet trace program such as tcpdump or netmon.exe, and
260 look for any error reports.
261
262 If you have access to an NT server, then first set up roaming profiles
263 and / or netlogons on the NT server.  Make a packet trace, or examine
264 the example packet traces provided with NT server, and see what the
265 differences are with the equivalent samba trace.
266
267
268 Windows NT Workstation 4.0
269 --------------------------
270
271 When a user first logs in to a Windows NT Workstation, the profile
272 NTuser.MAN is created.  The "User Manager for Domains" can be used
273 to specify the location of the profile.  Samba cannot be a domain
274 logon server for NT, therefore you will need to manually configure
275 each and every account.  [lkcl 10aug97 - i tried setting the path
276 in each account to \\samba-server\homes\profile, and discovered that
277 this fails for some reason.  you have to have \\samba-server\user\profile,
278 where user is the username created from the [homes] share].
279
280 The entry for the NT 4.0 profile is a _directory_ not a file.  The NT
281 help on profiles mentions that a directory is also created with a .PDS
282 extension.  The user, while logging in, must have write permission to
283 create the full profile path (and the folder with the .PDS extension)
284 [lkcl 10aug97 - i found that the creation of the .PDS directory failed,
285 and had to create these manually for each user, with a shell script.
286 also, i presume, but have not tested, that the full profile path must
287 be browseable just as it is for w95, due to the manner in which they
288 attempt to create the full profile path: test existence of each path
289 component; create path component].
290
291 In the profile directory, NT creates more folders than 95.  It creates
292 "Application Data" and others, as well as "Desktop", "Nethood",
293 "Start Menu" and "Programs".  The profile itself is stored in a file
294 NTuser.DAT.  Nothing appears to be stored in the .PDS directory, and
295 its purpose is currently unknown.
296
297 You can use the System Control Panel to copy a local profile onto
298 a samba server (see NT Help on profiles: it is also capable of firing
299 up the correct location in the System Control Panel for you).  The
300 NT Help file also mentions that renaming NTuser.DAT to NTuser.MAN
301 turns a profile into a mandatory one.
302
303 [lkcl 10aug97 - i notice that NT Workstation tells me that it is
304 downloading a profile from a slow link.  whether this is actually the
305 case, or whether there is some configuration issue, as yet unknown,
306 that makes NT Workstation _think_ that the link is a slow one is a
307 matter to be resolved].
308
309 [lkcl 20aug97 - after samba digest correspondance, one user found, and
310 another confirmed, that profiles cannot be loaded from a samba server
311 unless "security = user" and "encrypted passwords = yes" (see the file
312 ENCRYPTION.txt) or "security = server" and "password server = ip.address.
313 of.yourNTserver" are used.  either of these options will allow the NT
314 workstation to access the samba server using LAN manager encrypted
315 passwords, without the user intervention normally required by NT
316 workstation for clear-text passwords].
317
318 [lkcl 25aug97 - more comments received about NT profiles: the case of
319 the profile _matters_.  the file _must_ be called NTuser.DAT or, for
320 a mandatory profile, NTuser.MAN].
321
322
323 Windows NT Server
324 -----------------
325
326 Following the instructions for NT Workstation, there is nothing to stop
327 you specifying any path that you like for the location of users' profiles.
328 Therefore, you could specify that the profile be stored on a samba server,
329 or any other SMB server, as long as that SMB server supports encrypted
330 passwords.
331
332
333
334 Sharing Profiles between W95 and NT Workstation 4.0
335 ---------------------------------------------------
336
337 The default logon path is \\%L\U%.  NT Workstation will attempt to create
338 a directory "\\samba-server\username.PDS" if you specify the logon path
339 as "\\samba-server\username" with the NT User Manager.  Therefore, you
340 will need to specify (for example) "\\samba-server\username\profile".
341 NT 4.0 will attempt to create "\\samba-server\username\profile.PDS", which
342 is more likely to succeed.
343
344 If you then want to share the same Start Menu / Desktop with W95, you will
345 need to specify "logon path = \\samba-server\username\profile" [lkcl 10aug97
346 this has its drawbacks: i created a shortcut to telnet.exe, which attempts
347 to run from the c:\winnt\system32 directory.  this directory is obviously
348 unlikely to exist on a W95 host].
349
350 If you have this set up correctly, you will find separate user.DAT and
351 NTuser.DAT files in the same profile directory.
352
353 [lkcl 25aug97 - there are some issues to resolve with downloading of
354 NT profiles, probably to do with time/date stamps.  i have found that
355 NTuser.DAT is never updated on the workstation after the first time that
356 it is copied to the local workstation profile directory.  this is in
357 contrast to w95, where it _does_ transfer / update profiles correctly].
358