From 99bde6889d3d8b7a9e950c86c30e82662e1dacdd Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Tue, 9 Sep 2003 02:58:53 +0000 Subject: syncing files from 3.0 into HEAD again (This used to be commit bca0bba209255d0effbae6a3d3b6d298f0952c3a) --- docs/docbook/projdoc/AccessControls.xml | 579 +++++++++++++++++--------------- 1 file changed, 302 insertions(+), 277 deletions(-) (limited to 'docs/docbook/projdoc/AccessControls.xml') diff --git a/docs/docbook/projdoc/AccessControls.xml b/docs/docbook/projdoc/AccessControls.xml index 44780501fe..344e51e5c0 100644 --- a/docs/docbook/projdoc/AccessControls.xml +++ b/docs/docbook/projdoc/AccessControls.xml @@ -2,20 +2,21 @@ &author.jht; &author.jeremy; + &person.jelmer;drawing May 10, 2003 File, Directory and Share Access Controls +ACLs Advanced MS Windows users are frequently perplexed when file, directory and share manipulation of resources shared via Samba do not behave in the manner they might expect. MS Windows network -administrators are often confused regarding network access controls and what is the best way to -provide users with the type of access they need while protecting resources from the consequences -of untoward access capabilities. +administrators are often confused regarding network access controls and how to +provide users with the access they need while protecting resources from unauthorised access. -Unix administrators frequently are not familiar with the MS Windows environment and in particular +Many UNIX administrators are unfamiliar with the MS Windows environment and in particular have difficulty in visualizing what the MS Windows user wishes to achieve in attempts to set file and directory access permissions. @@ -23,12 +24,13 @@ and directory access permissions. The problem lies in the differences in how file and directory permissions and controls work between the two environments. This difference is one that Samba can not completely hide, even -though it does try to make the chasm transparent. +though it does try to bridge the chasm to a degree. +Extended Attributes POSIX Access Control List technology has been available (along with Extended Attributes) -for Unix for many years, yet there is little evidence today of any significant use. This +for UNIX for many years, yet there is little evidence today of any significant use. This explains to some extent the slow adoption of ACLs into commercial Linux products. MS Windows administrators are astounded at this given that ACLs were a foundational capability of the now decade old MS Windows NT operating system. @@ -41,12 +43,11 @@ for delivering the best environment for MS Windows desktop users. -This is an opportune point to mention that it should be borne in mind that Samba was created to -provide a means of interoperability and interchange of data between two operating environments -that are quite different. It was never the intent to make Unix/Linux like MS Windows NT. Instead -the purpose was an is to provide a sufficient level of exchange of data between the two environments. -What is available today extends well beyond early plans and expectations, yet the gap continues to -shrink. +This is an opportune point to mention that Samba was created to provide a means of interoperability +and interchange of data between differing operating environments. Samba has no intent change +UNIX/Linux into a platform like MS Windows. Instead the purpose was and is to provide a sufficient +level of exchange of data between the two environments. What is available today extends well +beyond early plans and expectations, yet the gap continues to shrink. @@ -60,17 +61,17 @@ shrink. Samba Access Control Facilities - Unix File and Directory Permissions + UNIX File and Directory Permissions - Samba honours and implements Unix file system access controls. Users + Samba honours and implements UNIX file system access controls. Users who access a Samba server will do so as a particular MS Windows user. This information is passed to the Samba server as part of the logon or connection setup process. Samba uses this user identity to validate whether or not the user should be given access to file system resources (files and directories). This chapter provides an overview for those - to whom the Unix permissions and controls are a little strange or unknown. + to whom the UNIX permissions and controls are a little strange or unknown. @@ -102,13 +103,13 @@ shrink. - MS Windows ACLs through Unix POSIX ACLs + MS Windows ACLs through UNIX POSIX ACLs - The use of POSIX ACLs on Unix/Linux is possible ONLY if the underlying + The use of POSIX ACLs on UNIX/Linux is possible ONLY if the underlying operating system supports them. If not, then this option will not be - available to you. Current Unix technology platforms have native support + available to you. Current UNIX technology platforms have native support for POSIX ACLs. There are patches for the Linux kernel that provide this also. Sadly, few Linux platforms ship today with native ACLs and Extended Attributes enabled. This chapter has pertinent information @@ -124,16 +125,18 @@ shrink. Perhaps the most important recognition to be made is the simple fact that MS Windows NT4 / 200x / XP -implement a totally divergent file system technology from what is provided in the Unix operating system +implement a totally divergent file system technology from what is provided in the UNIX operating system environment. Firstly we should consider what the most significant differences are, then we shall look at how Samba helps to bridge the differences. +NTFS +File System - MS Windows NTFS Comparison with Unix File Systems + MS Windows NTFS Comparison with UNIX File Systems - Samba operates on top of the Unix file system. This means it is subject to Unix file system conventions + Samba operates on top of the UNIX file system. This means it is subject to UNIX file system conventions and permissions. It also means that if the MS Windows networking environment requires file system behaviour that differs from unix file system behaviour then somehow Samba is responsible for emulating that in a transparent and consistent manner. @@ -152,12 +155,12 @@ at how Samba helps to bridge the differences. Name Space - MS Windows NT4 / 200x/ XP files names may be up to 254 characters long, Unix file names + MS Windows NT4 / 200x/ XP files names may be up to 254 characters long, UNIX file names may be 1023 characters long. In MS Windows file extensions indicate particular file types, - in Unix this is not so rigorously observed as all names are considered arbitrary. + in UNIX this is not so rigorously observed as all names are considered arbitrary. - What MS Windows calls a Folder, Unix calls a directory, + What MS Windows calls a Folder, UNIX calls a directory. @@ -166,25 +169,26 @@ at how Samba helps to bridge the differences. Case Sensitivity - MS Windows file names are generally Upper Case if made up of 8.3 (ie: 8 character file name + 8.3file names + MS Windows file names are generally upper case if made up of 8.3 (ie: 8 character file name and 3 character extension. If longer than 8.3 file names are Case Preserving, and Case Insensitive. - Unix file and directory names are Case Sensitive and Case Preserving. Samba implements the - MS Windows file name behaviour, but it does so as a user application. The Unix file system + UNIX file and directory names are case sensitive and case preserving. Samba implements the + MS Windows file name behaviour, but it does so as a user application. The UNIX file system provides no mechanism to perform case insensitive file name lookups. MS Windows does this by default. This means that Samba has to carry the processing overhead to provide features - that are NOT native to the Unix operating system environment. + that are NOT native to the UNIX operating system environment. - Consider the following, all are unique Unix names but one single MS Windows file name: + Consider the following, all are unique UNIX names but one single MS Windows file name: MYFILE.TXT MyFile.txt myfile.txt - So clearly, In an MS Windows file name space these three files CAN NOT co-exist! But in Unix + So clearly, In an MS Windows file name space these three files CAN NOT co-exist! But in UNIX they can. So what should Samba do if all three are present? Answer, the one that is lexically first will be accessible to MS Windows users, the others are invisible and unaccessible - any other solution would be suicidal. @@ -196,7 +200,7 @@ at how Samba helps to bridge the differences. Directory Separators - MS Windows and DOS uses the back-slash '\' as a directory delimiter, Unix uses the forward-slash '/' + MS Windows and DOS uses the back-slash '\' as a directory delimiter, UNIX uses the forward-slash '/' as it's directory delimiter. This is transparently handled by Samba. @@ -207,9 +211,9 @@ at how Samba helps to bridge the differences. MS Windows products support a notion of drive letters, like C: to represent - disk partitions. Unix has NO concept if separate identifiers for file partitions since each + disk partitions. UNIX has NO concept if separate identifiers for file partitions since each such file system is mounted to become part of the over-all directory tree. - The Unix directory tree begins at '/', just like the root of a DOS drive is specified like + The UNIX directory tree begins at '/', just like the root of a DOS drive is specified like C:\. @@ -219,9 +223,9 @@ at how Samba helps to bridge the differences. File Naming Conventions - MS Windows generally never experiences file names that begin with a '.', while in Unix these + MS Windows generally never experiences file names that begin with a '.', while in UNIX these are commonly found in a user's home directory. Files that begin with a '.' are typically - either start up files for various Unix applications, or they may be files that contain + either start up files for various UNIX applications, or they may be files that contain start-up configuration data. @@ -231,12 +235,16 @@ at how Samba helps to bridge the differences. Links and Short-Cuts + Linkshard + Linkssoft + Short-Cuts + MS Windows make use of "links and Short-Cuts" that are actually special types of files that will - redirect an attempt to execute the file to the real location of the file. Unix knows of file and directory + redirect an attempt to execute the file to the real location of the file. UNIX knows of file and directory links, but they are entirely different from what MS Windows users are used to. - Symbolic links are files in Unix that contain the actual location of the data (file OR directory). An + Symbolic links are files in UNIX that contain the actual location of the data (file OR directory). An operation (like read or write) will operate directly on the file referenced. Symbolic links are also referred to as 'soft links'. A hard link is something that MS Windows is NOT familiar with. It allows one physical file to be known simultaneously by more than one file name. @@ -247,8 +255,8 @@ at how Samba helps to bridge the differences. There are many other subtle differences that may cause the MS Windows administrator some temporary discomfort - in the process of becoming familiar with Unix/Linux. These are best left for a text that is dedicated to the - purpose of Unix/Linux training/education. + in the process of becoming familiar with UNIX/Linux. These are best left for a text that is dedicated to the + purpose of UNIX/Linux training/education. @@ -262,7 +270,7 @@ at how Samba helps to bridge the differences. Managing directories with unix and windows - ActionMS Windows CommandUnix Command + ActionMS Windows CommandUNIX Command @@ -281,67 +289,44 @@ at how Samba helps to bridge the differences. The network administrator is strongly advised to read foundational training manuals and reference materials - regarding file and directory permissions maintenance. Much can be achieved with the basic Unix permissions + regarding file and directory permissions maintenance. Much can be achieved with the basic UNIX permissions without having to resort to more complex facilities like POSIX Access Control Lists (ACLs) or Extended Attributes (EAs). - Unix/Linux file and directory access permissions involves setting three (3) primary sets of data and one (1) control set. - A Unix file listing looks as follows:- - - - jht@frodo:~/stuff> ls -la - total 632 - drwxr-xr-x 13 jht users 816 2003-05-12 22:56 . - drwxr-xr-x 37 jht users 3800 2003-05-12 22:29 .. - d--------- 2 jht users 48 2003-05-12 22:29 muchado00 - d--x--x--x 2 jht users 48 2003-05-12 22:29 muchado01 - dr-xr-xr-x 2 jht users 48 2003-05-12 22:29 muchado02 - drwxrwxrwx 2 jht users 48 2003-05-12 22:29 muchado03 - drw-rw-rw- 2 jht users 48 2003-05-12 22:29 muchado04 - d-w--w--w- 2 jht users 48 2003-05-12 22:29 muchado05 - dr--r--r-- 2 jht users 48 2003-05-12 22:29 muchado06 - drwxrwxrwt 2 jht users 48 2003-05-12 22:29 muchado07 - drwsrwsrwx 2 jht users 48 2003-05-12 22:29 muchado08 - ---------- 1 jht users 1242 2003-05-12 22:31 mydata00.lst - ---x--x--x 1 jht users 1674 2003-05-12 22:33 mydata01.lst - --w--w--w- 1 jht users 7754 2003-05-12 22:33 mydata02.lst - --wx-wx-wx 1 jht users 260179 2003-05-12 22:33 mydata03.lst - -r--r--r-- 1 jht users 21017 2003-05-12 22:32 mydata04.lst - -r-xr-xr-x 1 jht users 206339 2003-05-12 22:32 mydata05.lst - -rw-rw-rw- 1 jht users 41105 2003-05-12 22:32 mydata06.lst - -rwxrwxrwx 1 jht users 19312 2003-05-12 22:32 mydata07.lst - jht@frodo:~/stuff> - + UNIX/Linux file and directory access permissions involves setting three (3) primary sets of data and one (1) control set. + A UNIX file listing looks as follows:- + + +&prompt;ls -la +total 632 +drwxr-xr-x 13 maryo gnomes 816 2003-05-12 22:56 . +drwxrwxr-x 37 maryo gnomes 3800 2003-05-12 22:29 .. +dr-xr-xr-x 2 maryo gnomes 48 2003-05-12 22:29 muchado02 +drwxrwxrwx 2 maryo gnomes 48 2003-05-12 22:29 muchado03 +drw-rw-rw- 2 maryo gnomes 48 2003-05-12 22:29 muchado04 +d-w--w--w- 2 maryo gnomes 48 2003-05-12 22:29 muchado05 +dr--r--r-- 2 maryo gnomes 48 2003-05-12 22:29 muchado06 +drwsrwsrwx 2 maryo gnomes 48 2003-05-12 22:29 muchado08 +---------- 1 maryo gnomes 1242 2003-05-12 22:31 mydata00.lst +--w--w--w- 1 maryo gnomes 7754 2003-05-12 22:33 mydata02.lst +-r--r--r-- 1 maryo gnomes 21017 2003-05-12 22:32 mydata04.lst +-rw-rw-rw- 1 maryo gnomes 41105 2003-05-12 22:32 mydata06.lst +&prompt; + - The columns above represent (from left to right): permissions, no blocks used, owner, group, size (bytes), access date, access time, file name. + The columns above represent (from left to right): permissions, number of hard links to file, owner, group, size (bytes), access date, access time, file name. - The permissions field is made up of: - - - JRV: Put this into a diagram of some sort - [ type ] [ users ] [ group ] [ others ] [File, Directory Permissions] - [ d | l ] [ r w x ] [ r w x ] [ r w x ] - | | | | | | | | | | | - | | | | | | | | | | |-----> Can Execute, List files - | | | | | | | | | |-------> Can Write, Create files - | | | | | | | | |---------> Can Read, Read files - | | | | | | | |---------------> Can Execute, List files - | | | | | | |-----------------> Can Write, Create files - | | | | | |-------------------> Can Read, Read files - | | | | |-------------------------> Can Execute, List files - | | | |---------------------------> Can Write, Create files - | | |-----------------------------> Can Read, Read files - | |-----------------------------------> Is a symbolic Link - |---------------------------------------> Is a directory - + An overview of the permissions field can be found in the image below. + Overview of unix permissions fieldaccess1 + Any bit flag may be unset. An unset bit flag is the equivalent of 'Can NOT' and is represented as a '-' character. @@ -357,7 +342,7 @@ at how Samba helps to bridge the differences. - Additional possibilities in the [type] field are: c = character device, b = block device, p = pipe device, s = Unix Domain Socket. + Additional possibilities in the [type] field are: c = character device, b = block device, p = pipe device, s = UNIX Domain Socket. @@ -403,10 +388,10 @@ Before using any of the following options please refer to the man page for &smb. User and group based controls can prove very useful. In some situations it is distinctly desirable to affect all - file system operations as if a single user is doing this, the use of the force user and - force group behaviour will achieve this. In other situations it may be necessary to affect a + file system operations as if a single user is doing this, the use of the force user and + force group behaviour will achieve this. In other situations it may be necessary to affect a paranoia level of control to ensure that only particular authorised persons will be able to access a share or - it's contents, here the use of the valid users or the invalid users may + it's contents, here the use of the valid users or the invalid users may be most useful. @@ -417,8 +402,10 @@ Before using any of the following options please refer to the man page for &smb. Samba being removed and an alternative solution being adopted. - User and Group Based Controls +
User and Group Based Controls + + Control Parameter @@ -427,7 +414,7 @@ Before using any of the following options please refer to the man page for &smb. - admin users + admin users List of users who will be granted administrative privileges on the share. They will do all file operations as the super-user (root). @@ -436,59 +423,59 @@ Before using any of the following options please refer to the man page for &smb. - force group + force group Specifies a UNIX group name that will be assigned as the default primary group for all users connecting to this service. - force user + force user Specifies a UNIX user name that will be assigned as the default user for all users connecting to this service. This is useful for sharing files. Incorrect use can cause security problems. - guest ok + guest ok If this parameter is set for a service, then no password is required to connect to the service. Privileges will be those of the guest account. - invalid users + invalid users List of users that should not be allowed to login to this service. - only user + only user Controls whether connections with usernames not in the user list will be allowed. - read list + read list List of users that are given read-only access to a service. Users in this list will not be given write access, no matter what the read only option is set to. - username + username Refer to the &smb.conf; man page for more information - this is a complex and potentially misused parameter. - valid users + valid users List of users that should be allowed to login to this service. - write list + write list List of users that are given read-write access to a service. @@ -510,7 +497,9 @@ Before using any of the following options please refer to the man page for &smb.
File and Directory Permission Based Controls - + + + Control Parameter @@ -519,67 +508,67 @@ Before using any of the following options please refer to the man page for &smb. - create mask + create mask Refer to the &smb.conf; man page. - directory mask + directory mask The octal modes used when converting DOS modes to UNIX modes when creating UNIX directories. See also: directory security mask. - dos filemode + dos filemode Enabling this parameter allows a user who has write access to the file to modify the permissions on it. - force create mode + force create mode This parameter specifies a set of UNIX mode bit permissions that will always be set on a file created by Samba. - force directory mode + force directory mode This parameter specifies a set of UNIX mode bit permissions that will always be set on a directory created by Samba. - force directory security mode + force directory security mode Controls UNIX permission bits modified when a Windows NT client is manipulating UNIX permissions on a directory - force security mode + force security mode Controls UNIX permission bits modified when a Windows NT client manipulates UNIX permissions. - hide unreadable + hide unreadable Prevents clients from seeing the existence of files that cannot be read. - hide unwriteable files + hide unwriteable files Prevents clients from seeing the existence of files that cannot be written to. Unwriteable directories are shown as usual. - nt acl support + nt acl support This parameter controls whether smbd will attempt to map UNIX permissions into Windows NT access control lists. - security mask + security mask Controls UNIX permission bits modified when a Windows NT client is manipulating the UNIX permissions on a file. @@ -594,12 +583,14 @@ Before using any of the following options please refer to the man page for &smb. Miscellaneous Controls - The following are documented because of the prevalence of administrators creating inadvertant barriers to file + The following are documented because of the prevalence of administrators creating inadvertent barriers to file access by not understanding the full implications of &smb.conf; file settings.
Other Controls + + Control Parameter @@ -608,58 +599,58 @@ Before using any of the following options please refer to the man page for &smb. - case sensitive, default case, short preserve case + case sensitive, default case, short preserve case This means that all file name lookup will be done in a case sensitive manner. Files will be created with the precise filename Samba received from the MS Windows client. - csc policy + csc policy Client Side Caching Policy - parallels MS Windows client side file caching capabilities. - dont descend + dont descend Allows to specify a comma-delimited list of directories that the server should always show as empty. - dos filetime resolution + dos filetime resolution This option is mainly used as a compatibility option for Visual C++ when used against Samba shares. - dos filetimes + dos filetimes DOS and Windows allows users to change file time stamps if they can write to the file. POSIX semantics prevent this. This options allows DOS and Windows behaviour. - fake oplocks + fake oplocks Oplocks are the way that SMB clients get permission from a server to locally cache file operations. If a server grants an oplock then the client is free to assume that it is the only one accessing the file and it will aggressively cache file data. - hide dot files, hide files, veto files + hide dot files, hide files, veto files Note: MS Windows Explorer allows over-ride of files marked as hidden so they will still be visible. - read only + read only If this parameter is yes, then users of a service may not create or modify files in the service's directory. - veto files + veto files List of files and directories that are neither visible nor accessible. @@ -733,7 +724,7 @@ Before using any of the following options please refer to the man page for &smb. On MS Windows NT4/200x/XP system access control lists on the share itself are set using native - tools, usually from filemanager. For example, in Windows 200x: right click on the shared folder, + tools, usually from file manager. For example, in Windows 200x: right click on the shared folder, then select Sharing, then click on Permissions. The default Windows NT4/200x permission allows Everyone Full Control on the Share. @@ -783,26 +774,31 @@ Before using any of the following options please refer to the man page for &smb. -MS Windows Access Control Lists and Unix Interoperability +MS Windows Access Control Lists and UNIX Interoperability Managing UNIX permissions Using NT Security Dialogs - Windows NT clients can use their native security settings - dialog box to view and modify the underlying UNIX permissions. + + Windows NT clients can use their native security settings dialog box to view and modify the + underlying UNIX permissions. + - Note that this ability is careful not to compromise - the security of the UNIX host Samba is running on, and - still obeys all the file permission rules that a Samba - administrator can set. + + Note that this ability is careful not to compromise the security of the UNIX host Samba is running on, and + still obeys all the file permission rules that a Samba administrator can set. + + + + Samba does not attempt to go beyond POSIX ACLs, so that the various finer-grained access control + options provided in Windows are actually ignore. + - All access to Unix/Linux system file via Samba is controlled at - the operating system file access control level. When trying to - figure out file access problems it is vitally important to identify - the identity of the Windows user as it is presented by Samba at - the point of file access. This can best be determined from the + All access to UNIX/Linux system files via Samba is controlled by the operating system file access controls. + When trying to figure out file access problems it is vitally important to find the identity of the Windows + user as it is presented by Samba at the point of file access. This can best be determined from the Samba log files. @@ -811,93 +807,89 @@ Before using any of the following options please refer to the man page for &smb. Viewing File Security on a Samba Share - From an NT4/2000/XP client, single-click with the right - mouse button on any file or directory in a Samba mounted - drive letter or UNC path. When the menu pops-up, click - on the Properties entry at the bottom of - the menu. This brings up the file properties dialog - box. Click on the tab Security and you - will see three buttons, Permissions, - Auditing, and Ownership. - The Auditing button will cause either - an error message A requested privilege is not held - by the client to appear if the user is not the - NT Administrator, or a dialog which is intended to allow an - Administrator to add auditing requirements to a file if the - user is logged on as the NT Administrator. This dialog is - non-functional with a Samba share at this time, as the only - useful button, the Add button will not currently - allow a list of users to be seen. + + From an NT4/2000/XP client, single-click with the right mouse button on any file or directory in a Samba + mounted drive letter or UNC path. When the menu pops-up, click on the Properties + entry at the bottom of the menu. This brings up the file properties dialog box. Click on the tab + Security and you will see three buttons, Permissions, + Auditing, and Ownership. The Auditing + button will cause either an error message A requested privilege is not held by the client + to appear if the user is not the NT Administrator, or a dialog which is intended to allow an Administrator + to add auditing requirements to a file if the user is logged on as the NT Administrator. This dialog is + non-functional with a Samba share at this time, as the only useful button, the Add + button will not currently allow a list of users to be seen. + Viewing file ownership - Clicking on the Ownership button - brings up a dialog box telling you who owns the given file. The - owner name will be of the form : - - "SERVER\user (Long name)" - - Where SERVER is the NetBIOS name of - the Samba server, user is the user name of - the UNIX user who owns the file, and (Long name) - is the descriptive string identifying the user (normally found in the - GECOS field of the UNIX password database). Click on the - Close button to remove this dialog. - - If the parameter nt acl support - is set to false then the file owner will - be shown as the NT user "Everyone". - - The Take Ownership button will not allow - you to change the ownership of this file to yourself (clicking on - it will display a dialog box complaining that the user you are - currently logged onto the NT client cannot be found). The reason - for this is that changing the ownership of a file is a privileged - operation in UNIX, available only to the root - user. As clicking on this button causes NT to attempt to change - the ownership of a file to the current user logged into the NT - client this will not work with Samba at this time. - - There is an NT chown command that will work with Samba - and allow a user with Administrator privilege connected - to a Samba server as root to change the ownership of - files on both a local NTFS filesystem or remote mounted NTFS - or Samba drive. This is available as part of the Seclib - NT security library written by Jeremy Allison of - the Samba Team, available from the main Samba ftp site. + + Clicking on the Ownership button brings up a dialog box telling you who owns + the given file. The owner name will be of the form: + + + + "SERVER\user (Long name)" + + + + Where SERVER is the NetBIOS name of the Samba server, user + is the user name of the UNIX user who owns the file, and (Long name) is the + descriptive string identifying the user (normally found in the GECOS field of the UNIX password database). + Click on the Close button to remove this dialog. + + + + If the parameter nt acl support is set to false + then the file owner will be shown as the NT user "Everyone". + + + + The Take Ownership button will not allow you to change the ownership of this file to + yourself (clicking on it will display a dialog box complaining that the user you are currently logged onto + the NT client cannot be found). The reason for this is that changing the ownership of a file is a privileged + operation in UNIX, available only to the root user. As clicking on this button causes + NT to attempt to change the ownership of a file to the current user logged into the NT client this will + not work with Samba at this time. + + + There is an NT chown command that will work with Samba and allow a user with Administrator privilege connected + to a Samba server as root to change the ownership of files on both a local NTFS filesystem or remote mounted NTFS + or Samba drive. This is available as part of the Seclib NT security library written + by Jeremy Allison of the Samba-Team, available from the main Samba FTP site. Viewing File or Directory Permissions - The third button is the Permissions - button. Clicking on this brings up a dialog box that shows both - the permissions and the UNIX owner of the file or directory. - The owner is displayed in the form : + + The third button is the Permissions button. Clicking on this brings up a dialog box + that shows both the permissions and the UNIX owner of the file or directory. The owner is displayed in the form: + "SERVER\ user (Long name)" - Where SERVER is the NetBIOS name of - the Samba server, user is the user name of - the UNIX user who owns the file, and (Long name) - is the descriptive string identifying the user (normally found in the + Where SERVER is the NetBIOS name of the Samba server, + user is the user name of the UNIX user who owns the file, and + (Long name) is the descriptive string identifying the user (normally found in the GECOS field of the UNIX password database). - If the parameter nt acl support - is set to false then the file owner will - be shown as the NT user "Everyone" and the - permissions will be shown as NT "Full Control". + + If the parameter nt acl support is set to false + then the file owner will be shown as the NT user "Everyone" and the permissions will be + shown as NT "Full Control". + - The permissions field is displayed differently for files - and directories, so I'll describe the way file permissions - are displayed first. + + The permissions field is displayed differently for files and directories, so I'll describe the way file permissions + are displayed first. + File Permissions @@ -921,7 +913,7 @@ Before using any of the following options please refer to the man page for &smb. "Special Access" in the NT display list. But what happens if the file has no permissions allowed - for a particular UNIX user group or world component ? In order + for a particular UNIX user group or world component? In order to allow "no permissions" to be seen and modified then Samba overloads the NT "Take Ownership" ACL attribute (which has no meaning in UNIX) and reports a component with @@ -963,7 +955,7 @@ Before using any of the following options please refer to the man page for &smb. with the standard Samba permission masks and mapping of DOS attributes that need to also be taken into account. - If the parameter nt acl support + If the parameter nt acl support is set to false then any attempt to set security permissions will fail with an "Access Denied" message. @@ -1013,37 +1005,36 @@ Before using any of the following options please refer to the man page for &smb. to control interaction with the standard Samba create mask parameters. These are : - - security mask - force security mode - directory security mask - force directory security mode - + + security mask + force security mode + directory security mask + force directory security mode + Once a user clicks OK to apply the permissions Samba maps the given permissions into a user/group/world r/w/x triplet set, and then will check the changed permissions for a - file against the bits set in the - security mask parameter. Any bits that + file against the bits set in the + security mask parameter. Any bits that were changed that are not set to '1' in this parameter are left alone in the file permissions. - Essentially, zero bits in the security mask + Essentially, zero bits in the security mask mask may be treated as a set of bits the user is not allowed to change, and one bits are those the user is allowed to change. If not set explicitly this parameter is set to the same value as - the create mask - parameter. To allow a user to modify all the + the create mask parameter. To allow a user to modify all the user/group/world permissions on a file, set this parameter to 0777. Next Samba checks the changed permissions for a file against - the bits set in the - force security mode parameter. Any bits + the bits set in the + force security mode parameter. Any bits that were changed that correspond to bits set to '1' in this parameter are forced to be set. @@ -1052,12 +1043,11 @@ Before using any of the following options please refer to the man page for &smb. modifying security on a file, the user has always set to be 'on'. If not set explicitly this parameter is set to the same value - as the force - create mode parameter. + as the force create mode parameter. To allow a user to modify all the user/group/world permissions on a file with no restrictions set this parameter to 000. - The security mask and force + The security mask and force security mode parameters are applied to the change request in that order. @@ -1068,11 +1058,11 @@ Before using any of the following options please refer to the man page for &smb. parameter instead of force security mode . - The directory security mask parameter + The directory security mask parameter by default is set to the same value as the directory mask parameter and the force directory security mode parameter by default is set to the same value as - the force directory mode parameter. + the force directory mode parameter. In this way Samba enforces the permission restrictions that an administrator can set on a Samba share, whilst still allowing users @@ -1084,23 +1074,24 @@ Before using any of the following options please refer to the man page for &smb. parameters in the &smb.conf; file in that share specific section : - - security mask = 0777 - force security mode = 0 - directory security mask = 0777 - force directory security mode = 0 - + + security mask0777 + force security mode0 + directory security mask0777 + force directory security mode0 + - Interaction with the standard Samba file attribute - mapping + Interaction with the standard Samba file attribute mapping + Samba maps some of the DOS attribute bits (such as "read only") into the UNIX permissions of a file. This means there can be a conflict between the permission bits set via the security dialog and the permission bits set by the file attribute mapping. + One way this can show up is if a file has no UNIX read access for the owner it will show up as "read only" in the standard @@ -1146,7 +1137,6 @@ are examples taken from the mailing list in recent times. - Example Solution: Go to the top of the directory that is shared @@ -1156,17 +1146,17 @@ are examples taken from the mailing list in recent times. Set the ownership to what ever public owner and group you want - - find 'directory_name' -type d -exec chown user.group {}\; - find 'directory_name' -type d -exec chmod 6775 'directory_name' - find 'directory_name' -type f -exec chmod 0775 {} \; - find 'directory_name' -type f -exec chown user.group {}\; - + +&prompt;find 'directory_name' -type d -exec chown user.group {}\; +&prompt;find 'directory_name' -type d -exec chmod 6775 'directory_name' +&prompt;find 'directory_name' -type f -exec chmod 0775 {} \; +&prompt;find 'directory_name' -type f -exec chown user.group {}\; + The above will set the 'sticky bit' on all directories. Read your - Unix/Linux man page on what that does. It causes the OS to assign + UNIX/Linux man page on what that does. It causes the OS to assign to all files created in the directories the ownership of the directory. @@ -1175,62 +1165,62 @@ are examples taken from the mailing list in recent times. Directory is: /foodbar - - $ chown jack.engr /foodbar - + +&prompt;chown jack.engr /foodbar + - + This is the same as doing: - - $ chown jack /foodbar - $ chgrp engr /foodbar - - + +&prompt;chown jack /foodbar +&prompt;chgrp engr /foodbar + + Now do: - - $ chmod 6775 /foodbar - $ ls -al /foodbar/.. - + +&prompt;chmod 6775 /foodbar +&prompt;ls -al /foodbar/.. + You should see: - - drwsrwsr-x 2 jack engr 48 2003-02-04 09:55 foodbar - + +drwsrwsr-x 2 jack engr 48 2003-02-04 09:55 foodbar + Now do: - - $ su - jill - $ cd /foodbar - $ touch Afile - $ ls -al - + +&prompt;su - jill +&prompt;cd /foodbar +&prompt;touch Afile +&prompt;ls -al + You should see that the file Afile created by Jill will have ownership and permissions of Jack, as follows: - - -rw-r--r-- 1 jack engr 0 2003-02-04 09:57 Afile - + +-rw-r--r-- 1 jack engr 0 2003-02-04 09:57 Afile + Now in your &smb.conf; for the share add: - - force create mode = 0775 - force directory mode = 6775 - + +force create mode0775 +force direcrtory mode6775 + @@ -1241,10 +1231,10 @@ are examples taken from the mailing list in recent times. An alternative is to set in the &smb.conf; entry for the share: - - force user = jack - force group = engr - + +force userjack +force groupengr + @@ -1252,14 +1242,49 @@ are examples taken from the mailing list in recent times. - I have set force user and Samba still makes <emphasis>root</emphasis> the owner of all the files - I touch! + I have set force user but Samba still makes <emphasis>root</emphasis> the owner of all the files I touch! - When you have a user in 'admin users', Samba will always do file operations for - this user as root, even if force user has been set. + When you have a user in admin users, samba will always do file operations for + this user as root, even if force user has been set. + + MS Word with Samba changes owner of file + + + Question: When userB saves a word document that is owned by userA the updated file is now owned by userB. + Why is Samba doing this? How do I fix this? + + + + Answer: Word does the following when you modify/change a Word document: Word Creates a NEW document with + a temporary name, Word then closes the old document and deletes it, Word then renames the new document to the original document name. + There is NO mechanism by which Samba CAN IN ANY WAY know that the new document really should be owned by the owners + 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 + to tell, the file that gets created is a NEW file, not one that the application (Word) is updating. + + + + There is a work-around to solve the permissions problem. That work-around involves understanding how you can manage file + system behaviour from within the &smb.conf; file, as well as understanding how Unix file systems work. Set on the directory + in which you are changing word documents: chmod g+s 'directory_name' This ensures that all files will + be created with the group that owns the directory. In smb.conf share declaration section set: + + + + + force create mode0660 + force directory mode0770 + + + + + These two settings will ensure that all directories and files that get created in the share will be read/writable by the + owner and group set on the directory itself. + + + -- cgit