- Timestamp:
- Mar 1, 2010, 3:05:48 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/docs/htmldocs/Samba3-HOWTO/AccessControls.html
r368 r411 1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 16. File, Directory, and Share Access Controls</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.7 5.2"><link rel="home" href="index.html" title="The Official Samba 3.3.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="prev" href="rights.html" title="Chapter 15. User Rights and Privileges"><link rel="next" href="locking.html" title="Chapter 17. File and Record Locking"></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 16. File, Directory, and Share Access Controls</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="rights.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="locking.html">Next</a></td></tr></table><hr></div><div class="chapter" title="Chapter 16. File, Directory, and Share Access Controls"><div class="titlepage"><div><div><h2 class="title"><a name="AccessControls"></a>Chapter 16. File, Directory, and Share Access Controls</h2></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jeremy</span> <span class="surname">Allison</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jra@samba.org">jra@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="surname">Vernooij</span></h3><span class="contrib">drawing</span> <div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>></code></p></div></div></div></div><div><p class="pubdate">May 10, 2003</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="AccessControls.html#id2616650">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="AccessControls.html#id2616837">File System Access Controls</a></span></dt><dd><dl><dt><span class="sect2"><a href="AccessControls.html#id2616851">MS Windows NTFS Comparison with UNIX File Systems</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2617188">Managing Directories</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2617311">File and Directory Access Control</a></span></dt></dl></dd><dt><span class="sect1"><a href="AccessControls.html#id2617982">Share Definition Access Controls</a></span></dt><dd><dl><dt><span class="sect2"><a href="AccessControls.html#id2618015">User- and Group-Based Controls</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2618383">File and Directory Permissions-Based Controls</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2618720">Miscellaneous Controls</a></span></dt></dl></dd><dt><span class="sect1"><a href="AccessControls.html#id2619058">Access Controls on Shares</a></span></dt><dd><dl><dt><span class="sect2"><a href="AccessControls.html#id2619206">Share Permissions Management</a></span></dt></dl></dd><dt><span class="sect1"><a href="AccessControls.html#id2619552">MS Windows Access Control Lists and UNIX Interoperability</a></span></dt><dd><dl><dt><span class="sect2"><a href="AccessControls.html#id2619559">Managing UNIX Permissions Using NT Security Dialogs</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2619606">Viewing File Security on a Samba Share</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2619677">Viewing File Ownership</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2619821">Viewing File or Directory Permissions</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2620036">Modifying File or Directory Permissions</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2620193">Interaction with the Standard Samba <span class="quote">“<span class="quote">create mask</span>”</span> Parameters</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2620562">Interaction with the Standard Samba File Attribute Mapping</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2620635">Windows NT/200X ACLs and POSIX ACLs Limitations</a></span></dt></dl></dd><dt><span class="sect1"><a href="AccessControls.html#id2621054">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="AccessControls.html#id2621066">Users Cannot Write to a Public Share</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2621388">File Operations Done as <span class="emphasis"><em>root</em></span> with <span class="emphasis"><em>force user</em></span> Set</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2621434">MS Word with Samba Changes Owner of File</a></span></dt></dl></dd></dl></div><p>2 <a class="indexterm" name="id261 6481"></a>3 <a class="indexterm" name="id261 6487"></a>4 <a class="indexterm" name="id261 6494"></a>5 <a class="indexterm" name="id261 6501"></a>1 <html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter 16. File, Directory, and Share Access Controls</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.74.0"><link rel="home" href="index.html" title="The Official Samba 3.3.x HOWTO and Reference Guide"><link rel="up" href="optional.html" title="Part III. Advanced Configuration"><link rel="prev" href="rights.html" title="Chapter 15. User Rights and Privileges"><link rel="next" href="locking.html" title="Chapter 17. File and Record Locking"></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 16. File, Directory, and Share Access Controls</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="rights.html">Prev</a> </td><th width="60%" align="center">Part III. Advanced Configuration</th><td width="20%" align="right"> <a accesskey="n" href="locking.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="AccessControls"></a>Chapter 16. File, Directory, and Share Access Controls</h2></div><div><div class="author"><h3 class="author"><span class="firstname">John</span> <span class="othername">H.</span> <span class="orgname">Samba Team</span> <span class="surname">Terpstra</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jeremy</span> <span class="orgname">Samba Team</span> <span class="surname">Allison</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jra@samba.org">jra@samba.org</a>></code></p></div></div></div></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="othername">R.</span> <span class="orgname">The Samba Team</span> <span class="surname">Vernooij</span></h3><span class="contrib">drawing</span> <div class="affiliation"><span class="orgname">The Samba Team<br></span><div class="address"><p><code class="email"><<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>></code></p></div></div></div></div><div><p class="pubdate">May 10, 2003</p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="AccessControls.html#id2610564">Features and Benefits</a></span></dt><dt><span class="sect1"><a href="AccessControls.html#id2610751">File System Access Controls</a></span></dt><dd><dl><dt><span class="sect2"><a href="AccessControls.html#id2610766">MS Windows NTFS Comparison with UNIX File Systems</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2611102">Managing Directories</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2611225">File and Directory Access Control</a></span></dt></dl></dd><dt><span class="sect1"><a href="AccessControls.html#id2611896">Share Definition Access Controls</a></span></dt><dd><dl><dt><span class="sect2"><a href="AccessControls.html#id2611929">User- and Group-Based Controls</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2612297">File and Directory Permissions-Based Controls</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2612634">Miscellaneous Controls</a></span></dt></dl></dd><dt><span class="sect1"><a href="AccessControls.html#id2612972">Access Controls on Shares</a></span></dt><dd><dl><dt><span class="sect2"><a href="AccessControls.html#id2613120">Share Permissions Management</a></span></dt></dl></dd><dt><span class="sect1"><a href="AccessControls.html#id2613466">MS Windows Access Control Lists and UNIX Interoperability</a></span></dt><dd><dl><dt><span class="sect2"><a href="AccessControls.html#id2613473">Managing UNIX Permissions Using NT Security Dialogs</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2613520">Viewing File Security on a Samba Share</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2613591">Viewing File Ownership</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2613735">Viewing File or Directory Permissions</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2613950">Modifying File or Directory Permissions</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2614107">Interaction with the Standard Samba create mask Parameters</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2614477">Interaction with the Standard Samba File Attribute Mapping</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2614550">Windows NT/200X ACLs and POSIX ACLs Limitations</a></span></dt></dl></dd><dt><span class="sect1"><a href="AccessControls.html#id2614968">Common Errors</a></span></dt><dd><dl><dt><span class="sect2"><a href="AccessControls.html#id2614980">Users Cannot Write to a Public Share</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2615303">File Operations Done as root with force user Set</a></span></dt><dt><span class="sect2"><a href="AccessControls.html#id2615348">MS Word with Samba Changes Owner of File</a></span></dt></dl></dd></dl></div><p> 2 <a class="indexterm" name="id2610395"></a> 3 <a class="indexterm" name="id2610402"></a> 4 <a class="indexterm" name="id2610408"></a> 5 <a class="indexterm" name="id2610415"></a> 6 6 Advanced MS Windows users are frequently perplexed when file, directory, and share manipulation of 7 7 resources shared via Samba do not behave in the manner they might expect. MS Windows network … … 9 9 provide users with the access they need while protecting resources from unauthorized access. 10 10 </p><p> 11 <a class="indexterm" name="id261 6518"></a>12 <a class="indexterm" name="id261 6525"></a>11 <a class="indexterm" name="id2610432"></a> 12 <a class="indexterm" name="id2610439"></a> 13 13 Many UNIX administrators are unfamiliar with the MS Windows environment and in particular 14 14 have difficulty in visualizing what the MS Windows user wishes to achieve in attempts to set file 15 15 and directory access permissions. 16 16 </p><p> 17 <a class="indexterm" name="id261 6539"></a>18 <a class="indexterm" name="id261 6546"></a>19 <a class="indexterm" name="id261 6553"></a>20 <a class="indexterm" name="id261 6560"></a>17 <a class="indexterm" name="id2610453"></a> 18 <a class="indexterm" name="id2610460"></a> 19 <a class="indexterm" name="id2610467"></a> 20 <a class="indexterm" name="id2610474"></a> 21 21 The problem lies in the differences in how file and directory permissions and controls work 22 22 between the two environments. This difference is one that Samba cannot completely hide, even 23 23 though it does try to bridge the chasm to a degree. 24 24 </p><p> 25 <a class="indexterm" name="id261 6573"></a>26 <a class="indexterm" name="id261 6580"></a>27 <a class="indexterm" name="id261 6589"></a>28 <a class="indexterm" name="id261 6596"></a>25 <a class="indexterm" name="id2610487"></a> 26 <a class="indexterm" name="id2610494"></a> 27 <a class="indexterm" name="id2610503"></a> 28 <a class="indexterm" name="id2610510"></a> 29 29 POSIX Access Control List technology has been available (along with extended attributes) 30 30 for UNIX for many years, yet there is little evidence today of any significant use. This … … 33 33 decade-old MS Windows NT operating system. 34 34 </p><p> 35 <a class="indexterm" name="id261 6613"></a>35 <a class="indexterm" name="id2610527"></a> 36 36 The purpose of this chapter is to present each of the points of control that are possible with 37 37 Samba-3 in the hope that this will help the network administrator to find the optimum method 38 38 for delivering the best environment for MS Windows desktop users. 39 39 </p><p> 40 <a class="indexterm" name="id261 6628"></a>41 <a class="indexterm" name="id261 6634"></a>40 <a class="indexterm" name="id2610542"></a> 41 <a class="indexterm" name="id2610549"></a> 42 42 This is an opportune point to mention that Samba was created to provide a means of interoperability 43 43 and interchange of data between differing operating environments. Samba has no intent to change … … 45 45 level of exchange of data between the two environments. What is available today extends well 46 46 beyond early plans and expectations, yet the gap continues to shrink. 47 </p><div class="sect1" title="Features and Benefits"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2616650"></a>Features and Benefits</h2></div></div></div><p>47 </p><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2610564"></a>Features and Benefits</h2></div></div></div><p> 48 48 Samba offers much flexibility in file system access management. These are the key access control 49 49 facilities present in Samba today: 50 </p><div class="itemizedlist" title="Samba Access Control Facilities"><p class="title"><b>Samba Access Control Facilities</b></p><ul class="itemizedlist" type="disc"><li class="listitem"><p>51 <a class="indexterm" name="id261 6671"></a>50 </p><div class="itemizedlist"><p class="title"><b>Samba Access Control Facilities</b></p><ul type="disc"><li><p> 51 <a class="indexterm" name="id2610585"></a> 52 52 <span class="emphasis"><em>UNIX File and Directory Permissions</em></span> 53 53 </p><p> 54 <a class="indexterm" name="id261 6687"></a>55 <a class="indexterm" name="id261 6695"></a>56 <a class="indexterm" name="id261 6702"></a>54 <a class="indexterm" name="id2610602"></a> 55 <a class="indexterm" name="id2610609"></a> 56 <a class="indexterm" name="id2610616"></a> 57 57 Samba honors and implements UNIX file system access controls. Users 58 58 who access a Samba server will do so as a particular MS Windows user. … … 62 62 (files and directories). This chapter provides an overview for those 63 63 to whom the UNIX permissions and controls are a little strange or unknown. 64 </p></li><li class="listitem"><p>64 </p></li><li><p> 65 65 <span class="emphasis"><em>Samba Share Definitions</em></span> 66 66 </p><p> 67 <a class="indexterm" name="id261 6730"></a>67 <a class="indexterm" name="id2610644"></a> 68 68 In configuring share settings and controls in the <code class="filename">smb.conf</code> file, 69 69 the network administrator can exercise overrides to native file … … 72 72 but it is seldom the <span class="emphasis"><em>best</em></span> way to achieve this. 73 73 The basic options and techniques are described herein. 74 </p></li><li class="listitem"><p>74 </p></li><li><p> 75 75 <span class="emphasis"><em>Samba Share ACLs</em></span> 76 <a class="indexterm" name="id261 6761"></a>77 </p><p> 78 <a class="indexterm" name="id261 6774"></a>76 <a class="indexterm" name="id2610676"></a> 77 </p><p> 78 <a class="indexterm" name="id2610688"></a> 79 79 Just as it is possible in MS Windows NT to set ACLs on shares 80 80 themselves, so it is possible to do in Samba. … … 82 82 easiest ways to affect access controls (restrictions) and can often 83 83 do so with minimum invasiveness compared with other methods. 84 </p></li><li class="listitem"><p>85 <a class="indexterm" name="id261 6792"></a>86 <a class="indexterm" name="id261 6801"></a>84 </p></li><li><p> 85 <a class="indexterm" name="id2610706"></a> 86 <a class="indexterm" name="id2610715"></a> 87 87 <span class="emphasis"><em>MS Windows ACLs through UNIX POSIX ACLs</em></span> 88 88 </p><p> 89 <a class="indexterm" name="id261 6817"></a>89 <a class="indexterm" name="id2610731"></a> 90 90 The use of POSIX ACLs on UNIX/Linux is possible only if the underlying 91 91 operating system supports them. If not, then this option will not be … … 95 95 extended attributes enabled. This chapter has pertinent information 96 96 for users of platforms that support them. 97 </p></li></ul></div></div><div class="sect1" title="File System Access Controls"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2616837"></a>File System Access Controls</h2></div></div></div><p>97 </p></li></ul></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2610751"></a>File System Access Controls</h2></div></div></div><p> 98 98 Perhaps the most important recognition to be made is the simple fact that MS Windows NT4/200x/XP 99 99 implement a totally divergent file system technology from what is provided in the UNIX operating system 100 100 environment. First we consider what the most significant differences are, then we look 101 101 at how Samba helps to bridge the differences. 102 </p><div class="sect2" title="MS Windows NTFS Comparison with UNIX File Systems"><div class="titlepage"><div><div><h3 class="title"><a name="id2616851"></a>MS Windows NTFS Comparison with UNIX File Systems</h3></div></div></div><p>103 <a class="indexterm" name="id261 6860"></a>104 <a class="indexterm" name="id261 6867"></a>105 <a class="indexterm" name="id261 6873"></a>106 <a class="indexterm" name="id261 6883"></a>102 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2610766"></a>MS Windows NTFS Comparison with UNIX File Systems</h3></div></div></div><p> 103 <a class="indexterm" name="id2610774"></a> 104 <a class="indexterm" name="id2610781"></a> 105 <a class="indexterm" name="id2610788"></a> 106 <a class="indexterm" name="id2610797"></a> 107 107 Samba operates on top of the UNIX file system. This means it is subject to UNIX file system conventions 108 108 and permissions. It also means that if the MS Windows networking environment requires file system … … 115 115 the depths of control ability should review the <code class="filename">smb.conf</code> man page. 116 116 </p><p>The following compares file system features for UNIX with those of MS Windows NT/200x: 117 <a class="indexterm" name="id261 6918"></a>117 <a class="indexterm" name="id2610832"></a> 118 118 119 119 </p><div class="variablelist"><dl><dt><span class="term">Name Space</span></dt><dd><p> … … 124 124 What MS Windows calls a folder, UNIX calls a directory. 125 125 </p></dd><dt><span class="term">Case Sensitivity</span></dt><dd><p> 126 <a class="indexterm" name="id261 6963"></a>127 <a class="indexterm" name="id261 6970"></a>126 <a class="indexterm" name="id2610877"></a> 127 <a class="indexterm" name="id2610884"></a> 128 128 MS Windows file names are generally uppercase if made up of 8.3 (8-character file name 129 129 and 3 character extension. File names that are longer than 8.3 are case preserving and case … … 152 152 file listing. 153 153 </p></dd><dt><span class="term">Directory Separators</span></dt><dd><p> 154 <a class="indexterm" name="id261 7034"></a>154 <a class="indexterm" name="id2610948"></a> 155 155 MS Windows and DOS use the backslash <code class="constant">\</code> as a directory delimiter, and UNIX uses 156 156 the forward-slash <code class="constant">/</code> as its directory delimiter. This is handled transparently by Samba. 157 157 </p></dd><dt><span class="term">Drive Identification</span></dt><dd><p> 158 <a class="indexterm" name="id261 7062"></a>158 <a class="indexterm" name="id2610976"></a> 159 159 MS Windows products support a notion of drive letters, like <code class="literal">C:</code>, to represent 160 160 disk partitions. UNIX has no concept of separate identifiers for file partitions; each … … 163 163 <code class="constant">C:\</code>. 164 164 </p></dd><dt><span class="term">File Naming Conventions</span></dt><dd><p> 165 <a class="indexterm" name="id261 7099"></a>165 <a class="indexterm" name="id2611013"></a> 166 166 MS Windows generally never experiences file names that begin with a dot (<code class="constant">.</code>), while in UNIX these 167 167 are commonly found in a user's home directory. Files that begin with a dot (<code class="constant">.</code>) are typically … … 169 169 startup configuration data. 170 170 </p></dd><dt><span class="term">Links and Short-Cuts</span></dt><dd><p> 171 <a class="indexterm" name="id261 7129"></a>172 <a class="indexterm" name="id261 7138"></a>173 <a class="indexterm" name="id261 7147"></a>171 <a class="indexterm" name="id2611043"></a> 172 <a class="indexterm" name="id2611052"></a> 173 <a class="indexterm" name="id2611061"></a> 174 174 MS Windows make use of <span class="emphasis"><em>links and shortcuts</em></span> that are actually special types of files that will 175 175 redirect an attempt to execute the file to the real location of the file. UNIX knows of file and directory … … 178 178 Symbolic links are files in UNIX that contain the actual location of the data (file or directory). An 179 179 operation (like read or write) will operate directly on the file referenced. Symbolic links are also 180 referred to as <span class="quote">“<span class="quote">soft links.</span>”</span>A hard link is something that MS Windows is not familiar with. It allows180 referred to as “<span class="quote">soft links.</span>” A hard link is something that MS Windows is not familiar with. It allows 181 181 one physical file to be known simultaneously by more than one file name. 182 182 </p></dd></dl></div><p> … … 184 184 in the process of becoming familiar with UNIX/Linux. These are best left for a text that is dedicated to the 185 185 purpose of UNIX/Linux training and education. 186 </p></div><div class="sect2" title="Managing Directories"><div class="titlepage"><div><div><h3 class="title"><a name="id2617188"></a>Managing Directories</h3></div></div></div><p>187 <a class="indexterm" name="id261 7196"></a>188 <a class="indexterm" name="id261 7203"></a>189 <a class="indexterm" name="id261 7209"></a>186 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2611102"></a>Managing Directories</h3></div></div></div><p> 187 <a class="indexterm" name="id2611110"></a> 188 <a class="indexterm" name="id2611117"></a> 189 <a class="indexterm" name="id2611124"></a> 190 190 There are three basic operations for managing directories: <code class="literal">create</code>, <code class="literal">delete</code>, 191 191 <code class="literal">rename</code>. <a class="link" href="AccessControls.html#TOSH-Accesstbl" title="Table 16.1. Managing Directories with UNIX and Windows">Managing Directories with UNIX and 192 192 Windows</a> compares the commands in Windows and UNIX that implement these operations. 193 </p><div class="table"><a name="TOSH-Accesstbl"></a><p class="title"><b>Table 16.1. Managing Directories with UNIX and Windows</b></p><div class="table-contents"><table summary="Managing Directories with UNIX and Windows" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="center">Action</th><th align="center">MS Windows Command</th><th align="center">UNIX Command</th></tr></thead><tbody><tr><td align="center">create</td><td align="center">md folder</td><td align="center">mkdir folder</td></tr><tr><td align="center">delete</td><td align="center">rd folder</td><td align="center">rmdir folder</td></tr><tr><td align="center">rename</td><td align="center">rename oldname newname</td><td align="center">mv oldname newname</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="File and Directory Access Control"><div class="titlepage"><div><div><h3 class="title"><a name="id2617311"></a>File and Directory Access Control</h3></div></div></div><p>194 <a class="indexterm" name="id261 7319"></a>195 <a class="indexterm" name="id261 7329"></a>196 <a class="indexterm" name="id261 7335"></a>193 </p><div class="table"><a name="TOSH-Accesstbl"></a><p class="title"><b>Table 16.1. Managing Directories with UNIX and Windows</b></p><div class="table-contents"><table summary="Managing Directories with UNIX and Windows" border="1"><colgroup><col><col><col></colgroup><thead><tr><th align="center">Action</th><th align="center">MS Windows Command</th><th align="center">UNIX Command</th></tr></thead><tbody><tr><td align="center">create</td><td align="center">md folder</td><td align="center">mkdir folder</td></tr><tr><td align="center">delete</td><td align="center">rd folder</td><td align="center">rmdir folder</td></tr><tr><td align="center">rename</td><td align="center">rename oldname newname</td><td align="center">mv oldname newname</td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2611225"></a>File and Directory Access Control</h3></div></div></div><p> 194 <a class="indexterm" name="id2611234"></a> 195 <a class="indexterm" name="id2611243"></a> 196 <a class="indexterm" name="id2611250"></a> 197 197 The network administrator is strongly advised to read basic UNIX training manuals and reference materials 198 198 regarding file and directory permissions maintenance. Much can be achieved with the basic UNIX permissions … … 226 226 </p><div class="figure"><a name="access1"></a><p class="title"><b>Figure 16.1. Overview of UNIX permissions field.</b></p><div class="figure-contents"><div class="mediaobject"><img src="images/access1.png" width="216" alt="Overview of UNIX permissions field."></div></div></div><br class="figure-break"><p> 227 227 Any bit flag may be unset. An unset bit flag is the equivalent of "cannot" and is represented 228 as a <span class="quote">“<span class="quote">-</span>”</span>character (see <a class="link" href="AccessControls.html#access2" title="Example 16.1. Example File">“Example File”</a>)229 <a class="indexterm" name="id261 7477"></a>230 <a class="indexterm" name="id261 7484"></a>231 <a class="indexterm" name="id261 7491"></a>232 <a class="indexterm" name="id261 7497"></a>233 <a class="indexterm" name="id261 7504"></a>234 <a class="indexterm" name="id261 7511"></a>228 as a “<span class="quote">-</span>” character (see <a class="link" href="AccessControls.html#access2" title="Example 16.1. Example File">“Example File”</a>) 229 <a class="indexterm" name="id2611391"></a> 230 <a class="indexterm" name="id2611398"></a> 231 <a class="indexterm" name="id2611405"></a> 232 <a class="indexterm" name="id2611412"></a> 233 <a class="indexterm" name="id2611418"></a> 234 <a class="indexterm" name="id2611425"></a> 235 235 </p><div class="example"><a name="access2"></a><p class="title"><b>Example 16.1. Example File</b></p><div class="example-contents"><pre class="programlisting"> 236 236 -rwxr-x--- Means: … … 239 239 ^^^ everyone else cannot do anything with it. 240 240 </pre></div></div><br class="example-break"><p> 241 <a class="indexterm" name="id261 7541"></a>242 <a class="indexterm" name="id261 7547"></a>243 <a class="indexterm" name="id261 7554"></a>244 <a class="indexterm" name="id261 7561"></a>241 <a class="indexterm" name="id2611455"></a> 242 <a class="indexterm" name="id2611462"></a> 243 <a class="indexterm" name="id2611468"></a> 244 <a class="indexterm" name="id2611475"></a> 245 245 Additional possibilities in the [type] field are c = character device, b = block device, p = pipe device, 246 246 s = UNIX Domain Socket. 247 247 </p><p> 248 <a class="indexterm" name="id261 7574"></a>249 <a class="indexterm" name="id261 7580"></a>250 <a class="indexterm" name="id261 7587"></a>251 <a class="indexterm" name="id261 7594"></a>252 <a class="indexterm" name="id261 7601"></a>248 <a class="indexterm" name="id2611488"></a> 249 <a class="indexterm" name="id2611495"></a> 250 <a class="indexterm" name="id2611501"></a> 251 <a class="indexterm" name="id2611508"></a> 252 <a class="indexterm" name="id2611515"></a> 253 253 The letters <code class="constant">rwxXst</code> set permissions for the user, group, and others as read (r), write (w), 254 254 execute (or access for directories) (x), execute only if the file is a directory or already has execute 255 255 permission for some user (X), set user (SUID) or group ID (SGID) on execution (s), sticky (t). 256 256 </p><p> 257 <a class="indexterm" name="id261 7620"></a>258 <a class="indexterm" name="id261 7626"></a>259 <a class="indexterm" name="id261 7633"></a>260 <a class="indexterm" name="id261 7640"></a>257 <a class="indexterm" name="id2611534"></a> 258 <a class="indexterm" name="id2611540"></a> 259 <a class="indexterm" name="id2611547"></a> 260 <a class="indexterm" name="id2611554"></a> 261 261 When the sticky bit is set on a directory, files in that directory may be unlinked (deleted) or renamed only by root or their owner. 262 262 Without the sticky bit, anyone able to write to the directory can delete or rename files. The sticky bit is commonly found on 263 263 directories, such as <code class="filename">/tmp</code>, that are world-writable. 264 264 </p><p> 265 <a class="indexterm" name="id261 7666"></a>266 <a class="indexterm" name="id261 7673"></a>267 <a class="indexterm" name="id261 7680"></a>268 <a class="indexterm" name="id261 7687"></a>269 <a class="indexterm" name="id261 7696"></a>265 <a class="indexterm" name="id2611580"></a> 266 <a class="indexterm" name="id2611587"></a> 267 <a class="indexterm" name="id2611594"></a> 268 <a class="indexterm" name="id2611601"></a> 269 <a class="indexterm" name="id2611610"></a> 270 270 When the set user or group ID bit (s) is set on a directory, then all files created within it will be owned by the user and/or 271 271 group whose `set user or group' bit is set. This can be helpful in setting up directories for which it is desired that … … 277 277 directory but cannot create new files. If files in the directory are set to be readable and writable for the group, then 278 278 group members will be able to write to (or delete) them. 279 </p><div class="sect3" title="Protecting Directories and Files from Deletion"><div class="titlepage"><div><div><h4 class="title"><a name="id2617728"></a>Protecting Directories and Files from Deletion</h4></div></div></div><p>280 <a class="indexterm" name="id261 7736"></a>281 <a class="indexterm" name="id261 7743"></a>282 <a class="indexterm" name="id261 7750"></a>283 <a class="indexterm" name="id261 7757"></a>279 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2611642"></a>Protecting Directories and Files from Deletion</h4></div></div></div><p> 280 <a class="indexterm" name="id2611651"></a> 281 <a class="indexterm" name="id2611658"></a> 282 <a class="indexterm" name="id2611664"></a> 283 <a class="indexterm" name="id2611671"></a> 284 284 People have asked on the Samba mailing list how is it possible to protect files or directories from deletion by users. 285 285 For example, Windows NT/2K/XP provides the capacity to set access controls on a directory into which people can … … 289 289 directory that contains a file and has write permission for it has the capability to delete it. 290 290 </p><p> 291 <a class="indexterm" name="id261 7779"></a>292 <a class="indexterm" name="id261 7786"></a>293 <a class="indexterm" name="id261 7793"></a>291 <a class="indexterm" name="id2611693"></a> 292 <a class="indexterm" name="id2611700"></a> 293 <a class="indexterm" name="id2611707"></a> 294 294 For the record, in the UNIX environment the ability to delete a file is controlled by the permissions on 295 295 the directory that the file is in. In other words, a user can delete a file in a directory to which that 296 296 user has write access, even if that user does not own the file. 297 297 </p><p> 298 <a class="indexterm" name="id261 7808"></a>299 <a class="indexterm" name="id261 7815"></a>300 <a class="indexterm" name="id261 7822"></a>301 <a class="indexterm" name="id261 7828"></a>298 <a class="indexterm" name="id2611722"></a> 299 <a class="indexterm" name="id2611729"></a> 300 <a class="indexterm" name="id2611736"></a> 301 <a class="indexterm" name="id2611742"></a> 302 302 Of necessity, Samba is subject to the file system semantics of the host operating system. Samba is therefore 303 303 limited in the file system capabilities that can be made available through Windows ACLs, and therefore performs … … 306 306 the appropriate extended attribute. 307 307 </p><p> 308 <a class="indexterm" name="id261 7850"></a>309 <a class="indexterm" name="id261 7857"></a>310 <a class="indexterm" name="id261 7864"></a>311 <a class="indexterm" name="id261 7871"></a>308 <a class="indexterm" name="id2611764"></a> 309 <a class="indexterm" name="id2611771"></a> 310 <a class="indexterm" name="id2611778"></a> 311 <a class="indexterm" name="id2611785"></a> 312 312 The specific semantics of the extended attributes are not consistent across UNIX and UNIX-like systems such as Linux. 313 313 For example, it is possible on some implementations of the extended attributes to set a flag that prevents the directory … … 323 323 A simple test can be done to check if the immutible flag is supported on files in the file system of the Samba host 324 324 server. 325 </p><div class="procedure" title="Procedure 16.1. Test for File Immutibility Support"><a name="id2617909"></a><p class="title"><b>Procedure 16.1. Test for File Immutibility Support</b></p><ol class="procedure" type="1"><li class="step" title="Step 1"><p>325 </p><div class="procedure"><a name="id2611823"></a><p class="title"><b>Procedure 16.1. Test for File Immutibility Support</b></p><ol type="1"><li><p> 326 326 Create a file called <code class="filename">filename</code>. 327 </p></li><li class="step" title="Step 2"><p>327 </p></li><li><p> 328 328 Login as the <code class="constant">root</code> user, then set the immutibile flag on a test file as follows: 329 329 </p><pre class="screen"> 330 330 <code class="prompt">root# </code> chattr +i `filename' 331 331 </pre><p> 332 </p></li><li class="step" title="Step 3"><p>332 </p></li><li><p> 333 333 Login as the user who owns the file (not root) and attempt to remove the file as follows: 334 334 </p><pre class="screen"> … … 341 341 immutable directories are writable. If they are not, then the entire directory and its contents will effectively 342 342 be protected from writing (file creation also) and deletion. 343 </p></div></div></div><div class="sect1" title="Share Definition Access Controls"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2617982"></a>Share Definition Access Controls</h2></div></div></div><p>344 <a class="indexterm" name="id261 7990"></a>343 </p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2611896"></a>Share Definition Access Controls</h2></div></div></div><p> 344 <a class="indexterm" name="id2611904"></a> 345 345 The following parameters in the <code class="filename">smb.conf</code> file sections define a share control or affect access controls. 346 346 Before using any of the following options, please refer to the man page for <code class="filename">smb.conf</code>. 347 </p><div class="sect2" title="User- and Group-Based Controls"><div class="titlepage"><div><div><h3 class="title"><a name="id2618015"></a>User- and Group-Based Controls</h3></div></div></div><p>347 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2611929"></a>User- and Group-Based Controls</h3></div></div></div><p> 348 348 User- and group-based controls can prove quite useful. In some situations it is distinctly desirable to 349 349 force all file system operations as if a single user were doing so. The use of the … … 386 386 </p></td></tr><tr><td align="left"><a class="link" href="smb.conf.5.html#WRITELIST" target="_top">write list</a></td><td align="justify"><p> 387 387 List of users that are given read-write access to a service. 388 </p></td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="File and Directory Permissions-Based Controls"><div class="titlepage"><div><div><h3 class="title"><a name="id2618383"></a>File and Directory Permissions-Based Controls</h3></div></div></div><p>388 </p></td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2612297"></a>File and Directory Permissions-Based Controls</h3></div></div></div><p> 389 389 Directory permission-based controls, if misused, can result in considerable difficulty in diagnosing the causes of 390 390 misconfiguration. Use them sparingly and carefully. By gradually introducing each, one at a time, undesirable side … … 417 417 </p></td></tr><tr><td align="left"><a class="link" href="smb.conf.5.html#SECURITYMASK" target="_top">security mask</a></td><td align="justify"><p> 418 418 Controls UNIX permission bits modified when a Windows NT client is manipulating the UNIX permissions on a file. 419 </p></td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" title="Miscellaneous Controls"><div class="titlepage"><div><div><h3 class="title"><a name="id2618720"></a>Miscellaneous Controls</h3></div></div></div><p>419 </p></td></tr></tbody></table></div></div><br class="table-break"></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2612634"></a>Miscellaneous Controls</h3></div></div></div><p> 420 420 The parameters documented in <a class="link" href="AccessControls.html#mcoc" title="Table 16.4. Other Controls">Other Controls</a> are often used by administrators 421 421 in ways that create inadvertent barriers to file access. Such are the consequences of not understanding the … … 450 450 </p></td></tr><tr><td align="justify"><a class="link" href="smb.conf.5.html#VETOFILES" target="_top">veto files</a></td><td align="justify"><p> 451 451 List of files and directories that are neither visible nor accessible. 452 </p></td></tr></tbody></table></div></div><br class="table-break"></div></div><div class="sect1" title="Access Controls on Shares"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2619058"></a>Access Controls on Shares</h2></div></div></div><p>453 <a class="indexterm" name="id261 9066"></a>454 <a class="indexterm" name="id261 9073"></a>455 <a class="indexterm" name="id261 9080"></a>456 <a class="indexterm" name="id261 9087"></a>457 <a class="indexterm" name="id261 9094"></a>452 </p></td></tr></tbody></table></div></div><br class="table-break"></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2612972"></a>Access Controls on Shares</h2></div></div></div><p> 453 <a class="indexterm" name="id2612980"></a> 454 <a class="indexterm" name="id2612987"></a> 455 <a class="indexterm" name="id2612994"></a> 456 <a class="indexterm" name="id2613001"></a> 457 <a class="indexterm" name="id2613008"></a> 458 458 This section deals with how to configure Samba per-share access control restrictions. 459 459 By default, Samba sets no restrictions on the share itself. Restrictions on the share itself … … 462 462 the global user <code class="constant">Everyone - Full Control</code> (full control, change and read). 463 463 </p><p> 464 <a class="indexterm" name="id261 9117"></a>465 <a class="indexterm" name="id261 9124"></a>466 <a class="indexterm" name="id261 9131"></a>464 <a class="indexterm" name="id2613031"></a> 465 <a class="indexterm" name="id2613038"></a> 466 <a class="indexterm" name="id2613045"></a> 467 467 At this time Samba does not provide a tool for configuring access control settings on the share 468 468 itself the only way to create those settings is to use either the NT4 Server Manager or the Windows 200x … … 470 470 this capability in the Samba command-line tool set. 471 471 </p><p> 472 <a class="indexterm" name="id261 9147"></a>473 <a class="indexterm" name="id261 9154"></a>474 <a class="indexterm" name="id261 9161"></a>475 <a class="indexterm" name="id261 9168"></a>472 <a class="indexterm" name="id2613061"></a> 473 <a class="indexterm" name="id2613068"></a> 474 <a class="indexterm" name="id2613075"></a> 475 <a class="indexterm" name="id2613082"></a> 476 476 Samba stores the per-share access control settings in a file called <code class="filename">share_info.tdb</code>. 477 477 The location of this file on your system will depend on how Samba was compiled. The default location … … 479 479 utility has been compiled and installed on your system, then you can examine the contents of this file 480 480 by executing <code class="literal">tdbdump share_info.tdb</code> in the directory containing the tdb files. 481 </p><div class="sect2" title="Share Permissions Management"><div class="titlepage"><div><div><h3 class="title"><a name="id2619206"></a>Share Permissions Management</h3></div></div></div><p>481 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2613120"></a>Share Permissions Management</h3></div></div></div><p> 482 482 The best tool for share permissions management is platform-dependent. Choose the best tool for your environment. 483 </p><div class="sect3" title="Windows NT4 Workstation/Server"><div class="titlepage"><div><div><h4 class="title"><a name="id2619218"></a>Windows NT4 Workstation/Server</h4></div></div></div><p>484 <a class="indexterm" name="id261 9226"></a>485 <a class="indexterm" name="id261 9233"></a>486 <a class="indexterm" name="id261 9240"></a>487 <a class="indexterm" name="id261 9247"></a>483 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2613132"></a>Windows NT4 Workstation/Server</h4></div></div></div><p> 484 <a class="indexterm" name="id2613140"></a> 485 <a class="indexterm" name="id2613147"></a> 486 <a class="indexterm" name="id2613154"></a> 487 <a class="indexterm" name="id2613161"></a> 488 488 The tool you need to manage share permissions on a Samba server from a Windows NT4 Workstation or Server 489 489 is the NT Server Manager. Server Manager is shipped with Windows NT4 Server products but not with Windows 490 490 NT4 Workstation. You can obtain the NT Server Manager for MS Windows NT4 Workstation from the Microsoft 491 491 web site <a class="ulink" href="http://support.microsoft.com/default.aspx?scid=kb;en-us;173673" target="_top">support</a> section. 492 </p><div class="procedure" title="Procedure 16.2. Instructions"><a name="id2619267"></a><p class="title"><b>Procedure 16.2. Instructions</b></p><ol class="procedure" type="1"><li class="step" title="Step 1"><p>492 </p><div class="procedure"><a name="id2613181"></a><p class="title"><b>Procedure 16.2. Instructions</b></p><ol type="1"><li><p> 493 493 Launch the <span class="application">NT4 Server Manager</span> and click on the Samba server you want to 494 494 administer. From the menu select <span class="guimenu">Computer</span>, then click on 495 495 <span class="guimenuitem">Shared Directories</span>. 496 </p></li><li class="step" title="Step 2"><p>496 </p></li><li><p> 497 497 Click on the share that you wish to manage and click the <span class="guilabel">Properties</span> tab, then click 498 498 the <span class="guilabel">Permissions</span> tab. Now you can add or change access control settings as you wish. 499 </p></li></ol></div></div><div class="sect3" title="Windows 200x/XP"><div class="titlepage"><div><div><h4 class="title"><a name="id2619323"></a>Windows 200x/XP</h4></div></div></div><p>500 <a class="indexterm" name="id261 9331"></a>501 <a class="indexterm" name="id261 9338"></a>502 <a class="indexterm" name="id261 9344"></a>503 <a class="indexterm" name="id261 9351"></a>499 </p></li></ol></div></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2613237"></a>Windows 200x/XP</h4></div></div></div><p> 500 <a class="indexterm" name="id2613245"></a> 501 <a class="indexterm" name="id2613252"></a> 502 <a class="indexterm" name="id2613259"></a> 503 <a class="indexterm" name="id2613265"></a> 504 504 On <span class="application">MS Windows NT4/200x/XP</span> systems, ACLs on the share itself are set using 505 505 tools like the MS Explorer. For example, in Windows 200x, right-click on the shared folder, … … 507 507 Windows NT4/200x permissions allow the group "Everyone" full control on the share. 508 508 </p><p> 509 <a class="indexterm" name="id261 9384"></a>510 <a class="indexterm" name="id261 9391"></a>511 <a class="indexterm" name="id261 9398"></a>509 <a class="indexterm" name="id2613298"></a> 510 <a class="indexterm" name="id2613305"></a> 511 <a class="indexterm" name="id2613312"></a> 512 512 MS Windows 200x and later versions come with a tool called the <span class="application">Computer Management</span> 513 513 snap-in for the MMC. This tool can be accessed via <span class="guimenu">Control Panel -> 514 514 Administrative Tools -> Computer Management</span>. 515 </p><div class="procedure" title="Procedure 16.3. Instructions"><a name="id2619421"></a><p class="title"><b>Procedure 16.3. Instructions</b></p><ol class="procedure" type="1"><li class="step" title="Step 1"><p>515 </p><div class="procedure"><a name="id2613336"></a><p class="title"><b>Procedure 16.3. Instructions</b></p><ol type="1"><li><p> 516 516 After launching the MMC with the Computer Management snap-in, click the menu item <span class="guimenuitem">Action</span> 517 517 and select <span class="guilabel">Connect to another computer</span>. If you are not logged onto a domain you will be prompted 518 518 to enter a domain login user identifier and a password. This will authenticate you to the domain. 519 519 If you are already logged in with administrative privilege, this step is not offered. 520 </p></li><li class="step" title="Step 2"><p>520 </p></li><li><p> 521 521 If the Samba server is not shown in the <span class="guilabel">Select Computer</span> box, type in the name of the target 522 522 Samba server in the field <span class="guilabel">Name:</span>. Now click the on <span class="guibutton">[+]</span> next to 523 523 <span class="guilabel">System Tools</span>, then on the <span class="guibutton">[+]</span> next to 524 524 <span class="guilabel">Shared Folders</span> in the left panel. 525 </p></li><li class="step" title="Step 3"><p>526 <a class="indexterm" name="id261 9503"></a>525 </p></li><li><p> 526 <a class="indexterm" name="id2613416"></a> 527 527 In the right panel, double-click on the share on which you wish to set access control permissions. 528 528 Then click the tab <span class="guilabel">Share Permissions</span>. It is now possible to add access control entities 529 529 to the shared folder. Remember to set what type of access (full control, change, read) you 530 530 wish to assign for each entry. 531 </p></li></ol></div><div class="warning" title="Warning"style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p>531 </p></li></ol></div><div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Warning</h3><p> 532 532 Be careful. If you take away all permissions from the <code class="constant">Everyone</code> user without removing 533 533 this user, effectively no user will be able to access the share. This is a result of what is known as … … 535 535 part of the group <code class="constant">Everyone</code> will have no access even if she is given explicit full 536 536 control access. 537 </p></div></div></div></div><div class="sect1" title="MS Windows Access Control Lists and UNIX Interoperability"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2619552"></a>MS Windows Access Control Lists and UNIX Interoperability</h2></div></div></div><div class="sect2" title="Managing UNIX Permissions Using NT Security Dialogs"><div class="titlepage"><div><div><h3 class="title"><a name="id2619559"></a>Managing UNIX Permissions Using NT Security Dialogs</h3></div></div></div><p>538 <a class="indexterm" name="id261 9567"></a>537 </p></div></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2613466"></a>MS Windows Access Control Lists and UNIX Interoperability</h2></div></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2613473"></a>Managing UNIX Permissions Using NT Security Dialogs</h3></div></div></div><p> 538 <a class="indexterm" name="id2613481"></a> 539 539 Windows NT clients can use their native security settings dialog box to view and modify the 540 540 underlying UNIX permissions. … … 545 545 Samba does not attempt to go beyond POSIX ACLs, so the various finer-grained access control 546 546 options provided in Windows are actually ignored. 547 </p><div class="note" title="Note"style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>547 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> 548 548 All access to UNIX/Linux system files via Samba is controlled by the operating system file access controls. 549 549 When trying to figure out file access problems, it is vitally important to find the identity of the Windows 550 550 user as it is presented by Samba at the point of file access. This can best be determined from the 551 551 Samba log files. 552 </p></div></div><div class="sect2" title="Viewing File Security on a Samba Share"><div class="titlepage"><div><div><h3 class="title"><a name="id2619606"></a>Viewing File Security on a Samba Share</h3></div></div></div><p>552 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2613520"></a>Viewing File Security on a Samba Share</h3></div></div></div><p> 553 553 From an NT4/2000/XP client, right-click on any file or directory in a Samba-mounted drive letter 554 554 or UNC path. When the menu pops up, click on the <span class="guilabel">Properties</span> entry at the bottom … … 561 561 nonfunctional with a Samba share at this time, because the only useful button, the <span class="guibutton">Add</span> 562 562 button, will not currently allow a list of users to be seen. 563 </p></div><div class="sect2" title="Viewing File Ownership"><div class="titlepage"><div><div><h3 class="title"><a name="id2619677"></a>Viewing File Ownership</h3></div></div></div><p>563 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2613591"></a>Viewing File Ownership</h3></div></div></div><p> 564 564 Clicking on the <span class="guibutton">Ownership</span> button brings up a dialog box telling you who owns 565 565 the given file. The owner name will be displayed like this: … … 575 575 the file owner will be shown as the NT user <span class="emphasis"><em>Everyone</em></span>. 576 576 </p><p> 577 <a class="indexterm" name="id261 9751"></a>577 <a class="indexterm" name="id2613665"></a> 578 578 The <span class="guibutton">Take Ownership</span> button will not allow you to change the ownership of this file to 579 579 yourself (clicking it will display a dialog box complaining that the user as whom you are currently logged onto … … 583 583 not work with Samba at this time. 584 584 </p><p> 585 <a class="indexterm" name="id261 9780"></a>586 <a class="indexterm" name="id261 9787"></a>587 <a class="indexterm" name="id261 9793"></a>585 <a class="indexterm" name="id2613694"></a> 586 <a class="indexterm" name="id2613701"></a> 587 <a class="indexterm" name="id2613708"></a> 588 588 There is an NT <code class="literal">chown</code> command that will work with Samba and allow a user with administrator 589 589 privilege connected to a Samba server as root to change the ownership of files on both a local NTFS file system 590 590 or remote mounted NTFS or Samba drive. This is available as part of the <span class="application">Seclib</span> NT 591 591 security library written by Jeremy Allison of the Samba Team and is downloadable from the main Samba FTP site. 592 </p></div><div class="sect2" title="Viewing File or Directory Permissions"><div class="titlepage"><div><div><h3 class="title"><a name="id2619821"></a>Viewing File or Directory Permissions</h3></div></div></div><p>592 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2613735"></a>Viewing File or Directory Permissions</h3></div></div></div><p> 593 593 The third button is the <span class="guibutton">Permissions</span> button. Clicking on it brings up a dialog box 594 594 that shows both the permissions and the UNIX owner of the file or directory. The owner is displayed like this: … … 604 604 </p><p> 605 605 The permissions field is displayed differently for files and directories. Both are discussed next. 606 </p><div class="sect3" title="File Permissions"><div class="titlepage"><div><div><h4 class="title"><a name="id2619904"></a>File Permissions</h4></div></div></div><p>606 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2613818"></a>File Permissions</h4></div></div></div><p> 607 607 The standard UNIX user/group/world triplet and the corresponding <code class="constant">read, write, 608 608 execute</code> permissions triplets are mapped by Samba into a three-element NT ACL with the 609 <span class="quote">“<span class="quote">r</span>”</span>, <span class="quote">“<span class="quote">w</span>”</span>, and <span class="quote">“<span class="quote">x</span>”</span>bits mapped into the corresponding NT609 “<span class="quote">r</span>”, “<span class="quote">w</span>”, and “<span class="quote">x</span>” bits mapped into the corresponding NT 610 610 permissions. The UNIX world permissions are mapped into the global NT group <code class="constant">Everyone</code>, followed 611 611 by the list of permissions allowed for the UNIX world. The UNIX owner and group permissions are displayed as an NT … … 622 622 no permissions as having the NT <code class="literal">O</code> bit set. This was chosen, of course, to make it look 623 623 like a zero, meaning zero permissions. More details on the decision behind this action are given below. 624 </p></div><div class="sect3" title="Directory Permissions"><div class="titlepage"><div><div><h4 class="title"><a name="id2619998"></a>Directory Permissions</h4></div></div></div><p>624 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2613912"></a>Directory Permissions</h4></div></div></div><p> 625 625 Directories on an NT NTFS file system have two different sets of permissions. The first set is the ACL set on the 626 626 directory itself, which is usually displayed in the first set of parentheses in the normal <code class="constant">RW</code> … … 633 633 Samba synthesizes these inherited permissions for NT by returning as an NT ACL the UNIX permission mode that a new file 634 634 created by Samba on this share would receive. 635 </p></div></div><div class="sect2" title="Modifying File or Directory Permissions"><div class="titlepage"><div><div><h3 class="title"><a name="id2620036"></a>Modifying File or Directory Permissions</h3></div></div></div><p>635 </p></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2613950"></a>Modifying File or Directory Permissions</h3></div></div></div><p> 636 636 Modifying file and directory permissions is as simple as changing the displayed permissions in the dialog box 637 637 and clicking on <span class="guibutton">OK</span>. However, there are limitations that a user needs to be aware of, … … 654 654 you to add permissions back to a file or directory once you have removed them from a triplet component. 655 655 </p><p> 656 Because UNIX supports only the <span class="quote">“<span class="quote">r</span>”</span>, <span class="quote">“<span class="quote">w</span>”</span>, and <span class="quote">“<span class="quote">x</span>”</span>bits of an NT ACL, if656 Because UNIX supports only the “<span class="quote">r</span>”, “<span class="quote">w</span>”, and “<span class="quote">x</span>” bits of an NT ACL, if 657 657 other NT security attributes such as <code class="constant">Delete Access</code> are selected, they will be ignored 658 658 when applied on the Samba server. … … 666 666 component and click on the <span class="guibutton">Remove</span> button or set the component to only have the special 667 667 <code class="constant">Take Ownership</code> permission (displayed as <code class="literal">O</code>) highlighted. 668 </p></div><div class="sect2" title="Interaction with the Standard Samba “create mask” Parameters"><div class="titlepage"><div><div><h3 class="title"><a name="id2620193"></a>Interaction with the Standard Samba <span class="quote">“<span class="quote">create mask</span>”</span>Parameters</h3></div></div></div><p>There are four parameters that control interaction with the standard Samba <em class="parameter"><code>create mask</code></em> parameters:668 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2614107"></a>Interaction with the Standard Samba “<span class="quote">create mask</span>” Parameters</h3></div></div></div><p>There are four parameters that control interaction with the standard Samba <em class="parameter"><code>create mask</code></em> parameters: 669 669 670 670 671 </p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p><a class="link" href="smb.conf.5.html#SECURITYMASK" target="_top">security mask</a></p></li><li class="listitem"><p><a class="link" href="smb.conf.5.html#FORCESECURITYMODE" target="_top">force security mode</a></p></li><li class="listitem"><p><a class="link" href="smb.conf.5.html#DIRECTORYSECURITYMASK" target="_top">directory security mask</a></p></li><li class="listitem"><p><a class="link" href="smb.conf.5.html#FORCEDIRECTORYSECURITYMODE" target="_top">force directory security mode</a></p></li></ul></div><p>671 </p><div class="itemizedlist"><ul type="disc"><li><p><a class="link" href="smb.conf.5.html#SECURITYMASK" target="_top">security mask</a></p></li><li><p><a class="link" href="smb.conf.5.html#FORCESECURITYMODE" target="_top">force security mode</a></p></li><li><p><a class="link" href="smb.conf.5.html#DIRECTORYSECURITYMASK" target="_top">directory security mask</a></p></li><li><p><a class="link" href="smb.conf.5.html#FORCEDIRECTORYSECURITYMODE" target="_top">force directory security mode</a></p></li></ul></div><p> 672 672 673 673 </p><p> … … 720 720 then set the following parameters in the <code class="filename">smb.conf</code> file in that 721 721 share-specific section: 722 </p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2620514"></a><em class="parameter"><code>security mask = 0777</code></em></td></tr><tr><td><a class="indexterm" name="id2620525"></a><em class="parameter"><code>force security mode = 0</code></em></td></tr><tr><td><a class="indexterm" name="id2620537"></a><em class="parameter"><code>directory security mask = 0777</code></em></td></tr><tr><td><a class="indexterm" name="id2620549"></a><em class="parameter"><code>force directory security mode = 0</code></em></td></tr></table></div><div class="sect2" title="Interaction with the Standard Samba File Attribute Mapping"><div class="titlepage"><div><div><h3 class="title"><a name="id2620562"></a>Interaction with the Standard Samba File Attribute Mapping</h3></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>723 Samba maps some of the DOS attribute bits (such as <span class="quote">“<span class="quote">read-only</span>”</span>)722 </p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2614428"></a><em class="parameter"><code>security mask = 0777</code></em></td></tr><tr><td><a class="indexterm" name="id2614439"></a><em class="parameter"><code>force security mode = 0</code></em></td></tr><tr><td><a class="indexterm" name="id2614451"></a><em class="parameter"><code>directory security mask = 0777</code></em></td></tr><tr><td><a class="indexterm" name="id2614463"></a><em class="parameter"><code>force directory security mode = 0</code></em></td></tr></table></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2614477"></a>Interaction with the Standard Samba File Attribute Mapping</h3></div></div></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> 723 Samba maps some of the DOS attribute bits (such as “<span class="quote">read-only</span>”) 724 724 into the UNIX permissions of a file. This means there can 725 725 be a conflict between the permission bits set via the security … … 727 727 </p></div><p> 728 728 If a file has no UNIX read access for the owner, it will show up 729 as <span class="quote">“<span class="quote">read-only</span>”</span>in the standard file attributes tabbed dialog.729 as “<span class="quote">read-only</span>” in the standard file attributes tabbed dialog. 730 730 Unfortunately, this dialog is the same one that contains the security information 731 731 in another tab. … … 741 741 rather than <span class="guibutton">OK</span> to ensure that your changes 742 742 are not overridden. 743 </p></div><div class="sect2" title="Windows NT/200X ACLs and POSIX ACLs Limitations"><div class="titlepage"><div><div><h3 class="title"><a name="id2620635"></a>Windows NT/200X ACLs and POSIX ACLs Limitations</h3></div></div></div><p>743 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2614550"></a>Windows NT/200X ACLs and POSIX ACLs Limitations</h3></div></div></div><p> 744 744 Windows administrators are familiar with simple ACL controls, and they typically 745 745 consider that UNIX user/group/other (ugo) permissions are inadequate and not … … 769 769 that permit normal ugo and ACLs functionality to be overrided. This further complicates 770 770 the way in which Windows ACLs must be implemented. 771 </p><div class="sect3" title="UNIX POSIX ACL Overview"><div class="titlepage"><div><div><h4 class="title"><a name="id2620699"></a>UNIX POSIX ACL Overview</h4></div></div></div><p>771 </p><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2614613"></a>UNIX POSIX ACL Overview</h4></div></div></div><p> 772 772 In examining POSIX ACLs we must consider the manner in which they operate for 773 773 both files and directories. File ACLs have the following significance: … … 798 798 default:other:--- <-- inherited permissions for everyone (other) 799 799 </pre><p> 800 </p></div><div class="sect3" title="Mapping of Windows File ACLs to UNIX POSIX ACLs"><div class="titlepage"><div><div><h4 class="title"><a name="id2620760"></a>Mapping of Windows File ACLs to UNIX POSIX ACLs</h4></div></div></div><p>800 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2614675"></a>Mapping of Windows File ACLs to UNIX POSIX ACLs</h4></div></div></div><p> 801 801 Microsoft Windows NT4/200X ACLs must of necessity be mapped to POSIX ACLs. 802 802 The mappings for file permissions are shown in <a class="link" href="AccessControls.html#fdsacls" title="Table 16.5. How Windows File ACLs Map to UNIX POSIX File ACLs">How … … 817 817 The Windows administrator is more restricted in that it is not possible from within 818 818 Windows Explorer to remove read permission for the file owner. 819 </p></div><div class="sect3" title="Mapping of Windows Directory ACLs to UNIX POSIX ACLs"><div class="titlepage"><div><div><h4 class="title"><a name="id2621030"></a>Mapping of Windows Directory ACLs to UNIX POSIX ACLs</h4></div></div></div><p>819 </p></div><div class="sect3" lang="en"><div class="titlepage"><div><div><h4 class="title"><a name="id2614944"></a>Mapping of Windows Directory ACLs to UNIX POSIX ACLs</h4></div></div></div><p> 820 820 Interesting things happen in the mapping of UNIX POSIX directory permissions and 821 821 UNIX POSIX ACLs to Windows ACEs (Access Control Entries, the discrete components of … … 825 825 there are some notable exceptions and a few peculiarities that the astute administrator 826 826 will want to take into account in the setting up of directory permissions. 827 </p></div></div></div><div class="sect1" title="Common Errors"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2621054"></a>Common Errors</h2></div></div></div><p>827 </p></div></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2614968"></a>Common Errors</h2></div></div></div><p> 828 828 File, directory, and share access problems are common topics on the mailing list. The following 829 829 are examples recently taken from the mailing list. 830 </p><div class="sect2" title="Users Cannot Write to a Public Share"><div class="titlepage"><div><div><h3 class="title"><a name="id2621066"></a>Users Cannot Write to a Public Share</h3></div></div></div><p>830 </p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2614980"></a>Users Cannot Write to a Public Share</h3></div></div></div><p> 831 831 The following complaint has frequently been voiced on the Samba mailing list: 832 <span class="quote">“<span class="quote">832 “<span class="quote"> 833 833 We are facing some troubles with file/directory permissions. I can log on the domain as admin user (root), 834 834 and there's a public share on which everyone needs to have permission to create/modify files, but only … … 836 836 <strong class="userinput"><code>chgrp -R users *</code></strong> and <strong class="userinput"><code>chown -R nobody *</code></strong> to allow 837 837 other users to change the file. 838 </span>” </span>838 </span>” 839 839 </p><p> 840 840 Here is one way the problem can be solved: 841 </p><div class="procedure"><ol class="procedure" type="1"><li class="step" title="Step 1"><p>841 </p><div class="procedure"><ol type="1"><li><p> 842 842 Go to the top of the directory that is shared. 843 </p></li><li class="step" title="Step 2"><p>843 </p></li><li><p> 844 844 Set the ownership to whatever public user and group you want 845 845 </p><pre class="screen"> … … 849 849 <code class="prompt">$ </code>find `directory_name' -type f -exec chown user:group {}\; 850 850 </pre><p> 851 </p><div class="note" title="Note"style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>851 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p> 852 852 The above will set the <code class="constant">SGID bit</code> on all directories. Read your 853 853 UNIX/Linux man page on what that does. This ensures that all files and directories 854 854 that are created in the directory tree will be owned by the current user and will 855 855 be owned by the group that owns the directory in which it is created. 856 </p></div></li><li class="step" title="Step 3"><p>856 </p></div></li><li><p> 857 857 Directory is <em class="replaceable"><code>/foodbar</code></em>: 858 858 </p><pre class="screen"> 859 859 <code class="prompt">$ </code><strong class="userinput"><code>chown jack:engr /foodbar</code></strong> 860 860 </pre><p> 861 </p><div class="note" title="Note"style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This is the same as doing:</p><pre class="screen">861 </p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This is the same as doing:</p><pre class="screen"> 862 862 <code class="prompt">$ </code><strong class="userinput"><code>chown jack /foodbar</code></strong> 863 863 <code class="prompt">$ </code><strong class="userinput"><code>chgrp engr /foodbar</code></strong> 864 </pre></div></li><li class="step" title="Step 4"><p>Now type:864 </pre></div></li><li><p>Now type: 865 865 866 866 </p><pre class="screen"> … … 872 872 drwxrwsr-x 2 jack engr 48 2003-02-04 09:55 foodbar 873 873 </pre><p> 874 </p></li><li class="step" title="Step 5"><p>Now type:874 </p></li><li><p>Now type: 875 875 </p><pre class="screen"> 876 876 <code class="prompt">$ </code><strong class="userinput"><code>su - jill</code></strong> … … 885 885 -rw-r--r-- 1 jill engr 0 2007-01-18 19:41 Afile 886 886 </pre><p> 887 </p></li><li class="step" title="Step 6"><p>887 </p></li><li><p> 888 888 If the user that must have write permission in the directory is not a member of the group 889 889 <span class="emphasis"><em>engr</em></span> set in the <code class="filename">smb.conf</code> entry for the share: 890 </p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2621373"></a><em class="parameter"><code>force group = engr</code></em></td></tr></table><p>891 </p></li></ol></div></div><div class="sect2" title="File Operations Done as root with force user Set"><div class="titlepage"><div><div><h3 class="title"><a name="id2621388"></a>File Operations Done as <span class="emphasis"><em>root</em></span> with <span class="emphasis"><em>force user</em></span> Set</h3></div></div></div><p>890 </p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2615287"></a><em class="parameter"><code>force group = engr</code></em></td></tr></table><p> 891 </p></li></ol></div></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2615303"></a>File Operations Done as <span class="emphasis"><em>root</em></span> with <span class="emphasis"><em>force user</em></span> Set</h3></div></div></div><p> 892 892 When you have a user in <a class="link" href="smb.conf.5.html#ADMINUSERS" target="_top">admin users</a>, Samba will always do file operations for 893 893 this user as <span class="emphasis"><em>root</em></span>, even if <a class="link" href="smb.conf.5.html#FORCEUSER" target="_top">force user</a> has been set. 894 </p></div><div class="sect2" title="MS Word with Samba Changes Owner of File"><div class="titlepage"><div><div><h3 class="title"><a name="id2621434"></a>MS Word with Samba Changes Owner of File</h3></div></div></div><p>895 <span class="emphasis"><em>Question:</em></span> <span class="quote">“<span class="quote">When user B saves a word document that is owned by user A,896 the updated file is now owned by user B. Why is Samba doing this? How do I fix this?</span>” </span>894 </p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id2615348"></a>MS Word with Samba Changes Owner of File</h3></div></div></div><p> 895 <span class="emphasis"><em>Question:</em></span> “<span class="quote">When user B saves a word document that is owned by user A, 896 the updated file is now owned by user B. Why is Samba doing this? How do I fix this?</span>” 897 897 </p><p> 898 898 <span class="emphasis"><em>Answer:</em></span> Word does the following when you modify/change a Word document: MS Word creates a new document with … … 907 907 be created with the group that owns the directory. In <code class="filename">smb.conf</code> share declaration section set: 908 908 </p><p> 909 </p><table border="0" summary="Simple list" class="simplelist"><tr><td><a class="indexterm" name="id2621513"></a><em class="parameter"><code>force create mode = 0660</code></em></td></tr><tr><td><a class="indexterm" name="id2621525"></a><em class="parameter"><code>force directory mode = 0770</code></em></td></tr></table><p>909 </p><table class="simplelist" border="0" summary="Simple list"><tr><td><a class="indexterm" name="id2615427"></a><em class="parameter"><code>force create mode = 0660</code></em></td></tr><tr><td><a class="indexterm" name="id2615439"></a><em class="parameter"><code>force directory mode = 0770</code></em></td></tr></table><p> 910 910 </p><p> 911 911 These two settings will ensure that all directories and files that get created in the share will be readable/writable by the
Note:
See TracChangeset
for help on using the changeset viewer.