1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 >UNIX Permission Bits and Windows NT Access Control Lists</TITLE
8 CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
11 TITLE="SAMBA Project Documentation"
12 HREF="samba-howto-collection.html"><LINK
14 TITLE="Optional configuration"
15 HREF="optional.html"><LINK
17 TITLE="Integrating MS Windows networks with Samba"
18 HREF="integrate-ms-networks.html"><LINK
20 TITLE="Configuring PAM for distributed but centrally
21 managed authentication"
22 HREF="pam.html"></HEAD
33 SUMMARY="Header navigation table"
42 >SAMBA Project Documentation</TH
50 HREF="integrate-ms-networks.html"
77 NAME="UNIX-PERMISSIONS">Chapter 11. UNIX Permission Bits and Windows NT Access Control Lists</H1
83 NAME="AEN1605">11.1. Viewing and changing UNIX permissions using the NT
86 >New in the Samba 2.0.4 release is the ability for Windows
87 NT clients to use their native security settings dialog box to
88 view and modify the underlying UNIX permissions.</P
90 >Note that this ability is careful not to compromise
91 the security of the UNIX host Samba is running on, and
92 still obeys all the file permission rules that a Samba
93 administrator can set.</P
95 >In Samba 2.0.4 and above the default value of the
97 HREF="smb.conf.5.html#NTACLSUPPORT"
105 > has been changed from
113 manipulation of permissions is turned on by default.</P
120 NAME="AEN1614">11.2. How to view file security on a Samba share</H1
122 >From an NT 4.0 client, single-click with the right
123 mouse button on any file or directory in a Samba mounted
124 drive letter or UNC path. When the menu pops-up, click
131 > entry at the bottom of
132 the menu. This brings up the normal file properties dialog
133 box, but with Samba 2.0.4 this will have a new tab along the top
140 >. Click on this tab and you
141 will see three buttons, <SPAN
167 > button will cause either
168 an error message <SPAN
170 >A requested privilege is not held
172 > to appear if the user is not the
173 NT Administrator, or a dialog which is intended to allow an
174 Administrator to add auditing requirements to a file if the
175 user is logged on as the NT Administrator. This dialog is
176 non-functional with a Samba share at this time, as the only
177 useful button, the <B
180 > button will not currently
181 allow a list of users to be seen.</P
188 NAME="AEN1625">11.3. Viewing file ownership</H1
194 brings up a dialog box telling you who owns the given file. The
195 owner name will be of the form :</P
199 >"SERVER\user (Long name)"</B
207 > is the NetBIOS name of
208 the Samba server, <TT
213 > is the user name of
214 the UNIX user who owns the file, and <TT
220 is the descriptive string identifying the user (normally found in the
221 GECOS field of the UNIX password database). Click on the <B
225 > button to remove this dialog.</P
227 >If the parameter <TT
236 > then the file owner will
237 be shown as the NT user <B
245 > button will not allow
246 you to change the ownership of this file to yourself (clicking on
247 it will display a dialog box complaining that the user you are
248 currently logged onto the NT client cannot be found). The reason
249 for this is that changing the ownership of a file is a privileged
250 operation in UNIX, available only to the <SPAN
257 user. As clicking on this button causes NT to attempt to change
258 the ownership of a file to the current user logged into the NT
259 client this will not work with Samba at this time.</P
261 >There is an NT chown command that will work with Samba
262 and allow a user with Administrator privilege connected
263 to a Samba 2.0.4 server as root to change the ownership of
264 files on both a local NTFS filesystem or remote mounted NTFS
265 or Samba drive. This is available as part of the <SPAN
272 > NT security library written by Jeremy Allison of
273 the Samba Team, available from the main Samba ftp site.</P
280 NAME="AEN1645">11.4. Viewing file or directory permissions</H1
282 >The third button is the <B
286 button. Clicking on this brings up a dialog box that shows both
287 the permissions and the UNIX owner of the file or directory.
288 The owner is displayed in the form :</P
292 >"SERVER\user (Long name)"</B
300 > is the NetBIOS name of
301 the Samba server, <TT
306 > is the user name of
307 the UNIX user who owns the file, and <TT
313 is the descriptive string identifying the user (normally found in the
314 GECOS field of the UNIX password database).</P
316 >If the parameter <TT
325 > then the file owner will
326 be shown as the NT user <B
330 permissions will be shown as NT "Full Control".</P
332 >The permissions field is displayed differently for files
333 and directories, so I'll describe the way file permissions
334 are displayed first.</P
340 NAME="AEN1660">11.4.1. File Permissions</H2
342 >The standard UNIX user/group/world triple and
343 the corresponding "read", "write", "execute" permissions
344 triples are mapped by Samba into a three element NT ACL
345 with the 'r', 'w', and 'x' bits mapped into the corresponding
346 NT permissions. The UNIX world permissions are mapped into
347 the global NT group <B
351 by the list of permissions allowed for UNIX world. The UNIX
352 owner and group permissions are displayed as an NT
360 > icon respectively followed by the list
361 of permissions allowed for the UNIX user and group.</P
363 >As many UNIX permission sets don't map into common
374 usually the permissions will be prefixed by the words <B
376 > "Special Access"</B
377 > in the NT display list.</P
379 >But what happens if the file has no permissions allowed
380 for a particular UNIX user group or world component ? In order
381 to allow "no permissions" to be seen and modified then Samba
386 (which has no meaning in UNIX) and reports a component with
387 no permissions as having the NT <B
391 This was chosen of course to make it look like a zero, meaning
392 zero permissions. More details on the decision behind this will
400 NAME="AEN1674">11.4.2. Directory Permissions</H2
402 >Directories on an NT NTFS file system have two
403 different sets of permissions. The first set of permissions
404 is the ACL set on the directory itself, this is usually displayed
405 in the first set of parentheses in the normal <B
409 NT style. This first set of permissions is created by Samba in
410 exactly the same way as normal file permissions are, described
411 above, and is displayed in the same way.</P
413 >The second set of directory permissions has no real meaning
414 in the UNIX permissions world and represents the <B
417 > permissions that any file created within
418 this directory would inherit.</P
420 >Samba synthesises these inherited permissions for NT by
421 returning as an NT ACL the UNIX permission mode that a new file
422 created by Samba on this share would receive.</P
430 NAME="AEN1681">11.5. Modifying file or directory permissions</H1
432 >Modifying file and directory permissions is as simple
433 as changing the displayed permissions in the dialog box, and
437 > button. However, there are
438 limitations that a user needs to be aware of, and also interactions
439 with the standard Samba permission masks and mapping of DOS
440 attributes that need to also be taken into account.</P
442 >If the parameter <TT
451 > then any attempt to set
452 security permissions will fail with an <B
458 >The first thing to note is that the <B
462 button will not return a list of users in Samba 2.0.4 (it will give
463 an error message of <B
465 >"The remote procedure call failed
466 and did not execute"</B
467 >). This means that you can only
468 manipulate the current user/group/world permissions listed in
469 the dialog box. This actually works quite well as these are the
470 only permissions that UNIX actually has.</P
472 >If a permission triple (either user, group, or world)
473 is removed from the list of permissions in the NT dialog box,
477 > button is pressed it will
478 be applied as "no permissions" on the UNIX side. If you then
479 view the permissions again the "no permissions" entry will appear
483 > flag, as described above. This
484 allows you to add permissions back to a file or directory once
485 you have removed them from a triple component.</P
487 >As UNIX supports only the "r", "w" and "x" bits of
488 an NT ACL then if other NT security attributes such as "Delete
489 access" are selected then they will be ignored when applied on
492 >When setting permissions on a directory the second
493 set of permissions (in the second set of parentheses) is
494 by default applied to all files within that directory. If this
495 is not what you want you must uncheck the <B
498 permissions on existing files"</B
500 dialog before clicking <B
505 >If you wish to remove all permissions from a
506 user/group/world component then you may either highlight the
507 component and click the <B
511 or set the component to only have the special <B
515 > permission (displayed as <B
526 NAME="AEN1703">11.6. Interaction with the standard Samba create mask
529 >Note that with Samba 2.0.5 there are four new parameters
530 to control this interaction. These are :</P
542 >force security mode</I
549 >directory security mask</I
556 >force directory security mode</I
560 >Once a user clicks <B
564 permissions Samba maps the given permissions into a user/group/world
565 r/w/x triple set, and then will check the changed permissions for a
566 file against the bits set in the <A
567 HREF="smb.conf.5.html#SECURITYMASK"
576 > parameter. Any bits that
577 were changed that are not set to '1' in this parameter are left alone
578 in the file permissions.</P
580 >Essentially, zero bits in the <TT
586 mask may be treated as a set of bits the user is <SPAN
593 allowed to change, and one bits are those the user is allowed to change.
596 >If not set explicitly this parameter is set to the same value as
598 HREF="smb.conf.5.html#CREATEMASK"
607 > parameter to provide compatibility with Samba 2.0.4
608 where this permission change facility was introduced. To allow a user to
609 modify all the user/group/world permissions on a file, set this parameter
612 >Next Samba checks the changed permissions for a file against
613 the bits set in the <A
614 HREF="smb.conf.5.html#FORCESECURITYMODE"
619 >force security mode</I
622 > parameter. Any bits
623 that were changed that correspond to bits set to '1' in this parameter
624 are forced to be set.</P
626 >Essentially, bits set in the <TT
632 > parameter may be treated as a set of bits that, when
633 modifying security on a file, the user has always set to be 'on'.</P
635 >If not set explicitly this parameter is set to the same value
637 HREF="smb.conf.5.html#FORCECREATEMODE"
646 > parameter to provide compatibility
647 with Samba 2.0.4 where the permission change facility was introduced.
648 To allow a user to modify all the user/group/world permissions on a file
649 with no restrictions set this parameter to 000.</P
662 > parameters are applied to the change
663 request in that order.</P
665 >For a directory Samba will perform the same operations as
666 described above for a file except using the parameter <TT
669 > directory security mask</I
680 >force directory security mode
683 > parameter instead of <TT
694 >directory security mask</I
697 by default is set to the same value as the <TT
703 > parameter and the <TT
706 >force directory security
709 > parameter by default is set to the same value as
713 >force directory mode</I
715 > parameter to provide
716 compatibility with Samba 2.0.4 where the permission change facility
719 >In this way Samba enforces the permission restrictions that
720 an administrator can set on a Samba share, whilst still allowing users
721 to modify the permission bits within that restriction.</P
723 >If you want to set up a share that allows users full control
724 in modifying the permission bits on their files and directories and
725 doesn't force any particular bits to be set 'on', then set the following
727 HREF="smb.conf.5.html"
734 > file in that share specific section :</P
739 >security mask = 0777</I
746 >force security mode = 0</I
753 >directory security mask = 0777</I
760 >force directory security mode = 0</I
764 >As described, in Samba 2.0.4 the parameters :</P
776 >force create mode</I
790 >force directory mode</I
794 >were used instead of the parameters discussed here.</P
801 NAME="AEN1767">11.7. Interaction with the standard Samba file attribute
804 >Samba maps some of the DOS attribute bits (such as "read
805 only") into the UNIX permissions of a file. This means there can
806 be a conflict between the permission bits set via the security
807 dialog and the permission bits set by the file attribute mapping.
810 >One way this can show up is if a file has no UNIX read access
811 for the owner it will show up as "read only" in the standard
812 file attributes tabbed dialog. Unfortunately this dialog is
813 the same one that contains the security info in another tab.</P
815 >What this can mean is that if the owner changes the permissions
816 to allow themselves read access using the security dialog, clicks
820 > to get back to the standard attributes tab
821 dialog, and then clicks <B
824 > on that dialog, then
825 NT will set the file permissions back to read-only (as that is what
826 the attributes still say in the dialog). This means that after setting
827 permissions and clicking <B
831 attributes dialog you should always hit <B
838 > to ensure that your changes
839 are not overridden.</P
847 SUMMARY="Footer navigation table"
858 HREF="integrate-ms-networks.html"
867 HREF="samba-howto-collection.html"
886 >Integrating MS Windows networks with Samba</TD
900 >Configuring PAM for distributed but centrally
901 managed authentication</TD