Ignore:
Timestamp:
Mar 1, 2010, 3:05:48 PM (15 years ago)
Author:
Herwig Bauernfeind
Message:

Update Samba 3.3.x to 3.3.11

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.75.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">&lt;<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>&gt;</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">&lt;<a class="email" href="mailto:jra@samba.org">jra@samba.org</a>&gt;</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">&lt;<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</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">&#8220;<span class="quote">create mask</span>&#8221;</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="id2616481"></a>
    3 <a class="indexterm" name="id2616487"></a>
    4 <a class="indexterm" name="id2616494"></a>
    5 <a class="indexterm" name="id2616501"></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">&lt;<a class="email" href="mailto:jht@samba.org">jht@samba.org</a>&gt;</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">&lt;<a class="email" href="mailto:jra@samba.org">jra@samba.org</a>&gt;</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">&lt;<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</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>
    66Advanced MS Windows users are frequently perplexed when file, directory, and share manipulation of
    77resources shared via Samba do not behave in the manner they might expect. MS Windows network
     
    99provide users with the access they need while protecting resources from unauthorized access.
    1010</p><p>
    11 <a class="indexterm" name="id2616518"></a>
    12 <a class="indexterm" name="id2616525"></a>
     11<a class="indexterm" name="id2610432"></a>
     12<a class="indexterm" name="id2610439"></a>
    1313Many UNIX administrators are unfamiliar with the MS Windows environment and in particular
    1414have difficulty in visualizing what the MS Windows user wishes to achieve in attempts to set file
    1515and directory access permissions.
    1616</p><p>
    17 <a class="indexterm" name="id2616539"></a>
    18 <a class="indexterm" name="id2616546"></a>
    19 <a class="indexterm" name="id2616553"></a>
    20 <a class="indexterm" name="id2616560"></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>
    2121The problem lies in the differences in how file and directory permissions and controls work
    2222between the two environments. This difference is one that Samba cannot completely hide, even
    2323though it does try to bridge the chasm to a degree.
    2424</p><p>
    25 <a class="indexterm" name="id2616573"></a>
    26 <a class="indexterm" name="id2616580"></a>
    27 <a class="indexterm" name="id2616589"></a>
    28 <a class="indexterm" name="id2616596"></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>
    2929POSIX Access Control List technology has been available (along with extended attributes)
    3030for UNIX for many years, yet there is little evidence today of any significant use. This
     
    3333decade-old MS Windows NT operating system.
    3434</p><p>
    35 <a class="indexterm" name="id2616613"></a>
     35<a class="indexterm" name="id2610527"></a>
    3636The purpose of this chapter is to present each of the points of control that are possible with
    3737Samba-3 in the hope that this will help the network administrator to find the optimum method
    3838for delivering the best environment for MS Windows desktop users.
    3939</p><p>
    40 <a class="indexterm" name="id2616628"></a>
    41 <a class="indexterm" name="id2616634"></a>
     40<a class="indexterm" name="id2610542"></a>
     41<a class="indexterm" name="id2610549"></a>
    4242This is an opportune point to mention that Samba was created to provide a means of interoperability
    4343and interchange of data between differing operating environments. Samba has no intent to change
     
    4545level of exchange of data between the two environments. What is available today extends well
    4646beyond 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>
    4848        Samba offers much flexibility in file system access management. These are the key access control
    4949        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="id2616671"></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>
    5252                <span class="emphasis"><em>UNIX File and Directory Permissions</em></span>
    5353                </p><p>
    54 <a class="indexterm" name="id2616687"></a>
    55 <a class="indexterm" name="id2616695"></a>
    56 <a class="indexterm" name="id2616702"></a>
     54<a class="indexterm" name="id2610602"></a>
     55<a class="indexterm" name="id2610609"></a>
     56<a class="indexterm" name="id2610616"></a>
    5757                        Samba honors and implements UNIX file system access controls. Users
    5858                        who access a Samba server will do so as a particular MS Windows user.
     
    6262                        (files and directories). This chapter provides an overview for those
    6363                        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>
    6565                <span class="emphasis"><em>Samba Share Definitions</em></span>
    6666                </p><p>
    67 <a class="indexterm" name="id2616730"></a>
     67<a class="indexterm" name="id2610644"></a>
    6868                        In configuring share settings and controls in the <code class="filename">smb.conf</code> file,
    6969                        the network administrator can exercise overrides to native file
     
    7272                        but it is seldom the <span class="emphasis"><em>best</em></span> way to achieve this.
    7373                        The basic options and techniques are described herein.
    74                         </p></li><li class="listitem"><p>
     74                        </p></li><li><p>
    7575                <span class="emphasis"><em>Samba Share ACLs</em></span>
    76                 <a class="indexterm" name="id2616761"></a>
    77                 </p><p>
    78 <a class="indexterm" name="id2616774"></a>
     76                <a class="indexterm" name="id2610676"></a>
     77                </p><p>
     78<a class="indexterm" name="id2610688"></a>
    7979                        Just as it is possible in MS Windows NT to set ACLs on shares
    8080                        themselves, so it is possible to do in Samba.
     
    8282                        easiest ways to affect access controls (restrictions) and can often
    8383                        do so with minimum invasiveness compared with other methods.
    84                         </p></li><li class="listitem"><p>
    85                                 <a class="indexterm" name="id2616792"></a>
    86                                 <a class="indexterm" name="id2616801"></a>
     84                        </p></li><li><p>
     85                                <a class="indexterm" name="id2610706"></a>
     86                                <a class="indexterm" name="id2610715"></a>
    8787                <span class="emphasis"><em>MS Windows ACLs through UNIX POSIX ACLs</em></span>
    8888                </p><p>
    89 <a class="indexterm" name="id2616817"></a>
     89<a class="indexterm" name="id2610731"></a>
    9090                        The use of POSIX ACLs on UNIX/Linux is possible only if the underlying
    9191                        operating system supports them. If not, then this option will not be
     
    9595                        extended attributes enabled. This chapter has pertinent information
    9696                        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>
    9898Perhaps the most important recognition to be made is the simple fact that MS Windows NT4/200x/XP
    9999implement a totally divergent file system technology from what is provided in the UNIX operating system
    100100environment. First we consider what the most significant differences are, then we look
    101101at 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="id2616860"></a>
    104         <a class="indexterm" name="id2616867"></a>
    105         <a class="indexterm" name="id2616873"></a>
    106         <a class="indexterm" name="id2616883"></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>
    107107        Samba operates on top of the UNIX file system. This means it is subject to UNIX file system conventions
    108108        and permissions. It also means that if the MS Windows networking environment requires file system
     
    115115        the depths of control ability should review the <code class="filename">smb.conf</code> man page.
    116116        </p><p>The following compares file system features for UNIX with those of MS Windows NT/200x:
    117         <a class="indexterm" name="id2616918"></a>
     117        <a class="indexterm" name="id2610832"></a>
    118118       
    119119        </p><div class="variablelist"><dl><dt><span class="term">Name Space</span></dt><dd><p>
     
    124124                What MS Windows calls a folder, UNIX calls a directory.
    125125                </p></dd><dt><span class="term">Case Sensitivity</span></dt><dd><p>
    126                 <a class="indexterm" name="id2616963"></a>
    127                 <a class="indexterm" name="id2616970"></a>
     126                <a class="indexterm" name="id2610877"></a>
     127                <a class="indexterm" name="id2610884"></a>
    128128                MS Windows file names are generally uppercase if made up of 8.3 (8-character file name
    129129                and 3 character extension. File names that are longer than 8.3 are case preserving and case
     
    152152                file listing.
    153153                </p></dd><dt><span class="term">Directory Separators</span></dt><dd><p>
    154                 <a class="indexterm" name="id2617034"></a>
     154                <a class="indexterm" name="id2610948"></a>
    155155                MS Windows and DOS use the backslash <code class="constant">\</code> as a directory delimiter, and UNIX uses
    156156                the forward-slash <code class="constant">/</code> as its directory delimiter. This is handled transparently by Samba.
    157157                </p></dd><dt><span class="term">Drive Identification</span></dt><dd><p>
    158                 <a class="indexterm" name="id2617062"></a>
     158                <a class="indexterm" name="id2610976"></a>
    159159                MS Windows products support a notion of drive letters, like <code class="literal">C:</code>, to represent
    160160                disk partitions. UNIX has no concept of separate identifiers for file partitions; each
     
    163163                <code class="constant">C:\</code>.
    164164                </p></dd><dt><span class="term">File Naming Conventions</span></dt><dd><p>
    165                 <a class="indexterm" name="id2617099"></a>
     165                <a class="indexterm" name="id2611013"></a>
    166166                MS Windows generally never experiences file names that begin with a dot (<code class="constant">.</code>), while in UNIX these
    167167                are commonly found in a user's home directory. Files that begin with a dot (<code class="constant">.</code>) are typically
     
    169169                startup configuration data.
    170170                </p></dd><dt><span class="term">Links and Short-Cuts</span></dt><dd><p>
    171                 <a class="indexterm" name="id2617129"></a>
    172                 <a class="indexterm" name="id2617138"></a>
    173                 <a class="indexterm" name="id2617147"></a>
     171                <a class="indexterm" name="id2611043"></a>
     172                <a class="indexterm" name="id2611052"></a>
     173                <a class="indexterm" name="id2611061"></a>
    174174                MS Windows make use of <span class="emphasis"><em>links and shortcuts</em></span> that are actually special types of files that will
    175175                redirect an attempt to execute the file to the real location of the file. UNIX knows of file and directory
     
    178178                Symbolic links are files in UNIX that contain the actual location of the data (file or directory). An
    179179                operation (like read or write) will operate directly on the file referenced. Symbolic links are also
    180                 referred to as <span class="quote">&#8220;<span class="quote">soft links.</span>&#8221;</span> A hard link is something that MS Windows is not familiar with. It allows
     180                referred to as &#8220;<span class="quote">soft links.</span>&#8221; A hard link is something that MS Windows is not familiar with. It allows
    181181                one physical file to be known simultaneously by more than one file name.
    182182                </p></dd></dl></div><p>
     
    184184        in the process of becoming familiar with UNIX/Linux. These are best left for a text that is dedicated to the
    185185        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="id2617196"></a>
    188 <a class="indexterm" name="id2617203"></a>
    189 <a class="indexterm" name="id2617209"></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>
    190190        There are three basic operations for managing directories: <code class="literal">create</code>, <code class="literal">delete</code>,
    191191        <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
    192192        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="id2617319"></a>
    195 <a class="indexterm" name="id2617329"></a>
    196 <a class="indexterm" name="id2617335"></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>
    197197        The network administrator is strongly advised to read basic UNIX training manuals and reference materials
    198198        regarding file and directory permissions maintenance. Much can be achieved with the basic UNIX permissions
     
    226226        </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>
    227227                Any bit flag may be unset. An unset bit flag is the equivalent of "cannot" and is represented
    228                 as a <span class="quote">&#8220;<span class="quote">-</span>&#8221;</span> character (see <a class="link" href="AccessControls.html#access2" title="Example 16.1. Example File">&#8220;Example File&#8221;</a>)
    229 <a class="indexterm" name="id2617477"></a>
    230 <a class="indexterm" name="id2617484"></a>
    231 <a class="indexterm" name="id2617491"></a>
    232 <a class="indexterm" name="id2617497"></a>
    233 <a class="indexterm" name="id2617504"></a>
    234 <a class="indexterm" name="id2617511"></a>
     228                as a &#8220;<span class="quote">-</span>&#8221; character (see <a class="link" href="AccessControls.html#access2" title="Example 16.1. Example File">&#8220;Example File&#8221;</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>
    235235        </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">
    236236-rwxr-x---   Means:
     
    239239       ^^^          everyone else cannot do anything with it.
    240240</pre></div></div><br class="example-break"><p>
    241 <a class="indexterm" name="id2617541"></a>
    242 <a class="indexterm" name="id2617547"></a>
    243 <a class="indexterm" name="id2617554"></a>
    244 <a class="indexterm" name="id2617561"></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>
    245245        Additional possibilities in the [type] field are c = character device, b = block device, p = pipe device,
    246246        s = UNIX Domain Socket.
    247247        </p><p>
    248 <a class="indexterm" name="id2617574"></a>
    249 <a class="indexterm" name="id2617580"></a>
    250 <a class="indexterm" name="id2617587"></a>
    251 <a class="indexterm" name="id2617594"></a>
    252 <a class="indexterm" name="id2617601"></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>
    253253        The letters <code class="constant">rwxXst</code> set permissions for the user, group, and others as read (r), write (w),
    254254        execute (or access for directories) (x), execute  only  if  the  file  is a directory or already has execute
    255255        permission for some user (X), set user (SUID) or group ID (SGID) on execution (s), sticky (t).
    256256        </p><p>
    257 <a class="indexterm" name="id2617620"></a>
    258 <a class="indexterm" name="id2617626"></a>
    259 <a class="indexterm" name="id2617633"></a>
    260 <a class="indexterm" name="id2617640"></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>
    261261        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.
    262262        Without the sticky  bit, anyone able to write to the directory can delete or rename files. The sticky bit is commonly found on
    263263        directories, such as <code class="filename">/tmp</code>, that are world-writable.
    264264        </p><p>
    265 <a class="indexterm" name="id2617666"></a>
    266 <a class="indexterm" name="id2617673"></a>
    267 <a class="indexterm" name="id2617680"></a>
    268 <a class="indexterm" name="id2617687"></a>
    269 <a class="indexterm" name="id2617696"></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>
    270270        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
    271271        group whose `set user or group' bit is set. This can be helpful in setting up directories for which it is desired that
     
    277277        directory but cannot create new files. If files in the directory are set to be readable and writable for the group, then
    278278        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="id2617736"></a>
    281 <a class="indexterm" name="id2617743"></a>
    282 <a class="indexterm" name="id2617750"></a>
    283 <a class="indexterm" name="id2617757"></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>
    284284        People have asked on the Samba mailing list how is it possible to protect files or directories from deletion by users.
    285285        For example, Windows NT/2K/XP provides the capacity to set access controls on a directory into which people can
     
    289289        directory that contains a file and has write permission for it has the capability to delete it.
    290290        </p><p>
    291 <a class="indexterm" name="id2617779"></a>
    292 <a class="indexterm" name="id2617786"></a>
    293 <a class="indexterm" name="id2617793"></a>
     291<a class="indexterm" name="id2611693"></a>
     292<a class="indexterm" name="id2611700"></a>
     293<a class="indexterm" name="id2611707"></a>
    294294        For the record, in the UNIX environment the ability to delete a file is controlled by the permissions on
    295295        the directory that the file is in. In other words, a user can delete a file in a directory to which that
    296296        user has write access, even if that user does not own the file.
    297297        </p><p>
    298 <a class="indexterm" name="id2617808"></a>
    299 <a class="indexterm" name="id2617815"></a>
    300 <a class="indexterm" name="id2617822"></a>
    301 <a class="indexterm" name="id2617828"></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>
    302302        Of necessity, Samba is subject to the file system semantics of the host operating system. Samba is therefore
    303303        limited in the file system capabilities that can be made available through Windows ACLs, and therefore performs
     
    306306        the appropriate extended attribute.
    307307        </p><p>
    308 <a class="indexterm" name="id2617850"></a>
    309 <a class="indexterm" name="id2617857"></a>
    310 <a class="indexterm" name="id2617864"></a>
    311 <a class="indexterm" name="id2617871"></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>
    312312        The specific semantics of the extended attributes are not consistent across UNIX and UNIX-like systems such as Linux.
    313313        For example, it is possible on some implementations of the extended attributes to set a flag that prevents the directory
     
    323323        A simple test can be done to check if the immutible flag is supported on files in the file system of the Samba host
    324324        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>
    326326        Create a file called <code class="filename">filename</code>.
    327         </p></li><li class="step" title="Step 2"><p>
     327        </p></li><li><p>
    328328        Login as the <code class="constant">root</code> user, then set the immutibile flag on a test file as follows:
    329329</p><pre class="screen">
    330330<code class="prompt">root# </code> chattr +i `filename'
    331331</pre><p>
    332         </p></li><li class="step" title="Step 3"><p>
     332        </p></li><li><p>
    333333        Login as the user who owns the file (not root) and attempt to remove the file as follows:
    334334</p><pre class="screen">
     
    341341        immutable directories are writable. If they are not, then the entire directory and its contents will effectively
    342342        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="id2617990"></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>
    345345        The following parameters in the <code class="filename">smb.conf</code> file sections define a share control or affect access controls.
    346346        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>
    348348        User- and group-based controls can prove quite useful. In some situations it is distinctly desirable to
    349349        force all file system operations as if a single user were doing so. The use of the
     
    386386                        </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>
    387387                        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>
    389389        Directory permission-based controls, if misused, can result in considerable difficulty in diagnosing the causes of
    390390        misconfiguration. Use them sparingly and carefully. By gradually introducing each, one at a time, undesirable side
     
    417417                        </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>
    418418                        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>
    420420        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
    421421        in ways that create inadvertent barriers to file access. Such are the consequences of not understanding the
     
    450450                        </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>
    451451                        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="id2619066"></a>
    454 <a class="indexterm" name="id2619073"></a>
    455 <a class="indexterm" name="id2619080"></a>
    456 <a class="indexterm" name="id2619087"></a>
    457         <a class="indexterm" name="id2619094"></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>
    458458        This section deals with how to configure Samba per-share access control restrictions.
    459459        By default, Samba sets no restrictions on the share itself. Restrictions on the share itself
     
    462462        the global user <code class="constant">Everyone - Full Control</code> (full control, change and read).
    463463        </p><p>
    464 <a class="indexterm" name="id2619117"></a>
    465 <a class="indexterm" name="id2619124"></a>
    466 <a class="indexterm" name="id2619131"></a>
     464<a class="indexterm" name="id2613031"></a>
     465<a class="indexterm" name="id2613038"></a>
     466<a class="indexterm" name="id2613045"></a>
    467467        At this time Samba does not provide a tool for configuring access control settings on the share
    468468        itself the only way to create those settings is to use either the NT4 Server Manager or the Windows 200x
     
    470470        this capability in the Samba command-line tool set.
    471471        </p><p>
    472 <a class="indexterm" name="id2619147"></a>
    473 <a class="indexterm" name="id2619154"></a>
    474 <a class="indexterm" name="id2619161"></a>
    475 <a class="indexterm" name="id2619168"></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>
    476476        Samba stores the per-share access control settings in a file called <code class="filename">share_info.tdb</code>.
    477477        The location of this file on your system will depend on how Samba was compiled. The default location
     
    479479        utility has been compiled and installed on your system, then you can examine the contents of this file
    480480        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>
    482482                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="id2619226"></a>
    485 <a class="indexterm" name="id2619233"></a>
    486 <a class="indexterm" name="id2619240"></a>
    487 <a class="indexterm" name="id2619247"></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>
    488488                        The tool you need to manage share permissions on a Samba server from a Windows NT4 Workstation or Server
    489489                        is the NT Server Manager.  Server Manager is shipped with Windows NT4 Server products but not with Windows
    490490                        NT4 Workstation.  You can obtain the NT Server Manager for MS Windows NT4 Workstation from the Microsoft
    491491                        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>
    493493                        Launch the <span class="application">NT4 Server Manager</span> and click on the Samba server you want to
    494494                        administer. From the menu select <span class="guimenu">Computer</span>, then click on
    495495                        <span class="guimenuitem">Shared Directories</span>.
    496                         </p></li><li class="step" title="Step 2"><p>
     496                        </p></li><li><p>
    497497                        Click on the share that you wish to manage and click the <span class="guilabel">Properties</span> tab, then click
    498498                        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="id2619331"></a>
    501 <a class="indexterm" name="id2619338"></a>
    502 <a class="indexterm" name="id2619344"></a>
    503 <a class="indexterm" name="id2619351"></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>
    504504                        On <span class="application">MS Windows NT4/200x/XP</span> systems, ACLs on the share itself are set using
    505505                        tools like the MS Explorer. For example, in Windows 200x, right-click on the shared folder,
     
    507507                        Windows NT4/200x permissions allow the group "Everyone" full control on the share.
    508508                        </p><p>
    509 <a class="indexterm" name="id2619384"></a>
    510 <a class="indexterm" name="id2619391"></a>
    511 <a class="indexterm" name="id2619398"></a>
     509<a class="indexterm" name="id2613298"></a>
     510<a class="indexterm" name="id2613305"></a>
     511<a class="indexterm" name="id2613312"></a>
    512512                        MS Windows 200x and later versions come with a tool called the <span class="application">Computer Management</span>
    513513                        snap-in for the MMC. This tool can be accessed via <span class="guimenu">Control Panel -&gt;
    514514                        Administrative Tools -&gt; 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>
    516516                        After launching the MMC with the Computer Management snap-in, click the menu item <span class="guimenuitem">Action</span>
    517517                        and select <span class="guilabel">Connect to another computer</span>. If you are not logged onto a domain you will be prompted
    518518                        to enter a domain login user identifier and a password. This will authenticate you to the domain.
    519519                        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>
    521521                        If the Samba server is not shown in the <span class="guilabel">Select Computer</span> box, type in the name of the target
    522522                        Samba server in the field <span class="guilabel">Name:</span>. Now click the on <span class="guibutton">[+]</span> next to
    523523                        <span class="guilabel">System Tools</span>, then on the <span class="guibutton">[+]</span> next to
    524524                        <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="id2619503"></a>
     525                        </p></li><li><p>
     526<a class="indexterm" name="id2613416"></a>
    527527                        In the right panel, double-click on the share on which you wish to set access control permissions.
    528528                        Then click the tab <span class="guilabel">Share Permissions</span>. It is now possible to add access control entities
    529529                        to the shared folder. Remember to set what type of access (full control, change, read) you
    530530                        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>
    532532                        Be careful. If you take away all permissions from the <code class="constant">Everyone</code> user without removing
    533533                        this user, effectively no user will be able to access the share. This is a result of what is known as
     
    535535                        part of the group <code class="constant">Everyone</code> will have no access even if she is given explicit full
    536536                        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="id2619567"></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>
    539539                Windows NT clients can use their native security settings dialog box to view and modify the
    540540                underlying UNIX permissions.
     
    545545                Samba does not attempt to go beyond POSIX ACLs, so the various finer-grained access control
    546546                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>
    548548                All access to UNIX/Linux system files via Samba is controlled by the operating system file access controls.
    549549                When trying to figure out file access problems, it is vitally important to find the identity of the Windows
    550550                user as it is presented by Samba at the point of file access. This can best be determined from the
    551551                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>
    553553                From an NT4/2000/XP client, right-click on any file or directory in a Samba-mounted drive letter
    554554                or UNC path. When the menu pops up, click on the <span class="guilabel">Properties</span> entry at the bottom
     
    561561                nonfunctional with a Samba share at this time, because the only useful button, the <span class="guibutton">Add</span>
    562562                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>
    564564                Clicking on the <span class="guibutton">Ownership</span> button brings up a dialog box telling you who owns
    565565                the given file. The owner name will be displayed like this:
     
    575575                the file owner will be shown as the NT user <span class="emphasis"><em>Everyone</em></span>.
    576576                </p><p>
    577 <a class="indexterm" name="id2619751"></a>
     577<a class="indexterm" name="id2613665"></a>
    578578                The <span class="guibutton">Take Ownership</span> button will not allow you to change the ownership of this file to
    579579                yourself (clicking it will display a dialog box complaining that the user as whom you are currently logged onto
     
    583583                not work with Samba at this time.
    584584                </p><p>
    585 <a class="indexterm" name="id2619780"></a>
    586 <a class="indexterm" name="id2619787"></a>
    587 <a class="indexterm" name="id2619793"></a>
     585<a class="indexterm" name="id2613694"></a>
     586<a class="indexterm" name="id2613701"></a>
     587<a class="indexterm" name="id2613708"></a>
    588588                There is an NT <code class="literal">chown</code> command that will work with Samba and allow a user with administrator
    589589                privilege connected to a Samba server as root to change the ownership of files on both a local NTFS file system
    590590                or remote mounted NTFS or Samba drive. This is available as part of the <span class="application">Seclib</span> NT
    591591                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>
    593593                The third button is the <span class="guibutton">Permissions</span> button. Clicking on it brings up a dialog box
    594594                that shows both the permissions and the UNIX owner of the file or directory. The owner is displayed like this:
     
    604604                </p><p>
    605605                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>
    607607                The standard UNIX user/group/world triplet and the corresponding <code class="constant">read, write,
    608608                execute</code> permissions triplets are mapped by Samba into a three-element NT ACL with the
    609                 <span class="quote">&#8220;<span class="quote">r</span>&#8221;</span>, <span class="quote">&#8220;<span class="quote">w</span>&#8221;</span>, and <span class="quote">&#8220;<span class="quote">x</span>&#8221;</span> bits mapped into the corresponding NT
     609                &#8220;<span class="quote">r</span>&#8221;, &#8220;<span class="quote">w</span>&#8221;, and &#8220;<span class="quote">x</span>&#8221; bits mapped into the corresponding NT
    610610                permissions. The UNIX world permissions are mapped into the global NT group <code class="constant">Everyone</code>, followed
    611611                by the list of permissions allowed for the UNIX world. The UNIX owner and group permissions are displayed as an NT
     
    622622                no permissions as having the NT <code class="literal">O</code> bit set.  This was chosen, of course, to make it look
    623623                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>
    625625                Directories on an NT NTFS file system have two different sets of permissions. The first set is the ACL set on the
    626626                directory itself, which is usually displayed in the first set of parentheses in the normal <code class="constant">RW</code>
     
    633633                Samba synthesizes these inherited permissions for NT by returning as an NT ACL the UNIX permission mode that a new file
    634634                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>
    636636        Modifying file and directory permissions is as simple as changing the displayed permissions in the dialog box
    637637        and clicking on <span class="guibutton">OK</span>. However, there are limitations that a user needs to be aware of,
     
    654654        you to add permissions back to a file or directory once you have removed them from a triplet component.
    655655        </p><p>
    656         Because UNIX supports only the <span class="quote">&#8220;<span class="quote">r</span>&#8221;</span>, <span class="quote">&#8220;<span class="quote">w</span>&#8221;</span>, and <span class="quote">&#8220;<span class="quote">x</span>&#8221;</span> bits of an NT ACL, if
     656        Because UNIX supports only the &#8220;<span class="quote">r</span>&#8221;, &#8220;<span class="quote">w</span>&#8221;, and &#8220;<span class="quote">x</span>&#8221; bits of an NT ACL, if
    657657        other NT security attributes such as <code class="constant">Delete Access</code> are selected, they will be ignored
    658658        when applied on the Samba server.
     
    666666        component and click on the <span class="guibutton">Remove</span> button or set the component to only have the special
    667667        <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 &#8220;create mask&#8221; Parameters"><div class="titlepage"><div><div><h3 class="title"><a name="id2620193"></a>Interaction with the Standard Samba <span class="quote">&#8220;<span class="quote">create mask</span>&#8221;</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 &#8220;<span class="quote">create mask</span>&#8221; 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:
    669669       
    670670
    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>
    672672
    673673        </p><p>
     
    720720        then set the following parameters in the <code class="filename">smb.conf</code> file in that
    721721        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">&#8220;<span class="quote">read-only</span>&#8221;</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 &#8220;<span class="quote">read-only</span>&#8221;)
    724724        into the UNIX permissions of a file. This means there can
    725725        be a conflict between the permission bits set via the security
     
    727727        </p></div><p>
    728728        If a file has no UNIX read access for the owner, it will show up
    729         as <span class="quote">&#8220;<span class="quote">read-only</span>&#8221;</span> in the standard file attributes tabbed dialog.
     729        as &#8220;<span class="quote">read-only</span>&#8221; in the standard file attributes tabbed dialog.
    730730        Unfortunately, this dialog is the same one that contains the security information
    731731        in another tab.
     
    741741        rather than <span class="guibutton">OK</span> to ensure that your changes
    742742        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>
    744744        Windows administrators are familiar with simple ACL controls, and they typically
    745745        consider that UNIX user/group/other (ugo) permissions are inadequate and not
     
    769769        that permit normal ugo and ACLs functionality to be overrided. This further complicates
    770770        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>
    772772        In examining POSIX ACLs we must consider the manner in which they operate for
    773773        both files and directories. File ACLs have the following significance:
     
    798798default:other:---     &lt;-- inherited permissions for everyone (other)
    799799</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>
    801801        Microsoft Windows NT4/200X ACLs must of necessity be mapped to POSIX ACLs.
    802802        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
     
    817817        The Windows administrator is more restricted in that it is not possible from within
    818818        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>
    820820        Interesting things happen in the mapping of UNIX POSIX directory permissions and
    821821        UNIX POSIX ACLs to Windows ACEs (Access Control Entries, the discrete components of
     
    825825        there are some notable exceptions and a few peculiarities that the astute administrator
    826826        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>
    828828File, directory, and share access problems are common topics on the mailing list. The following
    829829are 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>
    831831        The following complaint has frequently been voiced on the Samba mailing list:
    832         <span class="quote">&#8220;<span class="quote">
     832        &#8220;<span class="quote">
    833833        We are facing some troubles with file/directory permissions. I can log on the domain as admin user (root),
    834834        and there's a public share on which everyone needs to have permission to create/modify files, but only
     
    836836        <strong class="userinput"><code>chgrp -R users *</code></strong> and <strong class="userinput"><code>chown -R nobody *</code></strong> to allow
    837837        other users to change the file.
    838         </span>&#8221;</span>
     838        </span>&#8221;
    839839        </p><p>
    840840        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>
    842842                        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>
    844844                        Set the ownership to whatever public user and group you want
    845845</p><pre class="screen">
     
    849849<code class="prompt">$ </code>find `directory_name' -type f -exec chown user:group {}\;
    850850</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>
    852852                        The above will set the <code class="constant">SGID bit</code> on all directories. Read your
    853853                        UNIX/Linux man page on what that does. This ensures that all files and directories
    854854                        that are created in the directory tree will be owned by the current user and will
    855855                        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>
    857857                        Directory is <em class="replaceable"><code>/foodbar</code></em>:
    858858</p><pre class="screen">
    859859<code class="prompt">$ </code><strong class="userinput"><code>chown jack:engr /foodbar</code></strong>
    860860</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">
    862862<code class="prompt">$ </code><strong class="userinput"><code>chown jack /foodbar</code></strong>
    863863<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:
    865865
    866866</p><pre class="screen">
     
    872872drwxrwsr-x  2 jack  engr    48 2003-02-04 09:55 foodbar
    873873</pre><p>
    874                         </p></li><li class="step" title="Step 5"><p>Now type:
     874                        </p></li><li><p>Now type:
    875875</p><pre class="screen">
    876876<code class="prompt">$ </code><strong class="userinput"><code>su - jill</code></strong>
     
    885885-rw-r--r--  1 jill  engr     0 2007-01-18 19:41 Afile
    886886</pre><p>
    887                 </p></li><li class="step" title="Step 6"><p>
     887                </p></li><li><p>
    888888                If the user that must have write permission in the directory is not a member of the group
    889889                <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>
    892892                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
    893893                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">&#8220;<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>&#8221;</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> &#8220;<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>&#8221;
    897897                </p><p>
    898898                <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
     
    907907                be created with the group that owns the directory. In <code class="filename">smb.conf</code> share declaration section set:
    908908                </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>
    910910                </p><p>
    911911                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.