Security Implications of Samba Access to Non-ACL File Systems

Topics · Published 2019-07-01 · Revised 2026-11-23
Technical corrections applied locally; original wording preserved separately · Joomla source

4,113 Total views across this article’s versions; includes the historical baseline where available.

Several processes control the flow of data through a Samba-managed network connection. File and directory permissions are an important part of that protection, even when extended ACLs are not in use.

Linux and UNIX already provide ordinary owner/group/other permissions. In this article, “non-ACL” means without extended POSIX ACLs, not without file-level access control. A Samba login does not make the entire file system accessible. For the distinction and worked permission examples, start with Linux ACL File Systems.

Samba is software implementing SMB file sharing. CIFS is associated with the older SMB protocol family; NFS is a separate file-sharing protocol. They are not successive components of one Samba connection. Securing the network connection and deciding what a user may do to a file are related responsibilities, but one does not replace the other.

Samba and NFS: Different Trust Assumptions

Authentication establishes an identity. Authorization determines what that identity may do. Accepting an SMB session does not give the client carte blanche access to every file on the server: the selected share and requested file operations remain subject to access controls. Samba’s share configuration includes controls such as valid users and read only.

The trust concern in traditional NFS is more specific. With sec=sys (AUTH_SYS), the server relies on numeric user and group IDs supplied by the client. That makes the trustworthiness of the client important. NFS also supports Kerberos security flavors: krb5 for authentication, krb5i with integrity protection, and krb5p with privacy protection. It is inaccurate to describe every NFS deployment as accepting an unauthenticated identity.

NFS export policy and file permissions still apply. root_squash normally maps client UID/GID 0 to an anonymous identity; it does not authenticate every other identity asserted by an AUTH_SYS client. See exports(5). A successful mount is not evidence that every later file operation is authorized.

File System Permissions: The Local Gatekeeper

A conventional Linux-backed Samba share uses an underlying file system with owner, group, and mode permissions. Extended POSIX ACLs add named-user and named-group permissions when that is useful. Some file systems or configurations do not support those extensions, but the absence of an extended ACL does not imply unrestricted access.

Historical Linux configurations allowed extended ACL support to be disabled on some file systems. Where that option is supported, it affects the extended rules, not the existence of ordinary mode permissions. Do not assume an old mount-option recipe applies to every current file system or kernel. Check the implementation in use and the resulting access policy. [1]

Also distinguish an ACL-aware tool from an extended ACL actually stored on a file. getfacl can display the three ordinary permission entries even on a file system without ACL support. That output alone does not prove that named-user ACLs are supported or enabled.

Linux Multi-Layer Approach

Linux file access uses numeric user and group identities, including supplementary groups. A process does not need to match both a file’s owner and its owning group. For ordinary mode permissions, the applicable owner, group, or other class determines access. Extended ACLs add named entries and a mask; see acl(5).

For a pathname, search permission is required on the directories traversed before the file can be reached. The requested operation then matters: reading file contents, writing them, and deleting a directory entry are different actions. Under ordinary Linux permissions, deleting a file generally requires write and search permission on its parent directory, not write permission on the file itself; the sticky bit and other restrictions can also prevent deletion. See path_resolution(7) and unlink(2).

For Samba, the relevant identity is the one used on the server. Domain accounts may be mapped from Windows security identifiers to UNIX user and group IDs, for example through winbind. They are not simply user/group strings attached to a network interface.

A Layered Defense

Remote users may be allowed to read, write, or delete files through a share, so wrapping constraints around that access should be a priority. The useful questions are which identity is accepted, which share it may use, and which operations it may perform.

The following layers describe responsibilities to inspect. They are not three password checks followed by one authorization check, nor a fixed sequence repeated for every transfer.

Layer 1: SMB Session Authentication

Samba provides server software and client tools; a machine can run both. The server authenticates an SMB session using the configured local or domain authentication service. Depending on the setup, this can involve NTLM or Kerberos rather than comparing a plaintext username/password pair against a local list. Credentials need not be typed again for each file operation. See SMB session authentication and Samba’s security-mode documentation.

Guest access is a configured exception, not the disappearance of authorization. With guest ok, the guest account’s privileges apply. Check which identity is actually being used, including any guest mapping.

Layer 2: Share and Network Access Policy

After authentication, the client must be allowed to use the requested share. Samba’s valid users can restrict eligible accounts; read only can restrict changes through a file share. These controls have their own interactions and overrides, so inspect the effective configuration rather than assuming that one setting describes the whole policy. See smb.conf(5).

An SMB client may mount a share into its local directory tree, but mounting is a client-side access method, not a separate NFS authentication step inside Samba. File operations remain constrained by the rights granted through SMB and the server’s permission configuration.

Host Restrictions in Samba and NFS

Host-based restrictions are not exclusive to NFS. Samba has hosts allow and hosts deny; Linux NFS exports specify eligible clients in /etc/exports. These restrictions decide which hosts may reach a service or export. They do not substitute for user identity and file authorization. See the Samba configuration manual and exports(5).

Layer 3: Server-Side Identity Mapping

The server needs an identity against which to evaluate access. In a conventional Linux-backed share, that involves the appropriate UNIX UID and groups. A domain login may require SID-to-UID/GID mapping; a standalone account uses the configured local identity arrangement. winbindd(8) describes domain identity resolution.

Settings such as force user can deliberately make file operations use a different UNIX account after the connection is accepted. That can collapse distinctions between users, so inspect it when diagnosing permissions. This is identity mapping, not another password check against a network-interface file ACL. Network filtering and file permissions are separate controls. See force user in smb.conf(5).

Layer 4: File and Directory Authorization

For conventional system-permission enforcement, the server-side identity must have the permissions needed for the requested operation and pathname. Extended ACLs can refine this decision, but ordinary mode bits already restrict access. Samba may also enforce Windows ACLs, as described below.

An already established connection is not permission to ignore these rules. Conversely, changing a permission does not necessarily revoke rights already granted to an open handle or erase data cached by a client. Test new connections and file opens as well as any revocation behavior you require. SMB tracks access granted to an open handle; NFSv4 explicitly distinguishes server access decisions and client caching.

Start by inspecting the configuration and the relevant path. The following are read-only checks; replace /srv/samba/example with the actual share path and run them with an account permitted to inspect it:

testparm -s
ls -ld /srv /srv/samba /srv/samba/example
getfacl -p /srv /srv/samba /srv/samba/example

testparm checks the default configuration file. If the service uses a different file, supply that same file explicitly. Its success establishes configuration consistency, not successful access enforcement. getfacl reports local POSIX permissions, not the complete Windows ACL policy held by every Samba module. See testparm(1) and getfacl(1).

Then test the actual share using an intended reader, an intended writer, and an account that should be denied. Use disposable files in the intended share to check reading, creation, modification, and deletion separately. If the same data is reachable locally or through NFS, test those paths too. A successful administrator connection does not establish what an ordinary account can do.

What VFS ACL Modules Change

Samba’s Virtual File System (VFS) modules extend its file-handling behavior. They predate Samba 4; they are not a new 4.x-only security layer. Choose a module for the permission model you need, rather than assuming that adding any ACL module fixes access control.

For example, vfs_acl_xattr stores Windows ACLs in extended attributes, normally security.NTACL. Windows ACLs and extended POSIX ACLs are different models. With the default acl_xattr:ignore system acls = no, the module maintains and evaluates both system and Windows ACLs. Setting it to yes stops the best-effort POSIX ACL mapping and changes associated permission settings to favor Windows ACL behavior.

That distinction matters if the same files are also accessible through local applications, SSH, or NFS: those paths do not automatically enforce Samba’s stored Windows ACLs. Do not enable ignore system acls as a general repair for permission errors. The required design depends on every path by which the data can be reached. Consult the module documentation for the installed Samba version.

Conclusion

Remote file access is a multi-layered process. The file system remains an important part of the access policy, but the decisive question is not simply whether an extended ACL exists. Check the share configuration, the server-side identity, the file and directory permissions, and any ACL module involved. Then verify both allowed and denied operations with ordinary accounts.

A lack of extended ACLs does not leave Linux without file protection. A correctly authenticated account does not automatically receive unrestricted access. The risk comes from permissions and identity mappings that grant more access than intended, or from another access path that does not enforce the policy you thought was in place.

References

[1] The historical extended-ACL compatibility discussion is documented in Grünbacher’s POSIX Access Control Lists on Linux (2003), “Compatibility.” It is not a current mount-option recipe. The original article’s 2006 TechRepublic citation remains in the preserved original version.