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.7"><LINK
10 TITLE="SAMBA Project Documentation"
11 HREF="samba-howto-collection.html"><LINK
13 TITLE="Advanced Configuration"
14 HREF="optional.html"><LINK
16 TITLE="System Policies"
17 HREF="advancednetworkmanagement.html"><LINK
19 TITLE="Group mapping HOWTO"
20 HREF="groupmapping.html"></HEAD
31 SUMMARY="Header navigation table"
40 >SAMBA Project Documentation</TH
48 HREF="advancednetworkmanagement.html"
62 HREF="groupmapping.html"
75 NAME="UNIX-PERMISSIONS"
77 >Chapter 11. UNIX Permission Bits and Windows NT Access Control Lists</H1
84 >11.1. Viewing and changing UNIX permissions using the NT
88 >Windows NT clients can use their native security settings
89 dialog box to view and modify the underlying UNIX permissions.</P
91 >Note that this ability is careful not to compromise
92 the security of the UNIX host Samba is running on, and
93 still obeys all the file permission rules that a Samba
94 administrator can set.</P
102 >11.2. How to view file security on a Samba share</A
105 >From an NT4/2000/XP client, single-click with the right
106 mouse button on any file or directory in a Samba mounted
107 drive letter or UNC path. When the menu pops-up, click
114 > entry at the bottom of
115 the menu. This brings up the file properties dialog
116 box. Click on the tab <SPAN
123 will see three buttons, <SPAN
149 > button will cause either
150 an error message <SPAN
152 >A requested privilege is not held
154 > to appear if the user is not the
155 NT Administrator, or a dialog which is intended to allow an
156 Administrator to add auditing requirements to a file if the
157 user is logged on as the NT Administrator. This dialog is
158 non-functional with a Samba share at this time, as the only
159 useful button, the <B
162 > button will not currently
163 allow a list of users to be seen.</P
171 >11.3. Viewing file ownership</A
178 brings up a dialog box telling you who owns the given file. The
179 owner name will be of the form :</P
183 >"SERVER\user (Long name)"</B
189 > is the NetBIOS name of
190 the Samba server, <VAR
193 > is the user name of
194 the UNIX user who owns the file, and <VAR
198 is the descriptive string identifying the user (normally found in the
199 GECOS field of the UNIX password database). Click on the <B
203 > button to remove this dialog.</P
205 >If the parameter <VAR
212 > then the file owner will
213 be shown as the NT user <B
221 > button will not allow
222 you to change the ownership of this file to yourself (clicking on
223 it will display a dialog box complaining that the user you are
224 currently logged onto the NT client cannot be found). The reason
225 for this is that changing the ownership of a file is a privileged
226 operation in UNIX, available only to the <SPAN
233 user. As clicking on this button causes NT to attempt to change
234 the ownership of a file to the current user logged into the NT
235 client this will not work with Samba at this time.</P
237 >There is an NT chown command that will work with Samba
238 and allow a user with Administrator privilege connected
239 to a Samba server as root to change the ownership of
240 files on both a local NTFS filesystem or remote mounted NTFS
241 or Samba drive. This is available as part of the <SPAN
248 > NT security library written by Jeremy Allison of
249 the Samba Team, available from the main Samba ftp site.</P
257 >11.4. Viewing file or directory permissions</A
260 >The third button is the <B
264 button. Clicking on this brings up a dialog box that shows both
265 the permissions and the UNIX owner of the file or directory.
266 The owner is displayed in the form :</P
270 >"SERVER\user (Long name)"</B
276 > is the NetBIOS name of
277 the Samba server, <VAR
280 > is the user name of
281 the UNIX user who owns the file, and <VAR
285 is the descriptive string identifying the user (normally found in the
286 GECOS field of the UNIX password database).</P
288 >If the parameter <VAR
295 > then the file owner will
296 be shown as the NT user <B
300 permissions will be shown as NT "Full Control".</P
302 >The permissions field is displayed differently for files
303 and directories, so I'll describe the way file permissions
304 are displayed first.</P
311 >11.4.1. File Permissions</A
314 >The standard UNIX user/group/world triple and
315 the corresponding "read", "write", "execute" permissions
316 triples are mapped by Samba into a three element NT ACL
317 with the 'r', 'w', and 'x' bits mapped into the corresponding
318 NT permissions. The UNIX world permissions are mapped into
319 the global NT group <B
323 by the list of permissions allowed for UNIX world. The UNIX
324 owner and group permissions are displayed as an NT
332 > icon respectively followed by the list
333 of permissions allowed for the UNIX user and group.</P
335 >As many UNIX permission sets don't map into common
346 usually the permissions will be prefixed by the words <B
348 > "Special Access"</B
349 > in the NT display list.</P
351 >But what happens if the file has no permissions allowed
352 for a particular UNIX user group or world component ? In order
353 to allow "no permissions" to be seen and modified then Samba
358 (which has no meaning in UNIX) and reports a component with
359 no permissions as having the NT <B
363 This was chosen of course to make it look like a zero, meaning
364 zero permissions. More details on the decision behind this will
373 >11.4.2. Directory Permissions</A
376 >Directories on an NT NTFS file system have two
377 different sets of permissions. The first set of permissions
378 is the ACL set on the directory itself, this is usually displayed
379 in the first set of parentheses in the normal <B
383 NT style. This first set of permissions is created by Samba in
384 exactly the same way as normal file permissions are, described
385 above, and is displayed in the same way.</P
387 >The second set of directory permissions has no real meaning
388 in the UNIX permissions world and represents the <B
391 > permissions that any file created within
392 this directory would inherit.</P
394 >Samba synthesises these inherited permissions for NT by
395 returning as an NT ACL the UNIX permission mode that a new file
396 created by Samba on this share would receive.</P
405 >11.5. Modifying file or directory permissions</A
408 >Modifying file and directory permissions is as simple
409 as changing the displayed permissions in the dialog box, and
413 > button. However, there are
414 limitations that a user needs to be aware of, and also interactions
415 with the standard Samba permission masks and mapping of DOS
416 attributes that need to also be taken into account.</P
418 >If the parameter <VAR
425 > then any attempt to set
426 security permissions will fail with an <B
432 >The first thing to note is that the <B
436 button will not return a list of users in Samba (it will give
437 an error message of <B
439 >"The remote procedure call failed
440 and did not execute"</B
441 >). This means that you can only
442 manipulate the current user/group/world permissions listed in
443 the dialog box. This actually works quite well as these are the
444 only permissions that UNIX actually has.</P
446 >If a permission triple (either user, group, or world)
447 is removed from the list of permissions in the NT dialog box,
451 > button is pressed it will
452 be applied as "no permissions" on the UNIX side. If you then
453 view the permissions again the "no permissions" entry will appear
457 > flag, as described above. This
458 allows you to add permissions back to a file or directory once
459 you have removed them from a triple component.</P
461 >As UNIX supports only the "r", "w" and "x" bits of
462 an NT ACL then if other NT security attributes such as "Delete
463 access" are selected then they will be ignored when applied on
466 >When setting permissions on a directory the second
467 set of permissions (in the second set of parentheses) is
468 by default applied to all files within that directory. If this
469 is not what you want you must uncheck the <B
472 permissions on existing files"</B
474 dialog before clicking <B
479 >If you wish to remove all permissions from a
480 user/group/world component then you may either highlight the
481 component and click the <B
485 or set the component to only have the special <B
489 > permission (displayed as <B
501 >11.6. Interaction with the standard Samba create mask
505 >There are four parameters
506 to control interaction with the standard Samba create mask parameters.
516 >force security mode</VAR
521 >directory security mask</VAR
526 >force directory security mode</VAR
529 >Once a user clicks <B
533 permissions Samba maps the given permissions into a user/group/world
534 r/w/x triple set, and then will check the changed permissions for a
535 file against the bits set in the <A
536 HREF="smb.conf.5.html#SECURITYMASK"
543 > parameter. Any bits that
544 were changed that are not set to '1' in this parameter are left alone
545 in the file permissions.</P
547 >Essentially, zero bits in the <VAR
551 mask may be treated as a set of bits the user is <SPAN
558 allowed to change, and one bits are those the user is allowed to change.
561 >If not set explicitly this parameter is set to the same value as
563 HREF="smb.conf.5.html#CREATEMASK"
570 > parameter. To allow a user to modify all the
571 user/group/world permissions on a file, set this parameter
574 >Next Samba checks the changed permissions for a file against
575 the bits set in the <A
576 HREF="smb.conf.5.html#FORCESECURITYMODE"
580 >force security mode</VAR
582 > parameter. Any bits
583 that were changed that correspond to bits set to '1' in this parameter
584 are forced to be set.</P
586 >Essentially, bits set in the <VAR
590 > parameter may be treated as a set of bits that, when
591 modifying security on a file, the user has always set to be 'on'.</P
593 >If not set explicitly this parameter is set to the same value
595 HREF="smb.conf.5.html#FORCECREATEMODE"
603 To allow a user to modify all the user/group/world permissions on a file
604 with no restrictions set this parameter to 000.</P
613 > parameters are applied to the change
614 request in that order.</P
616 >For a directory Samba will perform the same operations as
617 described above for a file except using the parameter <VAR
619 > directory security mask</VAR
626 >force directory security mode
628 > parameter instead of <VAR
636 >directory security mask</VAR
638 by default is set to the same value as the <VAR
642 > parameter and the <VAR
644 >force directory security
646 > parameter by default is set to the same value as
649 >force directory mode</VAR
652 >In this way Samba enforces the permission restrictions that
653 an administrator can set on a Samba share, whilst still allowing users
654 to modify the permission bits within that restriction.</P
656 >If you want to set up a share that allows users full control
657 in modifying the permission bits on their files and directories and
658 doesn't force any particular bits to be set 'on', then set the following
660 HREF="smb.conf.5.html"
667 > file in that share specific section :</P
671 >security mask = 0777</VAR
676 >force security mode = 0</VAR
681 >directory security mask = 0777</VAR
686 >force directory security mode = 0</VAR
695 >11.7. Interaction with the standard Samba file attribute
699 >Samba maps some of the DOS attribute bits (such as "read
700 only") into the UNIX permissions of a file. This means there can
701 be a conflict between the permission bits set via the security
702 dialog and the permission bits set by the file attribute mapping.
705 >One way this can show up is if a file has no UNIX read access
706 for the owner it will show up as "read only" in the standard
707 file attributes tabbed dialog. Unfortunately this dialog is
708 the same one that contains the security info in another tab.</P
710 >What this can mean is that if the owner changes the permissions
711 to allow themselves read access using the security dialog, clicks
715 > to get back to the standard attributes tab
716 dialog, and then clicks <B
719 > on that dialog, then
720 NT will set the file permissions back to read-only (as that is what
721 the attributes still say in the dialog). This means that after setting
722 permissions and clicking <B
726 attributes dialog you should always hit <B
733 > to ensure that your changes
734 are not overridden.</P
742 SUMMARY="Footer navigation table"
753 HREF="advancednetworkmanagement.html"
762 HREF="samba-howto-collection.html"
771 HREF="groupmapping.html"
795 >Group mapping HOWTO</TD