4 >UNIX Permission Bits and Windows NT Access Control Lists
</TITLE
7 CONTENT=
"Modular DocBook HTML Stylesheet Version 1.57"></HEAD
22 NAME=
"UNIX-PERMISSIONS"
23 >UNIX Permission Bits and Windows NT Access Control Lists
</A
32 >Viewing and changing UNIX permissions using the NT
36 >New in the Samba
2.0.4 release is the ability for Windows
37 NT clients to use their native security settings dialog box to
38 view and modify the underlying UNIX permissions.
</P
40 >Note that this ability is careful not to compromise
41 the security of the UNIX host Samba is running on, and
42 still obeys all the file permission rules that a Samba
43 administrator can set.
</P
45 >In Samba
2.0.4 and above the default value of the
47 HREF=
"smb.conf.5.html#NTACLSUPPORT"
55 > has been changed from
63 manipulation of permissions is turned on by default.
</P
71 >How to view file security on a Samba share
</A
74 >From an NT
4.0 client, single-click with the right
75 mouse button on any file or directory in a Samba mounted
76 drive letter or UNC path. When the menu pops-up, click
80 > entry at the bottom of
81 the menu. This brings up the normal file properties dialog
82 box, but with Samba
2.0.4 this will have a new tab along the top
86 >. Click on this tab and you
87 will see three buttons,
<I
101 > button will cause either
102 an error message
<SPAN
104 >A requested privilege is not held
106 > to appear if the user is not the
107 NT Administrator, or a dialog which is intended to allow an
108 Administrator to add auditing requirements to a file if the
109 user is logged on as the NT Administrator. This dialog is
110 non-functional with a Samba share at this time, as the only
111 useful button, the
<B
114 > button will not currently
115 allow a list of users to be seen.
</P
123 >Viewing file ownership
</A
130 brings up a dialog box telling you who owns the given file. The
131 owner name will be of the form :
</P
135 >"SERVER\user (Long name)"</B
143 > is the NetBIOS name of
144 the Samba server,
<TT
149 > is the user name of
150 the UNIX user who owns the file, and
<TT
156 is the descriptive string identifying the user (normally found in the
157 GECOS field of the UNIX password database). Click on the
<B
161 > button to remove this dialog.
</P
163 >If the parameter
<TT
172 > then the file owner will
173 be shown as the NT user
<B
181 > button will not allow
182 you to change the ownership of this file to yourself (clicking on
183 it will display a dialog box complaining that the user you are
184 currently logged onto the NT client cannot be found). The reason
185 for this is that changing the ownership of a file is a privileged
186 operation in UNIX, available only to the
<I
190 user. As clicking on this button causes NT to attempt to change
191 the ownership of a file to the current user logged into the NT
192 client this will not work with Samba at this time.
</P
194 >There is an NT chown command that will work with Samba
195 and allow a user with Administrator privilege connected
196 to a Samba
2.0.4 server as root to change the ownership of
197 files on both a local NTFS filesystem or remote mounted NTFS
198 or Samba drive. This is available as part of the
<I
202 > NT security library written by Jeremy Allison of
203 the Samba Team, available from the main Samba ftp site.
</P
211 >Viewing file or directory permissions
</A
214 >The third button is the
<B
218 button. Clicking on this brings up a dialog box that shows both
219 the permissions and the UNIX owner of the file or directory.
220 The owner is displayed in the form :
</P
224 >"SERVER\user (Long name)"</B
232 > is the NetBIOS name of
233 the Samba server,
<TT
238 > is the user name of
239 the UNIX user who owns the file, and
<TT
245 is the descriptive string identifying the user (normally found in the
246 GECOS field of the UNIX password database).
</P
248 >If the parameter
<TT
257 > then the file owner will
258 be shown as the NT user
<B
262 permissions will be shown as NT
"Full Control".
</P
264 >The permissions field is displayed differently for files
265 and directories, so I'll describe the way file permissions
266 are displayed first.
</P
276 >The standard UNIX user/group/world triple and
277 the corresponding
"read",
"write",
"execute" permissions
278 triples are mapped by Samba into a three element NT ACL
279 with the 'r', 'w', and 'x' bits mapped into the corresponding
280 NT permissions. The UNIX world permissions are mapped into
281 the global NT group
<B
285 by the list of permissions allowed for UNIX world. The UNIX
286 owner and group permissions are displayed as an NT
294 > icon respectively followed by the list
295 of permissions allowed for the UNIX user and group.
</P
297 >As many UNIX permission sets don't map into common
308 usually the permissions will be prefixed by the words
<B
310 > "Special Access"</B
311 > in the NT display list.
</P
313 >But what happens if the file has no permissions allowed
314 for a particular UNIX user group or world component ? In order
315 to allow
"no permissions" to be seen and modified then Samba
320 (which has no meaning in UNIX) and reports a component with
321 no permissions as having the NT
<B
325 This was chosen of course to make it look like a zero, meaning
326 zero permissions. More details on the decision behind this will
335 >Directory Permissions
</A
338 >Directories on an NT NTFS file system have two
339 different sets of permissions. The first set of permissions
340 is the ACL set on the directory itself, this is usually displayed
341 in the first set of parentheses in the normal
<B
345 NT style. This first set of permissions is created by Samba in
346 exactly the same way as normal file permissions are, described
347 above, and is displayed in the same way.
</P
349 >The second set of directory permissions has no real meaning
350 in the UNIX permissions world and represents the
<B
353 > permissions that any file created within
354 this directory would inherit.
</P
356 >Samba synthesises these inherited permissions for NT by
357 returning as an NT ACL the UNIX permission mode that a new file
358 created by Samba on this share would receive.
</P
367 >Modifying file or directory permissions
</A
370 >Modifying file and directory permissions is as simple
371 as changing the displayed permissions in the dialog box, and
375 > button. However, there are
376 limitations that a user needs to be aware of, and also interactions
377 with the standard Samba permission masks and mapping of DOS
378 attributes that need to also be taken into account.
</P
380 >If the parameter
<TT
389 > then any attempt to set
390 security permissions will fail with an
<B
396 >The first thing to note is that the
<B
400 button will not return a list of users in Samba
2.0.4 (it will give
401 an error message of
<B
403 >"The remote procedure call failed
404 and did not execute"</B
405 >). This means that you can only
406 manipulate the current user/group/world permissions listed in
407 the dialog box. This actually works quite well as these are the
408 only permissions that UNIX actually has.
</P
410 >If a permission triple (either user, group, or world)
411 is removed from the list of permissions in the NT dialog box,
415 > button is pressed it will
416 be applied as
"no permissions" on the UNIX side. If you then
417 view the permissions again the
"no permissions" entry will appear
421 > flag, as described above. This
422 allows you to add permissions back to a file or directory once
423 you have removed them from a triple component.
</P
425 >As UNIX supports only the
"r",
"w" and
"x" bits of
426 an NT ACL then if other NT security attributes such as
"Delete
427 access" are selected then they will be ignored when applied on
430 >When setting permissions on a directory the second
431 set of permissions (in the second set of parentheses) is
432 by default applied to all files within that directory. If this
433 is not what you want you must uncheck the
<B
436 permissions on existing files"</B
438 dialog before clicking
<B
443 >If you wish to remove all permissions from a
444 user/group/world component then you may either highlight the
445 component and click the
<B
449 or set the component to only have the special
<B
453 > permission (displayed as
<B
465 >Interaction with the standard Samba create mask
469 >Note that with Samba
2.0.5 there are four new parameters
470 to control this interaction. These are :
</P
482 >force security mode
</I
489 >directory security mask
</I
496 >force directory security mode
</I
500 >Once a user clicks
<B
504 permissions Samba maps the given permissions into a user/group/world
505 r/w/x triple set, and then will check the changed permissions for a
506 file against the bits set in the
<A
507 HREF=
"smb.conf.5.html#SECURITYMASK"
516 > parameter. Any bits that
517 were changed that are not set to '
1' in this parameter are left alone
518 in the file permissions.
</P
520 >Essentially, zero bits in the
<TT
526 mask may be treated as a set of bits the user is
<I
530 allowed to change, and one bits are those the user is allowed to change.
533 >If not set explicitly this parameter is set to the same value as
535 HREF=
"smb.conf.5.html#CREATEMASK"
544 > parameter to provide compatibility with Samba
2.0.4
545 where this permission change facility was introduced. To allow a user to
546 modify all the user/group/world permissions on a file, set this parameter
549 >Next Samba checks the changed permissions for a file against
550 the bits set in the
<A
551 HREF=
"smb.conf.5.html#FORCESECURITYMODE"
556 >force security mode
</I
559 > parameter. Any bits
560 that were changed that correspond to bits set to '
1' in this parameter
561 are forced to be set.
</P
563 >Essentially, bits set in the
<TT
569 > parameter may be treated as a set of bits that, when
570 modifying security on a file, the user has always set to be 'on'.
</P
572 >If not set explicitly this parameter is set to the same value
574 HREF=
"smb.conf.5.html#FORCECREATEMODE"
583 > parameter to provide compatibility
584 with Samba
2.0.4 where the permission change facility was introduced.
585 To allow a user to modify all the user/group/world permissions on a file
586 with no restrictions set this parameter to
000.
</P
599 > parameters are applied to the change
600 request in that order.
</P
602 >For a directory Samba will perform the same operations as
603 described above for a file except using the parameter
<TT
606 > directory security mask
</I
617 >force directory security mode
620 > parameter instead of
<TT
631 >directory security mask
</I
634 by default is set to the same value as the
<TT
640 > parameter and the
<TT
643 >force directory security
646 > parameter by default is set to the same value as
650 >force directory mode
</I
652 > parameter to provide
653 compatibility with Samba
2.0.4 where the permission change facility
656 >In this way Samba enforces the permission restrictions that
657 an administrator can set on a Samba share, whilst still allowing users
658 to modify the permission bits within that restriction.
</P
660 >If you want to set up a share that allows users full control
661 in modifying the permission bits on their files and directories and
662 doesn't force any particular bits to be set 'on', then set the following
664 HREF=
"smb.conf.5.html"
671 > file in that share specific section :
</P
676 >security mask =
0777</I
683 >force security mode =
0</I
690 >directory security mask =
0777</I
697 >force directory security mode =
0</I
701 >As described, in Samba
2.0.4 the parameters :
</P
713 >force create mode
</I
727 >force directory mode
</I
731 >were used instead of the parameters discussed here.
</P
739 >Interaction with the standard Samba file attribute
743 >Samba maps some of the DOS attribute bits (such as
"read
744 only") into the UNIX permissions of a file. This means there can
745 be a conflict between the permission bits set via the security
746 dialog and the permission bits set by the file attribute mapping.
749 >One way this can show up is if a file has no UNIX read access
750 for the owner it will show up as
"read only" in the standard
751 file attributes tabbed dialog. Unfortunately this dialog is
752 the same one that contains the security info in another tab.
</P
754 >What this can mean is that if the owner changes the permissions
755 to allow themselves read access using the security dialog, clicks
759 > to get back to the standard attributes tab
760 dialog, and then clicks
<B
763 > on that dialog, then
764 NT will set the file permissions back to read-only (as that is what
765 the attributes still say in the dialog). This means that after setting
766 permissions and clicking
<B
770 attributes dialog you should always hit
<B
777 > to ensure that your changes
778 are not overridden.
</P