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