Rebuild docs
[Samba/gebeck_regimport.git] / docs / htmldocs / unix-permissions.html
blobe9a3b5e67119db39e30a139a00ef7d1f18240f83
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 11. UNIX Permission Bits and Windows NT Access Control Lists</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"><link rel="home" href="index.html" title="SAMBA Project Documentation"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="previous" href="passdb.html" title="Chapter 10. User information database"><link rel="next" href="groupmapping.html" title="Chapter 12. Configuring Group Mapping"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 11. UNIX Permission Bits and Windows NT Access Control Lists</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="passdb.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="groupmapping.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><h2 class="title"><a name="unix-permissions"></a>Chapter 11. UNIX Permission Bits and Windows NT Access Control Lists</h2></div><div><div class="author"><h3 class="author">Jeremy Allison</h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><tt>&lt;<a href="mailto:jra@samba.org">jra@samba.org</a>&gt;</tt></p></div></div></div></div><div><p class="pubdate">12 Apr 1999</p></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><a href="unix-permissions.html#id2881950">Viewing and changing UNIX permissions using the NT
3 security dialogs</a></dt><dt><a href="unix-permissions.html#id2881832">How to view file security on a Samba share</a></dt><dt><a href="unix-permissions.html#id2885176">Viewing file ownership</a></dt><dt><a href="unix-permissions.html#id2885297">Viewing file or directory permissions</a></dt><dd><dl><dt><a href="unix-permissions.html#id2885379">File Permissions</a></dt><dt><a href="unix-permissions.html#id2885483">Directory Permissions</a></dt></dl></dd><dt><a href="unix-permissions.html#id2885533">Modifying file or directory permissions</a></dt><dt><a href="unix-permissions.html#id2885693">Interaction with the standard Samba create mask
4 parameters</a></dt><dt><a href="unix-permissions.html#id2886008">Interaction with the standard Samba file attribute
5 mapping</a></dt></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2881950"></a>Viewing and changing UNIX permissions using the NT
6 security dialogs</h2></div></div><p>Windows NT clients can use their native security settings
7 dialog box to view and modify the underlying UNIX permissions.</p><p>Note that this ability is careful not to compromise
8 the security of the UNIX host Samba is running on, and
9 still obeys all the file permission rules that a Samba
10 administrator can set.</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>
11 All access to Unix/Linux system file via Samba is controlled at
12 the operating system file access control level. When trying to
13 figure out file access problems it is vitally important to identify
14 the identity of the Windows user as it is presented by Samba at
15 the point of file access. This can best be determined from the
16 Samba log files.
17 </p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2881832"></a>How to view file security on a Samba share</h2></div></div><p>From an NT4/2000/XP client, single-click with the right
18 mouse button on any file or directory in a Samba mounted
19 drive letter or UNC path. When the menu pops-up, click
20 on the <span class="emphasis"><em>Properties</em></span> entry at the bottom of
21 the menu. This brings up the file properties dialog
22 box. Click on the tab <span class="emphasis"><em>Security</em></span> and you
23 will see three buttons, <span class="emphasis"><em>Permissions</em></span>,
24 <span class="emphasis"><em>Auditing</em></span>, and <span class="emphasis"><em>Ownership</em></span>.
25 The <span class="emphasis"><em>Auditing</em></span> button will cause either
26 an error message A requested privilege is not held
27 by the client to appear if the user is not the
28 NT Administrator, or a dialog which is intended to allow an
29 Administrator to add auditing requirements to a file if the
30 user is logged on as the NT Administrator. This dialog is
31 non-functional with a Samba share at this time, as the only
32 useful button, the <b>Add</b> button will not currently
33 allow a list of users to be seen.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2885176"></a>Viewing file ownership</h2></div></div><p>Clicking on the <b>&quot;Ownership&quot;</b> button
34 brings up a dialog box telling you who owns the given file. The
35 owner name will be of the form :</p><p><b>&quot;SERVER\user (Long name)&quot;</b></p><p>Where <i><tt>SERVER</tt></i> is the NetBIOS name of
36 the Samba server, <i><tt>user</tt></i> is the user name of
37 the UNIX user who owns the file, and <i><tt>(Long name)</tt></i>
38 is the descriptive string identifying the user (normally found in the
39 GECOS field of the UNIX password database). Click on the <b>Close
40 </b> button to remove this dialog.</p><p>If the parameter <i><tt>nt acl support</tt></i>
41 is set to <tt>false</tt> then the file owner will
42 be shown as the NT user <b>&quot;Everyone&quot;</b>.</p><p>The <b>Take Ownership</b> button will not allow
43 you to change the ownership of this file to yourself (clicking on
44 it will display a dialog box complaining that the user you are
45 currently logged onto the NT client cannot be found). The reason
46 for this is that changing the ownership of a file is a privileged
47 operation in UNIX, available only to the <span class="emphasis"><em>root</em></span>
48 user. As clicking on this button causes NT to attempt to change
49 the ownership of a file to the current user logged into the NT
50 client this will not work with Samba at this time.</p><p>There is an NT chown command that will work with Samba
51 and allow a user with Administrator privilege connected
52 to a Samba server as root to change the ownership of
53 files on both a local NTFS filesystem or remote mounted NTFS
54 or Samba drive. This is available as part of the <span class="emphasis"><em>Seclib
55 </em></span> NT security library written by Jeremy Allison of
56 the Samba Team, available from the main Samba ftp site.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2885297"></a>Viewing file or directory permissions</h2></div></div><p>The third button is the <b>&quot;Permissions&quot;</b>
57 button. Clicking on this brings up a dialog box that shows both
58 the permissions and the UNIX owner of the file or directory.
59 The owner is displayed in the form :</p><p><b>&quot;SERVER\user (Long name)&quot;</b></p><p>Where <i><tt>SERVER</tt></i> is the NetBIOS name of
60 the Samba server, <i><tt>user</tt></i> is the user name of
61 the UNIX user who owns the file, and <i><tt>(Long name)</tt></i>
62 is the descriptive string identifying the user (normally found in the
63 GECOS field of the UNIX password database).</p><p>If the parameter <i><tt>nt acl support</tt></i>
64 is set to <tt>false</tt> then the file owner will
65 be shown as the NT user <b>&quot;Everyone&quot;</b> and the
66 permissions will be shown as NT &quot;Full Control&quot;.</p><p>The permissions field is displayed differently for files
67 and directories, so I'll describe the way file permissions
68 are displayed first.</p><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2885379"></a>File Permissions</h3></div></div><p>The standard UNIX user/group/world triple and
69 the corresponding &quot;read&quot;, &quot;write&quot;, &quot;execute&quot; permissions
70 triples are mapped by Samba into a three element NT ACL
71 with the 'r', 'w', and 'x' bits mapped into the corresponding
72 NT permissions. The UNIX world permissions are mapped into
73 the global NT group <b>Everyone</b>, followed
74 by the list of permissions allowed for UNIX world. The UNIX
75 owner and group permissions are displayed as an NT
76 <b>user</b> icon and an NT <b>local
77 group</b> icon respectively followed by the list
78 of permissions allowed for the UNIX user and group.</p><p>As many UNIX permission sets don't map into common
79 NT names such as <b>&quot;read&quot;</b>, <b>
80 &quot;change&quot;</b> or <b>&quot;full control&quot;</b> then
81 usually the permissions will be prefixed by the words <b>
82 &quot;Special Access&quot;</b> in the NT display list.</p><p>But what happens if the file has no permissions allowed
83 for a particular UNIX user group or world component ? In order
84 to allow &quot;no permissions&quot; to be seen and modified then Samba
85 overloads the NT <b>&quot;Take Ownership&quot;</b> ACL attribute
86 (which has no meaning in UNIX) and reports a component with
87 no permissions as having the NT <b>&quot;O&quot;</b> bit set.
88 This was chosen of course to make it look like a zero, meaning
89 zero permissions. More details on the decision behind this will
90 be given below.</p></div><div class="sect2" lang="en"><div class="titlepage"><div><h3 class="title"><a name="id2885483"></a>Directory Permissions</h3></div></div><p>Directories on an NT NTFS file system have two
91 different sets of permissions. The first set of permissions
92 is the ACL set on the directory itself, this is usually displayed
93 in the first set of parentheses in the normal <b>&quot;RW&quot;</b>
94 NT style. This first set of permissions is created by Samba in
95 exactly the same way as normal file permissions are, described
96 above, and is displayed in the same way.</p><p>The second set of directory permissions has no real meaning
97 in the UNIX permissions world and represents the <b>
98 &quot;inherited&quot;</b> permissions that any file created within
99 this directory would inherit.</p><p>Samba synthesises these inherited permissions for NT by
100 returning as an NT ACL the UNIX permission mode that a new file
101 created by Samba on this share would receive.</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2885533"></a>Modifying file or directory permissions</h2></div></div><p>Modifying file and directory permissions is as simple
102 as changing the displayed permissions in the dialog box, and
103 clicking the <b>OK</b> button. However, there are
104 limitations that a user needs to be aware of, and also interactions
105 with the standard Samba permission masks and mapping of DOS
106 attributes that need to also be taken into account.</p><p>If the parameter <i><tt>nt acl support</tt></i>
107 is set to <tt>false</tt> then any attempt to set
108 security permissions will fail with an <b>&quot;Access Denied&quot;
109 </b> message.</p><p>The first thing to note is that the <b>&quot;Add&quot;</b>
110 button will not return a list of users in Samba (it will give
111 an error message of <b>&quot;The remote procedure call failed
112 and did not execute&quot;</b>). This means that you can only
113 manipulate the current user/group/world permissions listed in
114 the dialog box. This actually works quite well as these are the
115 only permissions that UNIX actually has.</p><p>If a permission triple (either user, group, or world)
116 is removed from the list of permissions in the NT dialog box,
117 then when the <b>&quot;OK&quot;</b> button is pressed it will
118 be applied as &quot;no permissions&quot; on the UNIX side. If you then
119 view the permissions again the &quot;no permissions&quot; entry will appear
120 as the NT <b>&quot;O&quot;</b> flag, as described above. This
121 allows you to add permissions back to a file or directory once
122 you have removed them from a triple component.</p><p>As UNIX supports only the &quot;r&quot;, &quot;w&quot; and &quot;x&quot; bits of
123 an NT ACL then if other NT security attributes such as &quot;Delete
124 access&quot; are selected then they will be ignored when applied on
125 the Samba server.</p><p>When setting permissions on a directory the second
126 set of permissions (in the second set of parentheses) is
127 by default applied to all files within that directory. If this
128 is not what you want you must uncheck the <b>&quot;Replace
129 permissions on existing files&quot;</b> checkbox in the NT
130 dialog before clicking <b>&quot;OK&quot;</b>.</p><p>If you wish to remove all permissions from a
131 user/group/world component then you may either highlight the
132 component and click the <b>&quot;Remove&quot;</b> button,
133 or set the component to only have the special <b>&quot;Take
134 Ownership&quot;</b> permission (displayed as <b>&quot;O&quot;
135 </b>) highlighted.</p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2885693"></a>Interaction with the standard Samba create mask
136 parameters</h2></div></div><p>There are four parameters
137 to control interaction with the standard Samba create mask parameters.
138 These are :</p><p><i><tt>security mask</tt></i></p><p><i><tt>force security mode</tt></i></p><p><i><tt>directory security mask</tt></i></p><p><i><tt>force directory security mode</tt></i></p><p>Once a user clicks <b>&quot;OK&quot;</b> to apply the
139 permissions Samba maps the given permissions into a user/group/world
140 r/w/x triple set, and then will check the changed permissions for a
141 file against the bits set in the <a href="smb.conf.5.html#SECURITYMASK" target="_top">
142 <i><tt>security mask</tt></i></a> parameter. Any bits that
143 were changed that are not set to '1' in this parameter are left alone
144 in the file permissions.</p><p>Essentially, zero bits in the <i><tt>security mask</tt></i>
145 mask may be treated as a set of bits the user is <span class="emphasis"><em>not</em></span>
146 allowed to change, and one bits are those the user is allowed to change.
147 </p><p>If not set explicitly this parameter is set to the same value as
148 the <a href="smb.conf.5.html#CREATEMASK" target="_top"><i><tt>create mask
149 </tt></i></a> parameter. To allow a user to modify all the
150 user/group/world permissions on a file, set this parameter
151 to 0777.</p><p>Next Samba checks the changed permissions for a file against
152 the bits set in the <a href="smb.conf.5.html#FORCESECURITYMODE" target="_top">
153 <i><tt>force security mode</tt></i></a> parameter. Any bits
154 that were changed that correspond to bits set to '1' in this parameter
155 are forced to be set.</p><p>Essentially, bits set in the <i><tt>force security mode
156 </tt></i> parameter may be treated as a set of bits that, when
157 modifying security on a file, the user has always set to be 'on'.</p><p>If not set explicitly this parameter is set to the same value
158 as the <a href="smb.conf.5.html#FORCECREATEMODE" target="_top"><i><tt>force
159 create mode</tt></i></a> parameter.
160 To allow a user to modify all the user/group/world permissions on a file
161 with no restrictions set this parameter to 000.</p><p>The <i><tt>security mask</tt></i> and <i><tt>force
162 security mode</tt></i> parameters are applied to the change
163 request in that order.</p><p>For a directory Samba will perform the same operations as
164 described above for a file except using the parameter <i><tt>
165 directory security mask</tt></i> instead of <i><tt>security
166 mask</tt></i>, and <i><tt>force directory security mode
167 </tt></i> parameter instead of <i><tt>force security mode
168 </tt></i>.</p><p>The <i><tt>directory security mask</tt></i> parameter
169 by default is set to the same value as the <i><tt>directory mask
170 </tt></i> parameter and the <i><tt>force directory security
171 mode</tt></i> parameter by default is set to the same value as
172 the <i><tt>force directory mode</tt></i> parameter. </p><p>In this way Samba enforces the permission restrictions that
173 an administrator can set on a Samba share, whilst still allowing users
174 to modify the permission bits within that restriction.</p><p>If you want to set up a share that allows users full control
175 in modifying the permission bits on their files and directories and
176 doesn't force any particular bits to be set 'on', then set the following
177 parameters in the <tt>smb.conf</tt> file in that share specific section :</p><p><i><tt>security mask = 0777</tt></i></p><p><i><tt>force security mode = 0</tt></i></p><p><i><tt>directory security mask = 0777</tt></i></p><p><i><tt>force directory security mode = 0</tt></i></p></div><div class="sect1" lang="en"><div class="titlepage"><div><h2 class="title" style="clear: both"><a name="id2886008"></a>Interaction with the standard Samba file attribute
178 mapping</h2></div></div><p>Samba maps some of the DOS attribute bits (such as &quot;read
179 only&quot;) into the UNIX permissions of a file. This means there can
180 be a conflict between the permission bits set via the security
181 dialog and the permission bits set by the file attribute mapping.
182 </p><p>One way this can show up is if a file has no UNIX read access
183 for the owner it will show up as &quot;read only&quot; in the standard
184 file attributes tabbed dialog. Unfortunately this dialog is
185 the same one that contains the security info in another tab.</p><p>What this can mean is that if the owner changes the permissions
186 to allow themselves read access using the security dialog, clicks
187 <b>&quot;OK&quot;</b> to get back to the standard attributes tab
188 dialog, and then clicks <b>&quot;OK&quot;</b> on that dialog, then
189 NT will set the file permissions back to read-only (as that is what
190 the attributes still say in the dialog). This means that after setting
191 permissions and clicking <b>&quot;OK&quot;</b> to get back to the
192 attributes dialog you should always hit <b>&quot;Cancel&quot;</b>
193 rather than <b>&quot;OK&quot;</b> to ensure that your changes
194 are not overridden.</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="passdb.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="optional.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="groupmapping.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 10. User information database </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 12. Configuring Group Mapping</td></tr></table></div></body></html>