added full netbench simulation in smbtorture. It now reads a 4MB load
[Samba/gbeck.git] / docs / yodldocs / NT_Security.yo
blob598157b3685c1fc1d3ef21b4ed52ecb7f67b0ef5
1 mailto(samba-bugs@samba.org)
3 article(Viewing and changing UNIX permissions using the NT security dialogs in Samba 2.0.4)(Jeremy Allison, Samba Team)(12th April 1999)
5 center(bf(Viewing and changing UNIX permissions using the NT security dialogs))nl()
6 center(bf(-------------------------------------------------------------------))
8 New in the bf(Samba 2.0.4) release is the
9 ability for Windows NT clients to use their native security
10 settings dialog box to view and modify the underlying UNIX
11 permissions.
13 Note that this ability is careful not to compromise the security
14 of the UNIX host Samba is running on, and still obeys all the
15 file permission rules that a Samba administrator can set.
17 In Samba 2.0.4 and above the default value of the parameter
18 url(bf("nt acl support"))(smb.conf.5.html#ntaclsupport) has been
19 changed from "false" to "true", so manipulation of permissions is
20 turned on by default.
22 bf(How to view file security on a Samba share)nl()
23 bf(------------------------------------------)
25 From an NT 4.0 client, single-click with the right mouse button on
26 any file or directory in a Samba mounted drive letter or UNC path.
27 When the menu pops-up, click on the tt(Properties) entry at the 
28 bottom of the menu. This brings up the normal file properties dialog
29 box, but with Samba 2.0.4 this will have a new tab along the top
30 marked tt(Security). Click on this tab and you will see three buttons,
31 em(Permissions), em(Auditing), and em(Ownership). The em(Auditing)
32 button will cause either an error message tt("A requested privilege is
33 not held by the client") to appear if the user is not the NT Administrator,
34 or a dialog which is intended to allow an Administrator to add
35 auditing requirements to a file if the user is logged on as the
36 NT Administrator. This dialog is non-functional with a Samba
37 share at this time, as the only useful button, the tt(Add) button
38 will not currently allow a list of users to be seen.
40 bf(Viewing file ownership)nl()
41 bf(----------------------)
43 Clicking on the tt("Ownership") button brings up a dialog box telling
44 you who owns the given file. The owner name will be of the form :
46 tt("SERVER\user (Long name)")
48 Where tt(SERVER) is the NetBIOS name of the Samba server, tt(user)
49 is the user name of the UNIX user who owns the file, and tt((Long name))
50 is the discriptive string identifying the user (normally found in the
51 GECOS field of the UNIX password database). Click on the tt(Close)
52 button to remove this dialog.
54 If the parameter url(bf("nt acl support"))(smb.conf.5.html#ntaclsupport)
55 is set to "false" then the file owner will be shown as the NT user
56 tt("Everyone").
58 The tt(Take Ownership) button will not allow you to change the
59 ownership of this file to yourself (clicking on it will display a
60 dialog box complaining that the user you are currently logged onto
61 the NT client cannot be found). The reason for this is that changing
62 the ownership of a file is a privilaged operation in UNIX, available
63 only to the em(root) user. As clicking on this button causes NT to
64 attempt to change the ownership of a file to the current user logged
65 into the NT client this will not work with Samba at this time.
67 There is an NT chown command that will work with Samba and allow
68 a user with Administrator privillage connected to a Samba 2.0.4
69 server as root to change the ownership of files on both a local NTFS
70 filesystem or remote mounted NTFS or Samba drive. This is available
71 as part of the bf(Seclib) NT security library written by Jeremy
72 Allison of the Samba Team, available from the main Samba ftp site.
74 bf(Viewing file or directory permissions)nl()
75 bf(-------------------------------------)
77 The third button is the tt("Permissions") button. Clicking on this
78 brings up a dialog box that shows both the permissions and the UNIX
79 owner of the file or directory. The owner is displayed in the form :
81 tt("SERVER\user (Long name)")
83 Where tt(SERVER) is the NetBIOS name of the Samba server, tt(user)
84 is the user name of the UNIX user who owns the file, and tt((Long name))
85 is the discriptive string identifying the user (normally found in the
86 GECOS field of the UNIX password database).
88 If the parameter url(bf("nt acl support"))(smb.conf.5.html#ntaclsupport)
89 is set to "false" then the file owner will be shown as the NT user
90 tt("Everyone") and the permissions will be shown as NT tt("Full Control").
92 The permissions field is displayed differently for files and directories,
93 so I'll describe the way file permissions are displayed first.
95 bf(File Permissions)nl()
96 bf(----------------)
98 The standard UNIX user/group/world triple and the correspinding
99 "read", "write", "execute" permissions triples are mapped by Samba
100 into a three element NT ACL with the 'r', 'w', and 'x' bits mapped
101 into the corresponding NT permissions. The UNIX world permissions are mapped
102 into the global NT group tt(Everyone), followed by the list of permissions
103 allowed for UNIX world. The UNIX owner and group permissions
104 are displayed as an NT tt(user) icon and an NT tt(local group) icon
105 respectively followed by the list of permissions allowed for the
106 UNIX user and group.
108 As many UNIX permission sets don't map into common NT names such as
109 tt("read"), tt("change") or tt("full control") then usually the permissions
110 will be prefixed by the words tt("Special Access") in the NT display 
111 list.
113 But what happens if the file has no permissions allowed for a
114 particular UNIX user group or world component ? In order to 
115 allow "no permissions" to be seen and modified then Samba overloads
116 the NT tt("Take Ownership") ACL attribute (which has no meaning in
117 UNIX) and reports a component with no permissions as having the NT
118 tt("O") bit set. This was chosen of course to make it look like a
119 zero, meaning zero permissions. More details on the decision behind
120 this will be given below.
122 bf(Directory Permissions)nl()
123 bf(---------------------)
125 Directories on an NT NTFS file system have two different sets of
126 permissions. The first set of permissions is the ACL set on the
127 directory itself, this is usually displayed in the first set of
128 parentheses in the normal tt("RW") NT style. This first set of
129 permissions is created by Samba in exactly the same way as normal
130 file permissions are, described above, and is displayed in the
131 same way.
133 The second set of directory permissions has no real meaning in the
134 UNIX permissions world and represents the tt("inherited") permissions
135 that any file created within this directory would inherit.
137 Samba synthesises these inherited permissions for NT by returning as
138 an NT ACL the UNIX permission mode that a new file created by Samba
139 on this share would receive.
141 bf(Modifying file or directory permissions)nl()
142 bf(---------------------------------------)
144 Modifying file and directory permissions is as simple as changing
145 the displayed permissions in the dialog box, and clicking the tt(OK)
146 button. However, there are limitations that a user needs to be aware
147 of, and also interactions with the standard Samba permission masks
148 and mapping of DOS attributes that need to also be taken into account.
150 If the parameter url(bf("nt acl support"))(smb.conf.5.html#ntaclsupport)
151 is set to "false" then any attempt to set security permissions will
152 fail with an tt("Access Denied") message.
154 The first thing to note is that the tt("Add") button will not return
155 a list of users in Samba 2.0.4 (it will give an error message of
156 tt("The remote proceedure call failed and did not execute")). This
157 means that you can only manipulate the current user/group/world
158 permissions listed in the dialog box. This actually works quite well
159 as these are the only permissions that UNIX actually has.
161 If a permission triple (either user, group, or world) is removed from
162 the list of permissions in the NT dialog box, then when the tt("OK")
163 button is pressed it will be applied as "no permissions" on the UNIX
164 side. If you then view the permissions again the "no permissions" entry
165 will appear as the NT tt("O") flag, as described above. This allows you
166 to add permissions back to a file or directory once you have removed
167 them from a triple component.
169 As UNIX supports only the "r", "w" and "x" bits of an NT ACL
170 then if other NT security attributes such as "Delete access"
171 are selected then they will be ignored when applied on the 
172 Samba server.
174 When setting permissions on a directory the second set of permissions
175 (in the second set of parentheses) is by default applied to all
176 files within that directory. If this is not what you want you
177 must uncheck the tt("Replace permissions on existing files") checkbox
178 in the NT dialog before clicking tt("OK").
180 If you wish to remove all permissions from a user/group/world 
181 component then you may either highlight the component and click
182 the tt("Remove") button, or set the component to only have the special
183 tt("Take Ownership") permission (dsplayed as tt("O")) highlighted.
185 bf(Interaction with the standard Samba create mask parameters)nl()
186 bf(----------------------------------------------------------)
188 Once a user clicks tt("OK") to apply the permissions Samba maps
189 the given permissions into a user/group/world r/w/x triple set,
190 and then will mask the requested permissions for a file with
191 the bits set in the url(bf("create mask"))(smb.conf.5.html#createmask)
192 parameter. Samba then adds in the bits set in the url(bf("force create mode"))(smb.conf.5.html#forcecreatemode)
193 parameter. For a directory Samba will mask the requested user/group/world
194 permissions with the bits set in the url(bf("directory mask"))(smb.conf.5.html#directorymask)
195 parameter and then add in the buts set in the url(bf("force directory mode"))(smb.conf.5.html#forcedirectorymode)
196 parameter.
198 In this way Samba enforces the permission restrictions that an administrator
199 can set on a Samba share, whilst still allowing users to modify the
200 permission bits within that restriction.
202 If you want to set up a share that allows users full control
203 over the permission bits on their files then set the following
204 parameters in the url(bf(smb.conf.5))(smb.conf.5.html) file in
205 that share specific section :
207 tt(create mask = 0777)
208 tt(force create mode = 0)
209 tt(directory mask = 0777)
210 tt(force directory mode = 0)
212 bf(Interaction with the standard Samba file attribute mapping)nl()
213 bf(----------------------------------------------------------)
215 Samba maps some of the DOS attribute bits (such as "read only")
216 into the UNIX permissions of a file. This means there can be a
217 conflict between the permission bits set via the security dialog
218 and the permission bits set by the file attribute mapping.
220 One way this can show up is if a file has no UNIX read access
221 for the owner it will show up as "read only" in the standard 
222 file attributes tabbed dialog. Unfortunately this dialog is
223 the same one that contains the security info in another tab.
225 What this can mean is that if the owner changes the permissions
226 to allow themselves read access using the security dialog, clicks
227 tt("OK") to get back to the standard attributes tab dialog, and
228 then clicks tt("OK") on that dialog, then NT will set the file
229 permissions back to read-only (as that is what the attributes
230 still say in the dialog). This means that after setting permissions
231 and clicking tt("OK") to get back to the attributes dialog you
232 should always hit tt("Cancel") rather than tt("OK") to ensure
233 that your changes are not overridden.