1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <!DOCTYPE chapter PUBLIC "-//Samba-Team//DTD DocBook V4.2-Based Variant V1.0//EN" "http://www.samba.org/samba/DTD/samba-doc">
4 <chapter id="AccessControls">
8 <author>&person.jelmer;<contrib>drawing</contrib></author>
9 <pubdate>May 10, 2003</pubdate>
11 <title>File, Directory and Share Access Controls</title>
14 <indexterm><primary>ACLs</primary></indexterm>
15 Advanced MS Windows users are frequently perplexed when file, directory and share manipulation of
16 resources shared via Samba do not behave in the manner they might expect. MS Windows network
17 administrators are often confused regarding network access controls and how to
18 provide users with the access they need while protecting resources from unauthorized access.
22 Many UNIX administrators are unfamiliar with the MS Windows environment and in particular
23 have difficulty in visualizing what the MS Windows user wishes to achieve in attempts to set file
24 and directory access permissions.
28 The problem lies in the differences in how file and directory permissions and controls work
29 between the two environments. This difference is one that Samba cannot completely hide, even
30 though it does try to bridge the chasm to a degree.
34 <indexterm><primary>Extended Attributes</primary></indexterm>
35 <indexterm><primary>ACLs</primary><secondary>POSIX</secondary></indexterm>
37 POSIX Access Control List technology has been available (along with Extended Attributes)
38 for UNIX for many years, yet there is little evidence today of any significant use. This
39 explains to some extent the slow adoption of ACLs into commercial Linux products. MS Windows
40 administrators are astounded at this, given that ACLs were a foundational capability of the now
41 decade-old MS Windows NT operating system.
45 The purpose of this chapter is to present each of the points of control that are possible with
46 Samba-3 in the hope that this will help the network administrator to find the optimum method
47 for delivering the best environment for MS Windows desktop users.
51 This is an opportune point to mention that Samba was created to provide a means of interoperability
52 and interchange of data between differing operating environments. Samba has no intent to change
53 UNIX/Linux into a platform like MS Windows. Instead the purpose was and is to provide a sufficient
54 level of exchange of data between the two environments. What is available today extends well
55 beyond early plans and expectations, yet the gap continues to shrink.
59 <title>Features and Benefits</title>
62 Samba offers a lot of flexibility in file system access management. These are the key access control
63 facilities present in Samba today:
67 <title>Samba Access Control Facilities</title>
69 <indexterm><primary>permissions</primary><secondary>UNIX file and directory</secondary></indexterm>
70 <emphasis>UNIX File and Directory Permissions</emphasis>
74 Samba honors and implements UNIX file system access controls. Users
75 who access a Samba server will do so as a particular MS Windows user.
76 This information is passed to the Samba server as part of the logon or
77 connection setup process. Samba uses this user identity to validate
78 whether or not the user should be given access to file system resources
79 (files and directories). This chapter provides an overview for those
80 to whom the UNIX permissions and controls are a little strange or unknown.
85 <emphasis>Samba Share Definitions</emphasis>
89 In configuring share settings and controls in the &smb.conf; file,
90 the network administrator can exercise overrides to native file
91 system permissions and behaviors. This can be handy and convenient
92 to effect behavior that is more like what MS Windows NT users expect
93 but it is seldom the <emphasis>best</emphasis> way to achieve this.
94 The basic options and techniques are described herein.
99 <emphasis>Samba Share ACLs</emphasis>
100 <indexterm><primary>ACLs</primary><secondary>share</secondary></indexterm>
104 Just like it is possible in MS Windows NT to set ACLs on shares
105 themselves, so it is possible to do this in Samba.
106 Few people make use of this facility, yet it remains one of the
107 easiest ways to affect access controls (restrictions) and can often
108 do so with minimum invasiveness compared with other methods.
113 <indexterm><primary>ACLs</primary><secondary>POSIX</secondary></indexterm>
114 <indexterm><primary>ACLs</primary><secondary>Windows</secondary></indexterm>
115 <emphasis>MS Windows ACLs through UNIX POSIX ACLs</emphasis>
119 The use of POSIX ACLs on UNIX/Linux is possible only if the underlying
120 operating system supports them. If not, then this option will not be
121 available to you. Current UNIX technology platforms have native support
122 for POSIX ACLs. There are patches for the Linux kernel that also provide
123 this. Sadly, few Linux platforms ship today with native ACLs and
124 Extended Attributes enabled. This chapter has pertinent information
125 for users of platforms that support them.
133 <title>File System Access Controls</title>
136 Perhaps the most important recognition to be made is the simple fact that MS Windows NT4/200x/XP
137 implement a totally divergent file system technology from what is provided in the UNIX operating system
138 environment. First we consider what the most significant differences are, then we look
139 at how Samba helps to bridge the differences.
143 <title>MS Windows NTFS Comparison with UNIX File Systems</title>
146 <indexterm><primary>NTFS</primary></indexterm>
147 <indexterm><primary>File System</primary></indexterm>
148 <indexterm><primary>File System</primary><secondary>UNIX</secondary></indexterm>
149 <indexterm><primary>File System</primary><secondary>Windows</secondary></indexterm>
151 Samba operates on top of the UNIX file system. This means it is subject to UNIX file system conventions
152 and permissions. It also means that if the MS Windows networking environment requires file system
153 behavior that differs from UNIX file system behavior then somehow Samba is responsible for emulating
154 that in a transparent and consistent manner.
158 It is good news that Samba does this to a large extent and on top of that provides a high degree
159 of optional configuration to override the default behavior. We look at some of these over-rides,
160 but for the greater part we will stay within the bounds of default behavior. Those wishing to explore
161 the depths of control ability should review the &smb.conf; man page.
164 <para>The following compares file system features for UNIX with those of Microsoft Windows NT/200x:
165 <indexterm><primary>File System</primary><secondary>feature comparison</secondary></indexterm>
171 <term>Name Space</term>
174 MS Windows NT4/200x/XP files names may be up to 254 characters long, and UNIX file names
175 may be 1023 characters long. In MS Windows, file extensions indicate particular file types,
176 in UNIX this is not so rigorously observed as all names are considered arbitrary.
179 What MS Windows calls a folder, UNIX calls a directory.
185 <term>Case Sensitivity</term>
188 <indexterm><primary>8.3 file names</primary></indexterm>
189 <indexterm><primary>File System</primary><secondary>case sensitivity</secondary></indexterm>
190 MS Windows file names are generally upper case if made up of 8.3 (8 character file name
191 and 3 character extension. File names that are longer than 8.3 are case preserving and case
196 UNIX file and directory names are case sensitive and case preserving. Samba implements the
197 MS Windows file name behavior, but it does so as a user application. The UNIX file system
198 provides no mechanism to perform case insensitive file name lookups. MS Windows does this
199 by default. This means that Samba has to carry the processing overhead to provide features
200 that are not native to the UNIX operating system environment.
203 Consider the following. All are unique UNIX names but one single MS Windows file name:
211 So clearly, in an MS Windows file name space these three files cannot co-exist, but in UNIX
215 So what should Samba do if all three are present? That which is lexically first will be
216 accessible to MS Windows users, the others are invisible and unaccessible &smbmdash; any
217 other solution would be suicidal.
223 <term>Directory Separators</term>
227 <indexterm><primary>Directory Separators</primary></indexterm>
228 MS Windows and DOS uses the backslash <constant>\</constant> as a directory delimiter, and UNIX uses
229 the forward-slash <constant>/</constant> as its directory delimiter. This is handled transparently by Samba.
235 <term>Drive Identification</term>
238 <indexterm><primary>Drive Identification</primary></indexterm>
239 MS Windows products support a notion of drive letters, like <command>C:</command> to represent
240 disk partitions. UNIX has no concept of separate identifiers for file partitions, each
241 such file system is mounted to become part of the overall directory tree.
242 The UNIX directory tree begins at <constant>/</constant> just like the root of a DOS drive is specified as
243 <constant>C:\</constant>.
249 <term>File Naming Conventions</term>
252 <indexterm><primary>File Naming Conventions</primary></indexterm>
253 MS Windows generally never experiences file names that begin with a dot (<constant>.</constant>) while in UNIX these
254 are commonly found in a user's home directory. Files that begin with a dot (<constant>.</constant>) are typically
255 either start-up files for various UNIX applications, or they may be files that contain
256 start-up configuration data.
262 <term>Links and Short-Cuts</term>
265 <indexterm><primary>Links</primary><secondary>hard</secondary></indexterm>
266 <indexterm><primary>Links</primary><secondary>soft</secondary></indexterm>
267 <indexterm><primary>Short-Cuts</primary></indexterm>
268 MS Windows make use of <quote>links and short-cuts</quote> that are actually special types of files that will
269 redirect an attempt to execute the file to the real location of the file. UNIX knows of file and directory
270 links, but they are entirely different from what MS Windows users are used to.
273 Symbolic links are files in UNIX that contain the actual location of the data (file or directory). An
274 operation (like read or write) will operate directly on the file referenced. Symbolic links are also
275 referred to as <quote>soft links.</quote> A hard link is something that MS Windows is not familiar with. It allows
276 one physical file to be known simultaneously by more than one file name.
283 There are many other subtle differences that may cause the MS Windows administrator some temporary discomfort
284 in the process of becoming familiar with UNIX/Linux. These are best left for a text that is dedicated to the
285 purpose of UNIX/Linux training and education.
291 <title>Managing Directories</title>
294 There are three basic operations for managing directories: <command>create, delete, rename</command>.
296 <title>Managing Directories with UNIX and Windows</title>
297 <tgroup align="center" cols="3">
299 <row><entry>Action</entry><entry>MS Windows Command</entry><entry>UNIX Command</entry></row>
303 <row><entry>create</entry><entry>md folder</entry><entry>mkdir folder</entry></row>
304 <row><entry>delete</entry><entry>rd folder</entry><entry>rmdir folder</entry></row>
305 <row><entry>rename</entry><entry>rename oldname newname</entry><entry>mv oldname newname</entry></row>
314 <title>File and Directory Access Control</title>
318 <indexterm><primary>ACLs</primary><secondary>File System</secondary></indexterm>
319 The network administrator is strongly advised to read foundational training manuals and reference materials
320 regarding file and directory permissions maintenance. Much can be achieved with the basic UNIX permissions
321 without having to resort to more complex facilities like POSIX Access Control Lists (ACLs) or Extended
326 UNIX/Linux file and directory access permissions involves setting three primary sets of data and one control set.
327 A UNIX file listing looks as follows:
329 &prompt;<userinput>ls -la</userinput>
331 drwxr-xr-x 13 maryo gnomes 816 2003-05-12 22:56 .
332 drwxrwxr-x 37 maryo gnomes 3800 2003-05-12 22:29 ..
333 dr-xr-xr-x 2 maryo gnomes 48 2003-05-12 22:29 muchado02
334 drwxrwxrwx 2 maryo gnomes 48 2003-05-12 22:29 muchado03
335 drw-rw-rw- 2 maryo gnomes 48 2003-05-12 22:29 muchado04
336 d-w--w--w- 2 maryo gnomes 48 2003-05-12 22:29 muchado05
337 dr--r--r-- 2 maryo gnomes 48 2003-05-12 22:29 muchado06
338 drwsrwsrwx 2 maryo gnomes 48 2003-05-12 22:29 muchado08
339 ---------- 1 maryo gnomes 1242 2003-05-12 22:31 mydata00.lst
340 --w--w--w- 1 maryo gnomes 7754 2003-05-12 22:33 mydata02.lst
341 -r--r--r-- 1 maryo gnomes 21017 2003-05-12 22:32 mydata04.lst
342 -rw-rw-rw- 1 maryo gnomes 41105 2003-05-12 22:32 mydata06.lst
348 The columns above represent (from left to right): permissions, number of hard links to file, owner, group, size (bytes), access date, time of last modification, and file name.
352 An overview of the permissions field can be found in <link linkend="access1">Overview of UNIX permissions field</link>.
355 <image id="access1"><imagedescription>Overview of UNIX permissions field.</imagedescription><imagefile scale="40">access1</imagefile></image>
358 Any bit flag may be unset. An unset bit flag is the equivalent of <quote>cannot</quote> and is represented as a <quote>-</quote> character.
361 <title>Example File</title>
363 -rwxr-x--- Means: The owner (user) can read, write, execute
364 the group can read and execute
365 everyone else cannot do anything with it.
372 Additional possibilities in the [type] field are: c = character device, b = block device, p = pipe device, s = UNIX Domain Socket.
376 The letters <constant>rwxXst</constant> set permissions for the user, group and others as: read (r), write (w), execute (or access for directories) (x),
377 execute only if the file is a directory or already has execute permission for some user (X), set user or group ID on execution (s),
382 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.
383 Without the sticky bit, anyone able to write to the directory can delete or rename files. The sticky bit is commonly found on
384 directories, such as <filename>/tmp</filename>, that are world-writable.
388 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
389 group whose `set user or group' bit is set. This can be helpful in setting up directories for which it is desired that
390 all users who are in a group should be able to write to and read from a file, particularly when it is undesirable for that file
391 to be exclusively owned by a user whose primary group is not the group that all such users belong to.
395 When a directory is set <constant>d-wx--x---</constant> this means that the owner can read and create (write) files in it, but because
396 the (r) read flags are not set, files cannot be listed (seen) in the directory by anyone. The group can read files in the
397 directory but cannot create new files. If files in the directory are set to be readable and writable for the group, then
398 group members will be able to write to (or delete) them.
402 <title>Protecting Directories and Files from Deletion</title>
405 People have asked on the Samba mailing list how is it possible to protect files or directories from deletion by users.
406 For example, Windows NT/2K/XP provides the capacity to set access controls on a directory into which people can
407 write files but not delete them. It is possible to set an ACL on a Windows file that permits the file to be written to
408 but not deleted. Such concepts are foreign to the UNIX operating system file space. Within the UNIX file system
409 anyone who has the ability to create a file can write to it, and has the capability to delete it. Of necessity, Samba
410 is subject to the file system semantics of the host operating system. Samba is therefore limited in the file system
411 capabilities that can be made available through Windows ACLs, and therefore performs a <quote>best fit</quote>
412 translation to POSIX ACLs. Some UNIX file systems do however support a feature known as extended attributes. Only
413 the Windows concept of <quote>inheritance</quote> is implemented by Samba through the appropriate extended attribute.
417 The specific semantics of the extended attributes are not consistent across UNIX and UNIX-like systems such as Linux.
418 For example, it is possible on some implementations of the extended attributes to set a flag that prevents the directory
419 or file from being deleted. The extended attribute that may achieve this is called the <constant>immutible</constant> bit.
420 Unfortunately, the implementation of the immutible flag is NOT consistent with published documentation. For example, the
421 man page for the <command>chattr</command> on SUSE Linux 9.2 says:
423 A file with the i attribute cannot be modified: it cannot be deleted
424 or renamed, no link can be created to this file and no data can be
425 written to the file. Only the superuser or a process possessing the
426 CAP_LINUX_IMMUTABLE capability can set or clear this attribute.
428 A simple test can be done to check if the immutible flag is supported on files in the file system of the Samba host
434 Create a file called <filename>filename</filename>
438 Login as the <constant>root</constant> user, then set the immutibile flag on a test file as follows:
440 &rootprompt; chatter +i 'filename'
445 Login as the user who owns the file (not root) attempt to remove the file as follows:
447 mystic:/home/hannibal > rm filename
449 It will not be possible to delete the file if the immutible flag is correctly honored.
454 On those systems and file system types that support the immutible bit it is possible to create directories
455 that can not be deleted. Check the man page on your particular host system to determine whether or not
456 immutable directories are writable. If they are not, then the entire directory and its contents will effectively
457 by protected from writing (file creation also) and deletion.
467 <title>Share Definition Access Controls</title>
471 <indexterm><primary>permissions</primary><secondary>share</secondary></indexterm>
472 The following parameters in the &smb.conf; file sections define a share control or effect access controls.
473 Before using any of the following options, please refer to the man page for &smb.conf;.
477 <title>User and Group-Based Controls</title>
480 User and group-based controls can prove quite useful. In some situations it is distinctly desirable to affect all
481 file system operations as if a single user were doing so. The use of the <smbconfoption name="force user"/> and
482 <smbconfoption name="force group"/> behavior will achieve this. In other situations it may be necessary to effect a
483 paranoia level of control to ensure that only particular authorized persons will be able to access a share or
484 its contents. Here the use of the <smbconfoption name="valid users"/> or the
485 <smbconfoption name="invalid users"/> may be most useful.
489 As always, it is highly advisable to use the least difficult to maintain and the least ambiguous method for
490 controlling access. Remember, when you leave the scene someone else will need to provide assistance and
491 if he finds too great a mess or does not understand what you have done, there is risk of
492 Samba being removed and an alternative solution being adopted.
496 <link linkend="ugbc">Following table</link> enumerates these controls.
499 <table frame='all' pgwide='0' id="ugbc"><title>User and Group Based Controls</title>
501 <colspec align="left"/>
502 <colspec align="justify" colwidth="1*"/>
505 <entry align="center">Control Parameter</entry>
506 <entry align="center">Description - Action - Notes</entry>
511 <entry><smbconfoption name="admin users"/></entry>
513 List of users who will be granted administrative privileges on the share.
514 They will do all file operations as the super-user (root).
515 Any user in this list will be able to do anything they like on the share,
516 irrespective of file permissions.
520 <entry><smbconfoption name="force group"/></entry>
522 Specifies a UNIX group name that will be assigned as the default primary group
523 for all users connecting to this service.
527 <entry><smbconfoption name="force user"/></entry>
529 Specifies a UNIX user name that will be assigned as the default user for all users connecting to this service.
530 This is useful for sharing files. Incorrect use can cause security problems.
534 <entry><smbconfoption name="guest ok"/></entry>
536 If this parameter is set for a service, then no password is required to connect to the service. Privileges will be
537 those of the guest account.
541 <entry><smbconfoption name="invalid users"/></entry>
543 List of users that should not be allowed to login to this service.
547 <entry><smbconfoption name="only user"/></entry>
549 Controls whether connections with usernames not in the user list will be allowed.
553 <entry><smbconfoption name="read list"/></entry>
555 List of users that are given read-only access to a service. Users in this list
556 will not be given write access, no matter what the read only option is set to.
560 <entry><smbconfoption name="username"/></entry>
562 Refer to the &smb.conf; man page for more information -- this is a complex and potentially misused parameter.
566 <entry><smbconfoption name="valid users"/></entry>
568 List of users that should be allowed to login to this service.
572 <entry><smbconfoption name="write list"/></entry>
574 List of users that are given read-write access to a service.
584 <title>File and Directory Permissions-Based Controls</title>
587 The following file and directory permission-based controls, if misused, can result in considerable difficulty to
588 diagnose causes of misconfiguration. Use them sparingly and carefully. By gradually introducing each one by one,
589 undesirable side effects may be detected. In the event of a problem, always comment all of them out and then gradually
590 reintroduce them in a controlled way.
594 Refer to <link linkend="fdpbc">the following table</link> for information regarding the parameters that may be used to affect file and
595 directory permission-based access controls.
598 <table frame='all' id="fdpbc"><title>File and Directory Permission Based Controls</title>
600 <colspec align="left"/>
601 <colspec align="justify" colwidth="1*"/>
604 <entry align="center">Control Parameter</entry>
605 <entry align="center">Description - Action - Notes</entry>
610 <entry><smbconfoption name="create mask"/></entry>
612 Refer to the &smb.conf; man page.
616 <entry><smbconfoption name="directory mask"/></entry>
618 The octal modes used when converting DOS modes to UNIX modes when creating UNIX directories.
619 See also: directory security mask.
620 </para></entry></row>
622 <entry><smbconfoption name="dos filemode"/></entry>
624 Enabling this parameter allows a user who has write access to the file to modify the permissions on it.
628 <entry><smbconfoption name="force create mode"/></entry>
630 This parameter specifies a set of UNIX mode bit permissions that will always be set on a file created by Samba.
634 <entry><smbconfoption name="force directory mode"/></entry>
636 This parameter specifies a set of UNIX mode bit permissions that will always be set on a directory created by Samba.
640 <entry><smbconfoption name="force directory security mode"/></entry>
642 Controls UNIX permission bits modified when a Windows NT client is manipulating UNIX permissions on a directory.
646 <entry><smbconfoption name="force security mode"/></entry>
648 Controls UNIX permission bits modified when a Windows NT client manipulates UNIX permissions.
652 <entry><smbconfoption name="hide unreadable"/></entry>
654 Prevents clients from seeing the existence of files that cannot be read.
658 <entry><smbconfoption name="hide unwriteable files"/></entry>
660 Prevents clients from seeing the existence of files that cannot be written to. Unwriteable directories are shown as usual.
664 <entry><smbconfoption name="nt acl support"/></entry>
666 This parameter controls whether smbd will attempt to map UNIX permissions into Windows NT access control lists.
670 <entry><smbconfoption name="security mask"/></entry>
672 Controls UNIX permission bits modified when a Windows NT client is manipulating the UNIX permissions on a file.
682 <title>Miscellaneous Controls</title>
685 The following are documented because of the prevalence of administrators creating inadvertent barriers to file
686 access by not understanding the full implications of &smb.conf; file settings. See <link linkend="mcoc">following table</link>.
689 <table frame='all' id="mcoc"><title>Other Controls</title>
691 <colspec align="justify" colwidth="1*"/>
692 <colspec align="justify" colwidth="1*"/>
695 <entry align="center">Control Parameter</entry>
696 <entry align="center">Description - Action - Notes</entry>
702 <smbconfoption name="case sensitive"/>,
703 <smbconfoption name="default case"/>,
704 <smbconfoption name="short preserve case"/>
707 This means that all file name lookup will be done in a case sensitive manner.
708 Files will be created with the precise file name Samba received from the MS Windows client.
712 <entry><smbconfoption name="csc policy"/></entry>
714 Client Side Caching Policy - parallels MS Windows client side file caching capabilities.
718 <entry><smbconfoption name="dont descend"/></entry>
720 Allows specifying a comma-delimited list of directories that the server should always show as empty.
724 <entry><smbconfoption name="dos filetime resolution"/></entry>
726 This option is mainly used as a compatibility option for Visual C++ when used against Samba shares.
730 <entry><smbconfoption name="dos filetimes"/></entry>
732 DOS and Windows allow users to change file time stamps if they can write to the file. POSIX semantics prevent this.
733 This option allows DOS and Windows behavior.
737 <entry><smbconfoption name="fake oplocks"/></entry>
739 Oplocks are the way that SMB clients get permission from a server to locally cache file operations. If a server grants an
740 oplock, the client is free to assume that it is the only one accessing the file and it will aggressively cache file data.
745 <smbconfoption name="hide dot files"/>,
746 <smbconfoption name="hide files"/>,
747 <smbconfoption name="veto files"/>
750 Note: MS Windows Explorer allows over-ride of files marked as hidden so they will still be visible.
754 <entry><smbconfoption name="read only"/></entry>
756 If this parameter is yes, then users of a service may not create or modify files in the service's directory.
760 <entry><smbconfoption name="veto files"/></entry>
762 List of files and directories that are neither visible nor accessible.
774 <title>Access Controls on Shares</title>
778 <indexterm><primary>permissions</primary><secondary>share ACLs</secondary></indexterm>
779 This section deals with how to configure Samba per share access control restrictions.
780 By default, Samba sets no restrictions on the share itself. Restrictions on the share itself
781 can be set on MS Windows NT4/200x/XP shares. This can be an effective way to limit who can
782 connect to a share. In the absence of specific restrictions the default setting is to allow
783 the global user <constant>Everyone - Full Control</constant> (full control, change and read).
787 At this time Samba does not provide a tool for configuring access control setting on the share
788 itself. Samba does have the capacity to store and act on access control settings, but the only
789 way to create those settings is to use either the NT4 Server Manager or the Windows 200x MMC for
794 Samba stores the per share access control settings in a file called <filename>share_info.tdb</filename>.
795 The location of this file on your system will depend on how Samba was compiled. The default location
796 for Samba's tdb files is under <filename>/usr/local/samba/var</filename>. If the <filename>tdbdump</filename>
797 utility has been compiled and installed on your system, then you can examine the contents of this file
798 by executing: <command>tdbdump share_info.tdb</command> in the directory containing the tdb files.
802 <title>Share Permissions Management</title>
805 The best tool for the task is platform dependant. Choose the best tool for your environment.
809 <title>Windows NT4 Workstation/Server</title>
811 The tool you need to use to manage share permissions on a Samba server is the NT Server Manager.
812 Server Manager is shipped with Windows NT4 Server products but not with Windows NT4 Workstation.
813 You can obtain the NT Server Manager for MS Windows NT4 Workstation from Microsoft &smbmdash; see details below.
817 <title>Instructions</title>
819 Launch the <application>NT4 Server Manager</application>, click on the Samba server you want to administer. From the menu
820 select <guimenu>Computer</guimenu>, then click on <guimenuitem>Shared Directories</guimenuitem>.
824 Click on the share that you wish to manage, then click the <guilabel>Properties</guilabel> tab. then click
825 the <guilabel>Permissions</guilabel> tab. Now you can add or change access control settings as you wish.
832 <title>Windows 200x/XP</title>
835 On <application>MS Windows NT4/200x/XP</application> system access control lists on the share itself are set using native
836 tools, usually from File Manager. For example, in Windows 200x, right click on the shared folder,
837 then select <guimenuitem>Sharing</guimenuitem>, then click on <guilabel>Permissions</guilabel>. The default
838 Windows NT4/200x permission allows <quote>Everyone</quote> full control on the share.
842 MS Windows 200x and later versions come with a tool called the <application>Computer Management</application> snap-in for the
843 Microsoft Management Console (MMC). This tool is located by clicking on <guimenu>Control Panel ->
844 Administrative Tools -> Computer Management</guimenu>.
848 <title>Instructions</title>
850 After launching the MMC with the Computer Management snap-in, click the menu item <guimenuitem>Action</guimenuitem>,
851 and select <guilabel>Connect to another computer</guilabel>. If you are not logged onto a domain you will be prompted
852 to enter a domain login user identifier and a password. This will authenticate you to the domain.
853 If you are already logged in with administrative privilege, this step is not offered.
857 If the Samba server is not shown in the <guilabel>Select Computer</guilabel> box, type in the name of the target
858 Samba server in the field <guilabel>Name:</guilabel>. Now click the on <guibutton>[+]</guibutton> next to
859 <guilabel>System Tools</guilabel>, then on the <guibutton>[+]</guibutton> next to <guilabel>Shared Folders</guilabel> in the
864 In the right panel, double-click on the share on which you wish to set access control permissions.
865 Then click the tab <guilabel>Share Permissions</guilabel>. It is now possible to add access control entities
866 to the shared folder. Remember to set what type of access (full control, change, read) you
867 wish to assign for each entry.
873 Be careful. If you take away all permissions from the <constant>Everyone</constant> user without removing this user,
874 effectively no user will be able to access the share. This is a result of what is known as
875 ACL precedence. Everyone with <emphasis>no access</emphasis> means that <constant>MaryK</constant> who is part of the group
876 <constant>Everyone</constant> will have no access even if she is given explicit full control access.
886 <title>MS Windows Access Control Lists and UNIX Interoperability</title>
889 <title>Managing UNIX Permissions Using NT Security Dialogs</title>
893 <indexterm><primary>permissions</primary><secondary>file/directory ACLs</secondary></indexterm>
894 Windows NT clients can use their native security settings dialog box to view and modify the
895 underlying UNIX permissions.
899 This ability is careful not to compromise the security of the UNIX host on which Samba is running, and
900 still obeys all the file permission rules that a Samba administrator can set.
904 Samba does not attempt to go beyond POSIX ACLs, so the various finer-grained access control
905 options provided in Windows are actually ignored.
910 All access to UNIX/Linux system files via Samba is controlled by the operating system file access controls.
911 When trying to figure out file access problems, it is vitally important to find the identity of the Windows
912 user as it is presented by Samba at the point of file access. This can best be determined from the
919 <title>Viewing File Security on a Samba Share</title>
922 From an NT4/2000/XP client, right click on any file or directory in a Samba-mounted drive letter
923 or UNC path. When the menu pops up, click on the <guilabel>Properties</guilabel> entry at the bottom
924 of the menu. This brings up the file <constant>Properties</constant> dialog box. Click on the
925 <guilabel>Security</guilabel> tab and you will see three buttons: <guibutton>Permissions</guibutton>,
926 <guibutton>Auditing</guibutton>, and <guibutton>Ownership</guibutton>. The <guibutton>Auditing</guibutton>
927 button will cause either an error message <errorname>`A requested privilege is not held by the client'</errorname>
928 to appear if the user is not the NT Administrator, or a dialog which is intended to allow an Administrator
929 to add auditing requirements to a file if the user is logged on as the NT Administrator. This dialog is
930 non-functional with a Samba share at this time, as the only useful button, the <guibutton>Add</guibutton>
931 button, will not currently allow a list of users to be seen.
937 <title>Viewing File Ownership</title>
940 Clicking on the <guibutton>Ownership</guibutton> button brings up a dialog box telling you who owns
941 the given file. The owner name will be displayed like this:
945 <constant>SERVER\user (Long name)</constant>
949 <replaceable>SERVER</replaceable> is the NetBIOS name of the Samba server, <replaceable>user</replaceable>
950 is the user name of the UNIX user who owns the file, and <replaceable>(Long name)</replaceable> is the
951 descriptive string identifying the user (normally found in the GECOS field of the UNIX password database).
952 Click on the <guibutton>Close </guibutton> button to remove this dialog.
956 If the parameter <smbconfoption name="nt acl support"/> is set to <constant>false</constant>,
957 the file owner will be shown as the NT user <emphasis>Everyone</emphasis>.
961 The <guibutton>Take Ownership</guibutton> button will not allow you to change the ownership of this file to
962 yourself (clicking it will display a dialog box complaining that the user you are currently logged onto
963 the NT client cannot be found). The reason for this is that changing the ownership of a file is a privileged
964 operation in UNIX, available only to the <emphasis>root</emphasis> user. As clicking on this button causes
965 NT to attempt to change the ownership of a file to the current user logged into the NT client, this will
966 not work with Samba at this time.</para>
969 There is an NT <command>chown</command> command that will work with Samba and allow a user with Administrator privilege connected
970 to a Samba server as root to change the ownership of files on both a local NTFS filesystem or remote mounted NTFS
971 or Samba drive. This is available as part of the <application>Seclib</application> NT security library written
972 by Jeremy Allison of the Samba Team, and is available from the main Samba FTP site.</para>
977 <title>Viewing File or Directory Permissions</title>
980 The third button is the <guibutton>Permissions</guibutton> button. Clicking on this brings up a dialog box
981 that shows both the permissions and the UNIX owner of the file or directory. The owner is displayed like this:
984 <para><command><replaceable>SERVER</replaceable>\
985 <replaceable>user</replaceable>
986 <replaceable>(Long name)</replaceable></command></para>
988 <para>Where <replaceable>SERVER</replaceable> is the NetBIOS name of the Samba server,
989 <replaceable>user</replaceable> is the user name of the UNIX user who owns the file, and
990 <replaceable>(Long name)</replaceable> is the descriptive string identifying the user (normally found in the
991 GECOS field of the UNIX password database).</para>
994 If the parameter <smbconfoption name="nt acl support"/> is set to <constant>false</constant>,
995 the file owner will be shown as the NT user <constant>Everyone</constant> and the permissions will be
996 shown as NT <quote>Full Control</quote>.
1001 The permissions field is displayed differently for files and directories, both are discussed here:
1005 <title>File Permissions</title>
1007 <para>The standard UNIX user/group/world triplet and the corresponding <constant>read, write, execute</constant> permissions
1008 triplets are mapped by Samba into a three element NT ACL with the <quote>r</quote>, <quote>w</quote> and <quote>x</quote> bits mapped into the corresponding
1009 NT permissions. The UNIX world permissions are mapped into the global NT group <constant>Everyone</constant>, followed
1010 by the list of permissions allowed for the UNIX world. The UNIX owner and group permissions are displayed as an NT
1011 <guiicon>user</guiicon> icon and an NT <guiicon>local group</guiicon> icon, respectively, followed by the list
1012 of permissions allowed for the UNIX user and group.</para>
1014 <para>Because many UNIX permission sets do not map into common NT names such as <constant>read</constant>,
1015 <constant>change</constant> or <constant>full control</constant>, usually the permissions will be prefixed
1016 by the words <constant>Special Access</constant> in the NT display list.</para>
1018 <para>But what happens if the file has no permissions allowed for a particular UNIX user group or world component? In order
1019 to allow <quote>no permissions</quote> to be seen and modified Samba then overloads the NT <constant>Take Ownership</constant> ACL attribute
1020 (which has no meaning in UNIX) and reports a component with no permissions as having the NT <command>O</command> bit set.
1021 This was chosen, of course, to make it look like a zero, meaning zero permissions. More details on the decision behind this is
1026 <title>Directory Permissions</title>
1028 <para>Directories on an NT NTFS file system have two different sets of permissions. The first set is the ACL set on the
1029 directory itself, which is usually displayed in the first set of parentheses in the normal <constant>RW</constant>
1030 NT style. This first set of permissions is created by Samba in exactly the same way as normal file permissions are, described
1031 above, and is displayed in the same way.</para>
1033 <para>The second set of directory permissions has no real meaning in the UNIX permissions world and represents the <constant>
1034 inherited</constant> permissions that any file created within this directory would inherit.</para>
1036 <para>Samba synthesizes these inherited permissions for NT by returning as an NT ACL the UNIX permission mode that a new file
1037 created by Samba on this share would receive.</para>
1042 <title>Modifying File or Directory Permissions</title>
1044 <para>Modifying file and directory permissions is as simple
1045 as changing the displayed permissions in the dialog box, and
1046 clicking on <guibutton>OK</guibutton>. However, there are
1047 limitations that a user needs to be aware of, and also interactions
1048 with the standard Samba permission masks and mapping of DOS
1049 attributes that need to also be taken into account.</para>
1051 <para>If the parameter <smbconfoption name="nt acl support"/>
1052 is set to <constant>false</constant>, any attempt to set
1053 security permissions will fail with an <errorname>`Access Denied'
1054 </errorname> message.</para>
1056 <para>The first thing to note is that the <guibutton>Add</guibutton>
1057 button will not return a list of users in Samba (it will give
1058 an error message saying <errorname>`The remote procedure call failed
1059 and did not execute'</errorname>). This means that you can only
1060 manipulate the current user/group/world permissions listed in
1061 the dialog box. This actually works quite well as these are the
1062 only permissions that UNIX actually has.</para>
1064 <para>If a permission triplet (either user, group, or world)
1065 is removed from the list of permissions in the NT dialog box,
1066 then when the <guibutton>OK</guibutton> button is pressed it will
1067 be applied as <quote>no permissions</quote> on the UNIX side. If you then
1068 view the permissions again, the <quote>no permissions</quote> entry will appear
1069 as the NT <command>O</command> flag, as described above. This
1070 allows you to add permissions back to a file or directory once
1071 you have removed them from a triplet component.</para>
1073 <para>As UNIX supports only the <quote>r</quote>, <quote>w</quote> and <quote>x</quote> bits of
1074 an NT ACL, if other NT security attributes such as <constant>Delete Access</constant> are
1075 selected they will be ignored when applied on the Samba server.</para>
1077 <para>When setting permissions on a directory, the second
1078 set of permissions (in the second set of parentheses) is
1079 by default applied to all files within that directory. If this
1080 is not what you want, you must un-check the <guilabel>Replace
1081 permissions on existing files</guilabel> check-box in the NT
1082 dialog before clicking on <guibutton>OK</guibutton>.</para>
1084 <para>If you wish to remove all permissions from a
1085 user/group/world component, you may either highlight the
1086 component and click on the <guibutton>Remove</guibutton> button,
1087 or set the component to only have the special <constant>Take
1088 Ownership</constant> permission (displayed as <command>O
1089 </command>) highlighted.</para>
1093 <title>Interaction with the Standard Samba <quote>create mask</quote> Parameters</title>
1095 <para>There are four parameters that control interaction with the standard Samba <parameter>create mask</parameter> parameters.
1099 <listitem><para><smbconfoption name="security mask"/></para></listitem>
1100 <listitem><para><smbconfoption name="force security mode"/></para></listitem>
1101 <listitem><para><smbconfoption name="directory security mask"/></para></listitem>
1102 <listitem><para><smbconfoption name="force directory security mode"/></para></listitem>
1107 <para>When a user clicks on <guibutton>OK</guibutton> to apply the
1108 permissions, Samba maps the given permissions into a user/group/world
1109 r/w/x triplet set, and then checks the changed permissions for a
1110 file against the bits set in the
1111 <smbconfoption name="security mask"/> parameter. Any bits that
1112 were changed that are not set to <quote>1</quote> in this parameter are left alone
1113 in the file permissions.</para>
1115 <para>Essentially, zero bits in the <smbconfoption name="security mask"/>
1116 may be treated as a set of bits the user is <emphasis>not</emphasis>
1117 allowed to change, and one bits are those the user is allowed to change.
1120 <para>If not explicitly set, this parameter defaults to the same value as
1121 the <smbconfoption name="create mask"/> parameter. To allow a user to modify all the
1122 user/group/world permissions on a file, set this parameter to 0777.
1125 <para>Next Samba checks the changed permissions for a file against the bits set in the
1126 <smbconfoption name="force security mode"/> parameter. Any bits
1127 that were changed that correspond to bits set to <quote>1</quote> in this parameter
1128 are forced to be set.</para>
1130 <para>Essentially, bits set in the <parameter>force security mode</parameter> parameter
1131 may be treated as a set of bits that, when modifying security on a file, the user has always set to be <quote>on</quote>.</para>
1133 <para>If not explicitly set, this parameter defaults to the same value
1134 as the <smbconfoption name="force create mode"/> parameter.
1135 To allow a user to modify all the user/group/world permissions on a file
1136 with no restrictions set this parameter to 000. The
1137 <smbconfoption name="security mask"/> and <parameter>force
1138 security mode</parameter> parameters are applied to the change
1139 request in that order.</para>
1141 <para>For a directory, Samba will perform the same operations as
1142 described above for a file except it uses the parameter <parameter>
1143 directory security mask</parameter> instead of <parameter>security
1144 mask</parameter>, and <parameter>force directory security mode
1145 </parameter> parameter instead of <parameter>force security mode
1146 </parameter>.</para>
1148 <para>The <smbconfoption name="directory security mask"/> parameter
1149 by default is set to the same value as the <parameter>directory mask
1150 </parameter> parameter and the <parameter>force directory security
1151 mode</parameter> parameter by default is set to the same value as
1152 the <smbconfoption name="force directory mode"/> parameter.
1153 In this way Samba enforces the permission restrictions that
1154 an administrator can set on a Samba share, while still allowing users
1155 to modify the permission bits within that restriction.</para>
1157 <para>If you want to set up a share that allows users full control
1158 in modifying the permission bits on their files and directories and
1159 does not force any particular bits to be set <quote>on</quote>, then set the following
1160 parameters in the &smb.conf; file in that share-specific section:
1164 <smbconfoption name="security mask">0777</smbconfoption>
1165 <smbconfoption name="force security mode">0</smbconfoption>
1166 <smbconfoption name="directory security mask">0777</smbconfoption>
1167 <smbconfoption name="force directory security mode">0</smbconfoption>
1172 <title>Interaction with the Standard Samba File Attribute Mapping</title>
1175 <para>Samba maps some of the DOS attribute bits (such as <quote>read
1176 only</quote>) into the UNIX permissions of a file. This means there can
1177 be a conflict between the permission bits set via the security
1178 dialog and the permission bits set by the file attribute mapping.
1182 <para>If a file has no UNIX read access for the owner, it will show up
1183 as <quote>read only</quote> in the standard file attributes tabbed dialog.
1184 Unfortunately, this dialog is the same one that contains the security information
1185 in another tab.</para>
1187 <para>What this can mean is that if the owner changes the permissions
1188 to allow himself read access using the security dialog, clicks on
1189 <guibutton>OK</guibutton> to get back to the standard attributes tab
1190 dialog, and clicks on <guibutton>OK</guibutton> on that dialog, then
1191 NT will set the file permissions back to read-only (as that is what
1192 the attributes still say in the dialog). This means that after setting
1193 permissions and clicking on <guibutton>OK</guibutton> to get back to the
1194 attributes dialog, you should always press <guibutton>Cancel</guibutton>
1195 rather than <guibutton>OK</guibutton> to ensure that your changes
1196 are not overridden.</para>
1200 <title>Windows NT/200X ACLS and POSIX ACLS &smbmdash; Limitations</title>
1203 Windows administrators are familiar with simple ACL controls and they typically
1204 consider that UNIX user/group/other (ugo) permissions are inadequate and not
1205 sufficiently fine-grained.
1209 Competing SMB implementations differ in how they handle Windows ACLs. Samba handles
1210 Windows ACLs from the perspective of UNIX file system adminsitration and thus adopts
1211 the limitations of POSIX ACLs. Therefore, where POSIX ACLs lack a capability of the
1212 Windows NT/200X ACLs, the POSIX semantics and limitations are imposed on the Windows
1217 POSIX ACLs present an interesting challenge to the UNIX adminsitrator and therfore a
1218 force a compromise to be applied to Windows ACLs administration. POSIX ACLs are not
1219 covered by an official standard, rather the latest standard is a draft standard
1220 1003.1e revision 17. This is the POSIX document on which the Samba implementation has
1225 UNIX vendors differ in the manner in which POSIX ACLs are implemented. There are a
1226 number of Linux file systems that support ACLs. Samba has to provide a way to make
1227 transparent all the differences between the various implementations of POSIX ACLs.
1228 The pressure for ACLs support in Samba has noticibly increased the pressure to
1229 standardize ACLs support in the UNIX world.
1233 Samba has to deal with the complicated matter of handling the challenge of the Windows
1234 ACL that implements <emphasis>inheritance</emphasis>, a concept not anticipated by POSIX
1235 ACLs as implemented in UNIX file systems. Samba provides support for <emphasis>masks</emphasis>
1236 that permit normal ugo and ACLs functionality to be overrided. This further complicates
1237 the way in which Windows ACLs must be implemented.
1241 <title>UNIX POSIX ACL Overview</title>
1244 In examining POSIX ACLs we must consider the manner in which they operate for
1245 both files and directories. File ACLs have the following significance:
1247 # file: testfile <- the file name
1248 # owner: jeremy <-- the file owner
1249 # group: users <-- the POSIX group owner
1250 user::rwx <-- perms for the file owner (user)
1251 user:tpot:r-x <-- perms for the additional user 'tpot'
1252 group::r-- <-- perms for the file group owner (group)
1253 group:engrs:r-- <-- perms for the additonal group 'engineers'
1254 mask:rwx <-- the mask that is 'ANDed' with groups
1255 other::--- <-- perms applied to everyone else (other)
1257 Directory ACLs have the following signficance:
1259 # file: testdir <-- the directory name
1260 # owner: jeremy <-- the directory owner
1261 # group: jeremy <-- the POSIX group owner
1262 user::rwx <-- directory perms for owner (user)
1263 group::rwx <-- directory perms for owning group (group)
1264 mask::rwx <-- the mask that is 'ANDed' with group perms
1265 other:r-x <-- perms applied to everyone else (other)
1266 default:user::rwx <-- inherited owner perms
1267 default:user:tpot:rwx <-- inherited extra perms for user 'tpot'
1268 default:group::r-x <-- inherited group perms
1269 default:mask:rwx <-- inherited default mask
1270 default:other:--- <-- inherited permissions for everyone (other)
1277 <title>Mapping of Windows File ACLs to UNIX POSIX ACLs</title>
1280 Microsoft Windows NT4/200X ACLs must of necessity be mapped to POSIX ACLs.
1281 The mappings for file permissions are shown in <link linkend="fdsacls"/>.
1282 The '#' character means this flag is set only when the Windows administrator
1283 sets the <constant>Full Control</constant> flag on the file.
1286 <table frame='all' pgwide='0' id="fdsacls"><title>How Windows File ACLs Map to UNIX POSIX File ACLs</title>
1288 <colspec align="left"/>
1289 <colspec align="center"/>
1292 <entry align="left">Windows ACE</entry>
1293 <entry align="center">File Attribute Flag</entry>
1298 <entry><para>Full Control</para></entry>
1299 <entry><para>#</para></entry>
1302 <entry><para>Traverse Folder / Execute File</para></entry>
1303 <entry><para>x</para></entry>
1306 <entry><para>List Folder / Read Data</para></entry>
1307 <entry><para>r</para></entry>
1310 <entry><para>Read Attributes</para></entry>
1311 <entry><para>r</para></entry>
1314 <entry><para>Read Extended Attribures</para></entry>
1315 <entry><para>r</para></entry>
1318 <entry><para>Create Files / Write Data</para></entry>
1319 <entry><para>w</para></entry>
1322 <entry><para>Create Folders / Append Data</para></entry>
1323 <entry><para>w</para></entry>
1326 <entry><para>Write Attributes</para></entry>
1327 <entry><para>w</para></entry>
1330 <entry><para>Write Extended Attributes</para></entry>
1331 <entry><para>w</para></entry>
1334 <entry><para>Delete Subfolders and Files</para></entry>
1335 <entry><para>w</para></entry>
1338 <entry><para>Delete</para></entry>
1339 <entry><para>#</para></entry>
1342 <entry><para>Read Permissions</para></entry>
1343 <entry><para>all</para></entry>
1346 <entry><para>Change Permissions</para></entry>
1347 <entry><para>#</para></entry>
1350 <entry><para>Take Ownership</para></entry>
1351 <entry><para>#</para></entry>
1358 As can be seen from the mapping table, there is no 1:1 mapping capability and therefore
1359 Samba must make a logical mapping that will permit Windows to operate more-or-less the way
1360 that is intended by the Administrator.
1364 In general the mapping of UNIX POSIX user/group/other permissions will be mapped to
1365 Windows ALCs. This has precidence over the creation of POSIX ACLs. POSIX ACLs are necessary
1366 to establish access controls for users and groups other than the user and group that
1367 own the file or directory.
1371 The UNIX administrator can set any directory permission from within the UNIX environment.
1372 The Windows administrator is more restricted in that it is not possible from within the
1373 Windows Explorer to remove read permission for the file owner.
1379 <title>Mapping of Windows Directory ACLs to UNIX POSIX ACLs</title>
1382 Interesting things happen in the mapping of UNIX POSIX directory permissions as well
1383 as UNIX POSIX ACLs to Windows ACEs (Access Control Entries, the discrete component of
1384 an Access Control List (ACL), are mapped to Windows directory ACLs.
1388 Directory permissions function in much the same way as shown for file permissions, but
1389 there are some notable exceptions and a few peculiarities that the astute administrator
1390 will want to take into account in the setting up of directory permissions.
1399 <title>Common Errors</title>
1402 File, directory and share access problems are common on the mailing list. The following
1403 are examples taken from the mailing list in recent times.
1408 <title>Users Cannot Write to a Public Share</title>
1412 We are facing some troubles with file/directory permissions. I can log on the domain as admin user(root),
1413 and there's a public share on which everyone needs to have permission to create/modify files, but only
1414 root can change the file, no one else can. We need to constantly go to the server to
1415 <userinput>chgrp -R users *</userinput> and <userinput>chown -R nobody *</userinput> to allow others users to change the file.
1420 There are many ways to solve this problem and here are a few hints:
1426 Go to the top of the directory that is shared.
1432 Set the ownership to what ever public owner and group you want
1434 &prompt;find 'directory_name' -type d -exec chown user.group {}\;
1435 &prompt;find 'directory_name' -type d -exec chmod 1775 'directory_name'
1436 &prompt;find 'directory_name' -type f -exec chmod 0775 {} \;
1437 &prompt;find 'directory_name' -type f -exec chown user.group {}\;
1442 The above will set the <constant>sticky bit</constant> on all directories. Read your
1443 UNIX/Linux man page on what that does. It causes the OS to assign
1444 to all files created in the directories the ownership of the
1451 Directory is: <replaceable>/foodbar</replaceable>
1453 &prompt;<userinput>chown jack.engr /foodbar</userinput>
1458 <para>This is the same as doing:</para>
1460 &prompt;<userinput>chown jack /foodbar</userinput>
1461 &prompt;<userinput>chgrp engr /foodbar</userinput>
1469 &prompt;<userinput>chmod 6775 /foodbar</userinput>
1470 &prompt;<userinput>ls -al /foodbar/..</userinput>
1475 <para>You should see:
1477 drwsrwsr-x 2 jack engr 48 2003-02-04 09:55 foodbar
1485 &prompt;<userinput>su - jill</userinput>
1486 &prompt;<userinput>cd /foodbar</userinput>
1487 &prompt;<userinput>touch Afile</userinput>
1488 &prompt;<userinput>ls -al</userinput>
1493 You should see that the file <filename>Afile</filename> created by Jill will have ownership
1494 and permissions of Jack, as follows:
1496 -rw-r--r-- 1 jack engr 0 2003-02-04 09:57 Afile
1503 Now in your &smb.conf; for the share add:
1505 <smbconfoption name="force create mode">0775</smbconfoption>
1506 <smbconfoption name="force directory mode">6775</smbconfoption>
1511 These procedures are needed only if your users are not members of the group
1512 you have used. That is if within the OS do not have write permission on the directory.
1517 An alternative is to set in the &smb.conf; entry for the share:
1519 <smbconfoption name="force user">jack</smbconfoption>
1520 <smbconfoption name="force group">engr</smbconfoption>
1529 <title>File Operations Done as <emphasis>root</emphasis> with <emphasis>force user</emphasis> Set</title>
1532 When you have a user in <smbconfoption name="admin users"/>, Samba will always do file operations for
1533 this user as <emphasis>root</emphasis>, even if <smbconfoption name="force user"/> has been set.
1538 <title>MS Word with Samba Changes Owner of File</title>
1541 <emphasis>Question:</emphasis> <quote>When user B saves a word document that is owned by user A the updated file is now owned by user B.
1542 Why is Samba doing this? How do I fix this?</quote>
1546 <emphasis>Answer:</emphasis> Word does the following when you modify/change a Word document: MS Word creates a NEW document with
1547 a temporary name, Word then closes the old document and deletes it, Word then renames the new document to the original document name.
1548 There is no mechanism by which Samba can in any way know that the new document really should be owned by the owners
1549 of the original file. Samba has no way of knowing that the file will be renamed by MS Word. As far as Samba is able
1550 to tell, the file that gets created is a NEW file, not one that the application (Word) is updating.
1554 There is a work-around to solve the permissions problem. That work-around involves understanding how you can manage file
1555 system behavior from within the &smb.conf; file, as well as understanding how UNIX file systems work. Set on the directory
1556 in which you are changing Word documents: <command>chmod g+s `directory_name'</command> This ensures that all files will
1557 be created with the group that owns the directory. In &smb.conf; share declaration section set:
1562 <smbconfoption name="force create mode">0660</smbconfoption>
1563 <smbconfoption name="force directory mode">0770</smbconfoption>
1568 These two settings will ensure that all directories and files that get created in the share will be read/writable by the
1569 owner and group set on the directory itself.