Recent from talks
Nothing was collected or created yet.
Samba (software)
View on Wikipedia
| Samba | |
|---|---|
| Initial release | 1992[1] |
| Stable release | 4.23.3[2] |
| Repository | |
| Written in | C, Python |
| Operating system | Multiplatform |
| Type | Network file system |
| License | 2008: GPL-3.0-or-later[a] 1993: GPL-2.0-or-later[b] 1992: Proprietary[c] |
| Website | www |
Samba is a free software re-implementation of the SMB networking protocol, and was originally developed by Andrew Tridgell. Samba provides file and print services for various Microsoft Windows clients[5] and can integrate with a Microsoft Windows Server domain, either as a Domain Controller (DC) or as a domain member. As of version 4, it supports Active Directory and Microsoft Windows NT domains.
Samba runs on most Unix-like systems, such as Linux, Solaris, AIX and the BSD variants, including Apple macOS (Mac OS X 10.2 and greater) and macOS Server. Samba also runs on a number of other operating systems such as OpenVMS and IBM i. Samba is standard on nearly all distributions of Linux and is commonly included as a basic system service on other Unix-based operating systems as well. Samba is released under the terms of the GNU General Public License. The name Samba comes from SMB (Server Message Block), the name of the proprietary protocol used by the Microsoft Windows network file system.
Early history
[edit]Andrew Tridgell developed the first version of Samba Unix in December 1991 and January 1992, as a PhD student at the Australian National University, using a packet sniffer to do network analysis of the protocol used by DEC Pathworks server software. It did not have a formal name at the time of the first releases, versions 0.1, 0.5, and 1.0, all from the first half of January 1992; Tridgell simply referred to it as "a Unix file server for Dos Pathworks." He understood that he had "in fact implemented the netbios protocol" at the time of version 1.0 and that "this software could be used with other PC clients."[citation needed]
With a focus on interoperability with Microsoft's LAN Manager, Tridgell released "netbios for unix", observer, version 1.5 in December 1993. This release was the first to include client-software as well as a server. Also, at this time GPL2 was chosen as license.[citation needed]
Midway through the 1.5-series, the name was changed to smbserver. However, Tridgell got a trademark notice from the company "Syntax", who sold a product named TotalNet Advanced Server and owned the trademark for "SMBserver". The name "Samba" was derived by running the Unix command grep through the system dictionary looking for words that contained the letters S, M, and B, in that order (i.e. grep -i '^s.*m.*b' /usr/share/dict/words).[6]
Versions 1.6, 1.7, 1.8, and 1.9 followed relatively quickly, with the latter being released in January 1995. Tridgell considers the adoption of CVS in May 1996 to mark the birth of the Samba Team, though there had been contributions from other people, especially Jeremy Allison, previously.[7]
Version 2.0.0, released in January 1999, was a major release, including support for authentication from Windows NT Primary Domain Controller, 64 bit filesystem support for very large files, and exposure of OPLOCKS to unix systems.[citation needed] Version 2.2.0 released in April 2001.[citation needed]
Version history
[edit]| Date | Version | Description |
|---|---|---|
| 23 September 2003 | 3.0 | Active Directory support.[8] The 3.0.x series officially reached end-of-life on 5 August 2009.[9] |
| 1 July 2008 [10] | 3.2 | It will be updated on an as-needed basis for security issues only.[11][12] There was a change of license from GPL2 to GPL3, with some parts released under LGPL3.[4] The 3.2.x series officially reached EOL 1 March 2010.[10] |
| 27 January 2009 | 3.3 | |
| 3 July 2009 | 3.4 | This was the first release to include both Samba 3 and Samba 4 source code.[13] |
| 1 March 2010 | 3.5 | This was the first release to include experimental support for SMB2.[14] |
| 9 August 2011 | 3.6 | This is the first branch to include full support for SMB2.[15] |
| 11 December 2012 | 4.0 | A major rewrite that enables Samba to be an Active Directory domain controller, participating fully in a Windows Active Directory Domain. Its first technical preview (4.0.0TP1) was released in January 2006 after 3 years of development.[16][17] |
| 10 October 2013 | 4.1 | Support for SMB3. |
| 4 March 2015 | 4.2 | Btrfs based file compression, snapshots and winbind integration[18] |
| 8 September 2015 | 4.3 | New Logging features, SMB 3.1.1 support.[19] |
| 22 March 2016 | 4.4 | Asynchronous flush requests[20] |
| 7 September 2016 | 4.5 | NTLM v1 disabled by default, Virtual List View, Various performance improvements. |
| 7 March 2017 | 4.6 | Multi-process Netlogon support. |
| 21 September 2017 | 4.7 | Samba AD with MIT Kerberos. |
| 13 March 2018 | 4.8 | Apple Time Machine Support. Setups using 'domain' or 'ads' security modes now require 'winbindd' to be running.[21] |
| 13 September 2018 | 4.9 | Many changes.[22] |
| 19 March 2019 | 4.10 | |
| 17 September 2019 | 4.11 | SMB1 is disabled by default as a mitigation for the WannaCry vulnerability. |
| 3 March 2020 | 4.12 | |
| 22 September 2020 | 4.13 | Samba 4.13 raises the minimum version of Python to 3.6. |
| 9 March 2021 | 4.14 | Major overhaul of VFS subsystem and more.[23] |
| 20 September 2021 | 4.15 | Many changes.[24] |
| 21 March 2022 | 4.16 | Many changes.[25] |
| 13 September 2022 | 4.17 | Many changes.[26] |
| 8 March 2023 | 4.18 | Many changes.[27] |
| 4 September 2023 | 4.19 | Many changes.[28] |
| 27 March 2024 | 4.20 | Many changes.[29] |
| 2 September 2024 | 4.21 | Many changes.[30] |
| 6 March 2025 | 4.22 | SMB3 Directory Leases are supported, Netlogon Ping can be done over LDAP and LDAPS, experimental Himmelblau authentication for Azure Entra ID, performance improvements, nmbd proxy logon feature is removed.[31] |
Security
[edit]Some versions of Samba 3.6.3 and lower suffer serious security issues which can allow anonymous users to gain root access to a system from an anonymous connection, through the exploitation of an error in Samba's remote procedure call.[32]
On 12 April 2016, Badlock,[33] a crucial security bug in Windows and Samba, was disclosed. Badlock for Samba is referenced by CVE-2016-2118 (SAMR and LSA man in the middle attacks possible).[34]
On 24 May 2017, it was announced that a remote code execution vulnerability had been found in Samba named EternalRed or SambaCry, affecting all versions since 3.5.0.[35] This vulnerability was assigned identifier CVE-2017-7494.[35][36]
On 14 September 2020, a proof-of-concept exploit for the netlogon vulnerability called Zerologon (CVE-2020-1472) for which a patch exists since August was published.[37] Some federal agencies using the software have been ordered to install the patch.[38]
Features
[edit]Samba allows file and print sharing between computers running Microsoft Windows and computers running Unix. It is an implementation of dozens of services and a dozen protocols, including:
- NetBIOS over TCP/IP (NBT)
- SMB (known as CIFS in some versions)
- Samba supports POSIX extensions for CIFS/SMB. The initial extension was CIFS VFS (CAP_UNIX) from 2004, which has been somewhat superseded by SMB3.[39]
- DCE/RPC or more specifically, MSRPC, the Network Neighborhood suite of protocols
- A WINS server also known as a NetBIOS Name Server (NBNS)
- The NT Domain suite of protocols which includes NT Domain Logons
- Security Account Manager (SAM) database
- Local Security Authority (LSA) service
- NT-style printing service (SPOOLSS)
- NTLM
- Active Directory Logon using modified versions of Kerberos and LDAP
- DFS server
All these services and protocols are frequently incorrectly referred to as just NetBIOS or SMB. The NBT (NetBIOS over TCP/IP) and WINS protocols, and their underlying SMB version 1 protocol, are deprecated on Windows. Since Windows Vista the WS-Discovery protocol has been included along with SMB2 and its successors, which supersede these. (WS-Discovery is implemented on Unix-like platforms by third party daemons which allow Samba shares to be discovered when the deprecated protocols are disabled).
Samba sets up network shares for chosen Unix directories (including all contained subdirectories). These appear to Microsoft Windows users as normal Windows folders accessible via the network. Unix users can either mount the shares directly as part of their file structure using the mount.cifs command or, alternatively, can use a utility, smbclient (libsmb) installed with Samba to read the shares with a similar interface to a standard command line FTP program. Each directory can have different access privileges overlaid on top of the normal Unix file protections. For example: home directories would have read/write access for all known users, allowing each to access their own files. However they would still not have access to the files of others unless that permission would normally exist. Note that the netlogon share, typically distributed as a read only share from /etc/samba/netlogon, is the logon directory for user logon scripts.
Samba services are implemented as two daemons:
- smbd, which provides the file and printer sharing services, and
- nmbd, which provides the NetBIOS-to-IP-address name service. NetBIOS over TCP/IP requires some method for mapping NetBIOS computer names to the IP addresses of a TCP/IP network.
Samba configuration is achieved by editing a single file (typically installed as /etc/smb.conf or /etc/samba/smb.conf). Samba can also provide user logon scripts and group policy implementation through poledit.
Samba is included in most Linux distributions and is started during the boot process. On Red Hat, for instance, the /etc/rc.d/init.d/smb script runs at boot time, and starts both daemons. Samba is not included in Solaris 8, but a Solaris 8-compatible version is available from the Samba website. The OS/2-based ArcaOS includes Samba to replace the old IBM LAN Server software.[40]
Earlier versions of Samba included a web administration tool called Samba Web Administration Tool (SWAT),[41][42] which was removed starting with version 4.1.[43]
Samba TNG
[edit]Samba TNG (The Next Generation) was forked in late 1999, after disagreements between the Samba Team leaders and Luke Leighton about the directions of the Samba project. They failed to come to an agreement on a development transition path which allowed the research version of Samba he was developing (known at the time as Samba-NTDOM) to slowly be integrated into Samba.[44] Development was minimal, due to a lack of developers. The Samba TNG team frequently directed potential users towards Samba because of its better support and development.[45]
A key goal of the Samba TNG project was to rewrite all of the NT Domains services as FreeDCE projects.[46] This was made difficult as the services were developed manually through network reverse-engineering, with limited or no reference to DCE/RPC documentation.[citation needed]
A key difference from Samba was in the implementation of the NT Domains suite of protocols and MSRPC services. Samba makes all the NT Domains services available from a single place, whereas Samba TNG separated each service into its own program.[citation needed]
ReactOS started using Samba TNG services for its SMB implementation. The developers of both projects were interested in seeing the Samba TNG design used to help get ReactOS talking to Windows networks. They worked together to adapt the network code and build system. The multi-layered and modular approach made it easy to port each service to ReactOS.[47]
Samba TNG now seems to be abandoned and unmaintained. Their website is offline with the functional archive from 2016.[48] The last release for ReactOS was in 2009.
See also
[edit]Notes
[edit]- ^ GPL-3.0-or-later and LGPL-3.0-or-later since 2008-07-01, version 3.2.0.[3][4]
- ^ GPL-2.0-or-later from 1993, version 1.5, until 2009-10-01, version 3.0.37.
- ^ Proprietary from 1992 until 1993.
References
[edit]- ^ "Samba Latest News". Retrieved 28 November 2017.
- ^ "[Announce] Samba 4.23.3 Available for Download". 7 November 2025. Retrieved 7 November 2025.
- ^ "Samba Copyright Policy".
- ^ a b "Samba Adopts GPLv3 for Future Releases". Retrieved 21 September 2015.
- ^ "Samba - opening windows to a wider world". www.samba.org. Retrieved 16 January 2024.
- ^ Andrew Tridgell and the Samba Team (27 June 1997). "A bit of history and a bit of fun". Archived from the original on 15 August 2020. Retrieved 28 May 2009.
- ^ "10 years of Samba!". Retrieved 21 September 2015.
- ^ "Samba Team announces the first official release of Samba 3.0". Retrieved 24 September 2003.
- ^ "Release Planning for Samba 3.0". Retrieved 21 September 2015.
- ^ a b "Release Planning for Samba 3.2". Retrieved 21 September 2015.
- ^ "[ANNOUNCE] Samba 3.2.0 Available for Download". Retrieved 21 September 2015.
- ^ "Monday, April 28 - Samba Mashup Report". Retrieved 21 September 2015.
- ^ "Samba - Release Notes Archive". Retrieved 21 September 2015.
- ^ "Samba - Release Notes Archive". Retrieved 21 September 2015.
- ^ "Samba - Release Notes Archive". Retrieved 21 September 2015.
- ^ "Samba - opening windows to a wider world". Retrieved 21 September 2015.
- ^ "Samba 4.0.0TP1 Available for Download". Archived from the original on 22 July 2006. Retrieved 11 January 2014.
- ^ "Samba - Release Notes Archive". Retrieved 21 September 2015.
- ^ "Samba - Release Notes Archive". Retrieved 8 September 2015.
- ^ "Samba - Release Notes Archive". Retrieved 22 March 2016.
- ^ "Release Notes for Samba 4.8.0". 13 March 2018. Retrieved 19 March 2019.
- ^ "Samba 4.9.0 - Release Notes".
- ^ "Samba 4.14.0 - Release Notes".
- ^ "Samba 4.15.0 - Release Notes".
- ^ "Samba 4.16.0 - Release Notes".
- ^ "Samba 4.17.0 - Release Notes".
- ^ "Samba 4.18.0 - Release Notes".
- ^ "Samba 4.19.0 - Release Notes".
- ^ "Samba 4.20.0 - Release Notes".
- ^ "Samba 4.21.0 - Release Notes".
- ^ "Samba 4.22.0 - Release Notes".
- ^ CVE-2012-1182 - A security announcement regarding a major issue with Samba 3.6.3 and lower.
- ^ "Badlock". Archived from the original on 12 April 2016. Retrieved 12 April 2016.
- ^ "Microsoft, Samba Patch "Badlock" Vulnerability". Retrieved 13 April 2016.
- ^ a b "Samba 4.6.4 - Release Notes". 24 May 2017. Retrieved 24 May 2017.
- ^ "SambaCry is coming". Securelist - Kaspersky Lab’s cyberthreat research and reports. Retrieved 19 March 2018.
- ^ Cimpanu, Catalin. "Microsoft says it detected active attacks leveraging Zerologon vulnerability". ZDNet. Retrieved 9 October 2020.
- ^ Constantin, Lucian (23 September 2020). "What is Zerologon? And why to patch this Windows Server flaw now". CSO Online. Retrieved 9 October 2020.
- ^ "UNIX Extensions". SambaWiki.
- ^ "ArcaMapper". arcanoae.com. Retrieved 11 September 2020.
- ^ "Chapter 37. SWAT: The Samba Web Administration Tool". Retrieved 21 September 2015.
- ^ "SWAT your Samba problems". linux.com. 31 January 2008.
- ^ "Samba 4.1 Features added/changed". Retrieved 21 September 2015.
- ^ "Project FAQ - What is the relationship between Samba and Samba TNG?". Archived from the original on 11 January 2008. Retrieved 19 February 2008.
- ^ "Project FAQ - Which should I use - Samba or Samba TNG?". Archived from the original on 11 January 2008. Retrieved 19 February 2008.
- ^ "Project FAQ - What's all this about FreeDCE?". Archived from the original on 11 January 2008. Retrieved 19 February 2008.
- ^ Vincent, Brian. "Interview with Steven Edwards". Wine HQ. Retrieved 19 February 2008.
- ^ "start [Samba-TNG]". wiki.samba-tng.org. Archived from the original on 22 April 2016. Retrieved 9 November 2025.
External links
[edit]Samba (software)
View on Grokipediasmbd daemon for SMB services, nmbd for NetBIOS name resolution, and winbindd for authentication integration, making Samba essential for cross-platform networking in enterprise and open-source deployments.[6][7]
History
Origins and Early Development
Samba was founded by Andrew Tridgell, a PhD student at the Australian National University, who began developing the software in late 1991 to enable file sharing between Unix systems and Windows PCs using the proprietary Server Message Block (SMB) protocol.[8][2] Tridgell's motivation stemmed from the need to mount Unix disk space on a DOS PC via the NetBIOS interface, as existing tools like NFS clients were inadequate for NetBIOS-based applications.[2] Without access to Microsoft's documentation, Tridgell reverse-engineered the SMB protocol primarily through packet sniffing, a process that involved capturing and analyzing network traffic to understand the protocol's structure and behavior.[2][9] The initial release, named smbserver version 0.1, appeared in January 1992 as a basic SMB server implementation for Unix-like systems, initially under a permissive "do what you like" license.[10][11] This early code underwent quick bug-fix iterations before Tridgell paused development later that year.[2] By 1993, key contributors such as Jeremy Allison from Great Britain joined the project, bringing expertise in protocol implementation and helping expand its capabilities.[9] Volker Lendecke also emerged as an early core developer, contributing to foundational aspects of the codebase.[12] The project adopted the GNU General Public License (GPL) with the release of nbserver 1.5, marking its commitment to open-source principles and enabling collaborative growth.[13] Samba 1.0, released in 1994, represented a significant milestone as the first stable version under the Samba name—chosen to resolve a trademark conflict with the original SMB designation—and included basic support for the Common Internet File System (CIFS), an extension of SMB.[13][2] This version addressed early challenges in protocol fidelity, allowing Unix systems to function as SMB servers compatible with Windows clients.[10] By the mid-1990s, Samba saw widespread adoption in Linux distributions, such as its inclusion in Red Hat and Debian packages starting around 1995, which facilitated cross-platform networking in enterprise and academic environments.[13] This early integration underscored Samba's role in bridging Unix and Windows ecosystems, laying the groundwork for its evolution into a robust open-source alternative to proprietary networking solutions.[2]Version History
Samba's development began with the 1.x series, released starting in early 1992, which introduced basic support for the SMB1 protocol, enabling file and print sharing between Unix-like systems and Windows clients.[13] This series laid the foundation for stable NTLM authentication mechanisms, allowing initial password-based security for network access, though limited to simple workgroup configurations.[13] Key milestones included the 1.9 release in January 1995, which added master browser capabilities for network discovery, and ongoing refinements through 1.9.18 in 1998, focusing on reliability and documentation.[13] The 1.x series reached end-of-life around 2000 as focus shifted to more advanced features. The 2.x series, launched with version 2.0 in January 1999, enhanced compatibility with Windows NT domains, supporting Samba as both primary domain controller (PDC) and backup domain controller (BDC) for centralized user authentication. Samba 2.0 also introduced the Samba Web Administration Tool (SWAT), a browser-based interface for configuring smb.conf. It introduced preliminary support for the evolving SMB protocol, improving performance and stability over 1.x, alongside integration with LDAP for directory services starting in version 2.2 (April 2001).[14] The series continued until 2003, with 2.2.12 as the final stable release, emphasizing better integration with enterprise environments before the transition to 3.x.[14] Samba 3.0, released on September 24, 2003, marked a significant upgrade with full support for the CIFS/SMB protocol, including POSIX ACLs and improved Unicode handling for cross-platform file sharing.[15] It added compatibility for joining Active Directory domains as a member server, enabling Unix systems to authenticate against Windows servers without full domain control. Later releases in the 3.x series, spanning until 2012, introduced clustering support via CTDB for high availability and winbind enhancements for identity mapping.[15] The 3.6 branch, released August 9, 2011, received security updates until March 2015, after which it entered end-of-life.[15] The 4.x series debuted with version 4.0 on December 11, 2012, implementing a full Active Directory Domain Controller compatible with Microsoft Active Directory, supporting features like group policy and DNS integration.[15] It also added native SMB3 protocol support for multichannel connections and encryption, advancing secure file transfers. Configuration shifted toward JSON-based formats in subsequent releases for better scripting. Samba 4.11.0, released September 17, 2019, required Python 3 as the runtime, with no runtime support for Python 2 (though limited build-time Python 2 use remained possible temporarily).[16] Samba 4.18, launched March 8, 2023, included performance optimizations such as improved VFS modules and better handling of large directories. The series continues actively, with 4.23 released September 12, 2025, introducing SMB3 over QUIC for encrypted transport over untrusted networks without VPNs.[17] As of November 2025, the latest stable release is 4.23.3, with ongoing maintenance for branches like 4.21 and 4.22 until their respective end-of-life dates in 2026.[18]Architecture and Components
Core Modules
The core modules of Samba form the foundational components that enable its interoperability between Unix-like systems and Windows networking protocols. These include server daemons responsible for handling sessions, name resolution, and authentication integration, as well as supporting libraries for client access and data storage. The configuration of these modules is primarily managed through a centralized file, with build-time dependencies ensuring compatibility with authentication standards.[7] The smbd daemon serves as the primary server process in Samba, managing SMB/CIFS-based file and print sharing sessions with clients. It establishes a dedicated process for each client connection, supporting file access, permission enforcement, and printer queuing over TCP/IP streams. This daemon interprets requests from compatible clients, such as Windows systems and Linux smbfs, while adhering to the configuration defined in smb.conf. For instance, it handles operations like file locking and directory traversal, ensuring reliable data transfer in mixed environments.[19] Complementing smbd, the nmbd daemon provides essential NetBIOS over IP services, including name registration, resolution, and network browsing. It responds to name queries from SMB/CIFS clients, acting as a WINS server or proxy to map NetBIOS names to IP addresses, which facilitates discovery in legacy Windows networks. Additionally, nmbd maintains a browsing database to enable the "Network Neighborhood" functionality, allowing clients to enumerate available shares and servers. This module is crucial for environments where broadcast-based discovery is still in use.[20] The winbindd daemon facilitates seamless integration between Windows domains and Unix systems by mapping Windows NT Security Identifiers (SIDs) to Unix user and group IDs. It operates as a Name Service Switch (NSS) provider, enabling commands likegetent to resolve domain users and groups, and supports authentication through the PAM module pam_winbind. Winbindd connects to domain controllers to fetch credential information, supporting ID ranges configurable in smb.conf to avoid conflicts with local Unix IDs. This allows Unix applications to authenticate against Active Directory without native support.[21]
On the client side, the libsmbclient library offers a programmatic interface for accessing SMB/CIFS resources, providing POSIX-like APIs for file operations such as opening, reading, and writing to remote shares. It supports URL-based connections (e.g., smb://server/share) and integrates with applications for tasks beyond basic mounting, including attribute manipulation and directory browsing. The library checks user-specific configuration files appended to the system smb.conf, ensuring consistent behavior across client tools.[22]
Samba also relies on the tdb (Trivial Database) library for efficient local storage of transient and persistent data, such as session states, lock information, and machine accounts. Designed as a lightweight, lockable key-value store similar to GDBM but with support for concurrent writers, tdb enables fast access without the overhead of full relational databases. It is used internally by daemons like smbd and winbindd to maintain state across restarts.[23]
Configuration for these modules is handled via the smb.conf file, typically located at /etc/samba/smb.conf, which uses a section-based structure for defining global and per-share settings. The [global] section sets server-wide parameters, such as workgroup membership, logging levels, and security modes, applying defaults to all services. Share definitions, like [homes] for user directories or custom sections (e.g., [public] with path = /shared and read only = no), specify access paths, permissions, and behaviors unique to each resource. Comments and continuations enhance readability, while parameters are case-insensitive.[24]
At build time, Samba depends on external libraries for authentication, notably supporting either the Heimdal Kerberos implementation (bundled internally) or MIT Kerberos (version 1.15.1 or later) for features like Active Directory domain control. These dependencies ensure secure ticket-based authentication, with options selectable during compilation to match system requirements.[25]
Protocol Implementations
Samba implements the Server Message Block (SMB) protocol family, which serves as the core for file and printer sharing over networks, along with supporting standards for name resolution and remote procedure calls to ensure interoperability with Microsoft Windows systems. The protocol stack in Samba encompasses multiple dialects of SMB, ranging from the original SMB1 to modern SMB3 variants, each building upon the previous with enhancements in performance, security, and functionality. These implementations are designed to handle the negotiation of dialect versions during session establishment, allowing clients and servers to agree on the highest mutually supported level while maintaining backward compatibility where necessary. The earliest dialect, SMB1 (also known as CIFS), is a legacy protocol introduced in the 1980s and extended by Microsoft in the 1990s, but it is considered insecure due to the absence of mandatory signing and encryption, making it vulnerable to man-in-the-middle attacks. Samba provides optional support for SMB1, which can be disabled at compile time or via configuration to prioritize security, as seen in releases starting from Samba 4.11.0. SMB2, introduced by Microsoft in 2006, marked a significant redesign with reduced command complexity, support for packet signing to prevent tampering, and improved efficiency over SMB1; Samba added full SMB2 support in version 3.6.0, enabling features like persistent handles for better network resilience. Building on this, SMB3, released by Microsoft in 2012 with Windows 8 and Server 2012, introduced multichannel for aggregating network connections, end-to-end encryption using AES-CCM, and directory leases for enhanced caching; Samba incorporated basic SMB3 support from version 4.0.0, with ongoing refinements for full compliance. Further evolution includes the SMB3.1.1 dialect, standardized by Microsoft in 2015, which mandates AES-256-GCM encryption for improved security and adds preauthentication integrity checks to protect against downgrade attacks. Samba supports SMB3.1.1 as the default maximum protocol dialect in recent versions, configurable via theclient max protocol and server max protocol parameters in smb.conf, ensuring compatibility with modern Windows clients while allowing fallback to earlier dialects if needed. Additionally, Samba 4.23.0 introduced support for SMB3 over QUIC, a 2020s extension that transports SMB3 packets over the QUIC protocol (UDP-based) for lower latency and better firewall traversal, similar to HTTP/3; this is enabled through new configuration options like server smb transport = quic and client smb transports = quic, facilitating secure access over the public internet without VPNs. However, as of November 2025, this requires the external quic.ko kernel module (tested with Linux kernel 6.14) or a userspace fallback like ngtcp2 for client-side support.[26]
For name resolution and session establishment, Samba implements NetBIOS over TCP/IP (NBT), a legacy standard defined in RFC 1001 and RFC 1002, which uses UDP port 137 for name queries and registrations alongside TCP port 139 for session services, ensuring compatibility with older Windows environments. This is handled primarily by the nmbd daemon, which can be disabled in favor of DNS for modern deployments. Samba also supports DCE/RPC (Distributed Computing Environment/Remote Procedure Call), Microsoft's adaptation of the OSF DCE standard, for invoking remote services over SMB named pipes, enabling structured inter-process communication.
Key DCE/RPC implementations in Samba include the LSARPC pipe, which provides interfaces for managing local and domain security policies such as user rights, privileges, and trusted domain objects, as specified in the MS-LSAD protocol. Similarly, the SAMR (Security Account Manager Remote) pipe allows remote administration of user accounts and groups, including enumeration and password changes, per the MS-SAMR specification. These pipes are exposed via the dcerpc endpoint servers configuration, with defaults including lsarpc and samr, and support application-level encryption using algorithms like AES for sensitive operations.
To optimize file access performance, Samba implements opportunistic locks (oplocks), a caching mechanism from SMB1 that grants clients exclusive or shared read access to files, reducing network traffic by allowing local buffering; this is enabled by default via the oplocks = yes parameter in smb.conf. In SMB2 and later, oplocks evolved into leases, which extend caching to directories and multiple handles with finer-grained states (e.g., read-only or read-write caching), implemented in Samba starting from version 4.2.0 through the smb2 leases = yes option, further configurable with kernel oplocks = no to manage interactions with underlying filesystems.
Features
File and Print Services
Samba's core functionality revolves around providing cross-platform file and print sharing services, enabling Unix-like systems to interoperate seamlessly with Windows clients over the SMB/CIFS protocol. This allows users to access shared directories and printers as if they were native Windows resources, without requiring specialized hardware or additional software on the client side. Configuration is primarily managed through the smb.conf file, which defines shares, access rules, and operational parameters to suit various network environments.[24] Share configuration in Samba is handled via sections in the smb.conf file, where predefined sections like [homes] and [printers] offer dynamic sharing, while custom shares provide flexibility for specific directories. The [homes] section automatically creates a share for each user's home directory, using the path to the user's home (e.g., /home/username) and setting read-only = no to allow write access, with browseable inheriting from global settings to control visibility in network browsers.[24] For printers, the [printers] section dynamically exposes all configured printers, requiring printable = yes and a temporary path like /var/tmp for spooling, often with guest ok = yes for anonymous access.[24] Custom shares are defined with a section header such as [myshare], specifying path = /path/to/directory, read only = no for writable access, valid users = user1,user2 for restrictions, and browseable = yes to make it discoverable.[24] File access controls in Samba integrate Unix permissions with advanced ACL mechanisms to mimic Windows behaviors. At the basic level, Samba enforces Unix file system permissions based on the connecting user's identity, supplemented by smb.conf options like force user and valid users for share-level restrictions.[27] For finer granularity, Samba supports POSIX ACL extensions on Unix file systems, mapping Windows ACL entries to POSIX descriptors (e.g., user::rwx for full owner access), enabled via nt acl support = yes in smb.conf, though limited by POSIX's lack of native inheritance.[27] Windows-style NTFS ACL mapping translates concepts like "Full Control" to POSIX rwx triplets using parameters such as security mask = 0777, storing mappings in file extended attributes for compatibility with Windows clients.[27] Print services in Samba facilitate sharing Unix printers with Windows clients through integration with the Common Unix Printing System (CUPS). Setting printing = CUPS in the [global] section of smb.conf directs Samba to use CUPS for queue management, allowing printers configured via the CUPS web interface (e.g., at https://localhost:631) to be exposed automatically through the [printers] section.[28] This setup supports raw queue types for direct driver compatibility, enabling Windows clients to submit jobs via SMB without local CUPS installation on the server.[28] For high-volume environments, the spoolssd daemon can be enabled with rpc_server:spoolss = external and rpc_daemon:spoolssd = fork to handle multiple print jobs efficiently.[28] Performance tuning for Samba file and print services involves adjusting network and connection parameters in smb.conf to optimize for scale. Socket options like TCP_NODELAY reduce latency by disabling Nagle's algorithm, potentially doubling read performance in Microsoft client environments, while SO_RCVBUF=8192 can enhance throughput but requires testing to avoid loopback degradation.[29] The max connections parameter limits simultaneous links per share (e.g., max connections = 50) to prevent resource exhaustion in large deployments, and deadtime = 15 (in minutes) automatically closes idle connections, freeing server capacity compared to the default of 10080 minutes.[24] These adjustments, combined with read size = 65536 for overlapping I/O, support efficient handling of enterprise workloads.[29] Common use cases for Samba's file and print services span home networks for simple media sharing, enterprise NAS setups for centralized storage accessible by mixed OS clients, and virtual machine environments where disk passthrough enables shared access to host resources.[30] In home setups, basic [homes] shares allow family members to exchange files seamlessly; enterprise NAS deployments leverage custom shares with ACL mapping for secure departmental access; and in virtualization, Samba facilitates passthrough of storage pools to VMs for consolidated management.[1] Authentication for these shares typically relies on local Unix accounts, with domain integration available for advanced scenarios.[24]Domain and Authentication Integration
Samba versions prior to 4.0 provided support for acting as a Primary Domain Controller (PDC) and Backup Domain Controller (BDC) in NT4-style domains, enabling basic domain authentication and user management through the smbpasswd backend or LDAP integration.[31] These capabilities allowed Samba to emulate Windows NT4 domain controllers, handling logon requests, password changes, and account synchronization in smaller networks.[32] However, this implementation was limited to legacy protocols and lacked compatibility with modern Active Directory features like Kerberos authentication or hierarchical forests. With the release of Samba 4.0 in 2012, the software evolved to support full Active Directory Domain Controller (AD DC) functionality, replicating the server-side components of Windows Server AD environments.[33] This includes integrated support for DNS via an internal BIND9-based server and Kerberos version 5 for secure authentication, allowing Samba to join or provision new AD forests and realms without requiring Windows servers.[34] As a result, Samba 4.x can serve as a drop-in replacement for Windows DCs in mixed environments, managing objects like users, groups, and computers through LDAP and replicating changes via the DRSUAPI protocol.[35] The provisioning process for setting up a Samba AD DC begins with thesamba-tool domain provision command, which initializes the necessary databases, including the NTDS DIT for directory services and a private DNS zone.[34] This tool creates an initial domain administrator account, configures Kerberos realms, and populates essential DNS records for service location (SRV) and name resolution, typically specifying options like --server-role=dc and --dns-backend=BIND9_DLZ for full functionality.[36] Once provisioned, the Samba service starts with the samba daemon in AD DC mode, enabling immediate authentication and policy enforcement across the network.
Samba supports trust relationships to facilitate interoperability with Windows Active Directory domains, including one-way trusts where a Samba domain trusts a Windows forest for authentication without reciprocal access.[37] These trusts leverage Kerberos cross-realm authentication, allowing users from the trusted domain to access Samba-managed resources while maintaining security boundaries, such as in external or forest trusts.[38] Configuration involves using samba-tool domain trust create to establish the relationship, specifying trust type, direction, and passwords, which enables seamless cross-forest authentication for services like file sharing.[39]
Group Policy Object (GPO) support in Samba AD DCs allows administrators to apply centralized configuration policies to domain-joined machines and users, mirroring Windows capabilities through integration with Remote Server Administration Tools (RSAT).[40] Policies are stored in the SYSVOL share and can be edited using RSAT's Group Policy Management Console on Windows clients, with changes replicated to additional DCs. In multi-DC setups, SYSVOL replication often relies on rsync for unidirectional synchronization of policy files, ensuring consistency without native FRS or DFSR.[41] This approach supports common policies for security settings, software deployment, and user preferences, though advanced scripting may be needed for full replication in larger deployments.[42]
Enhancements in Samba 4.x have expanded domain controller options, including Read-Only Domain Controller (RODC) support, first provided on an experimental basis in versions prior to 4.7 and made production-ready in Samba 4.7 (September 2017), with subsequent improvements including bug fixes for authentication and replication stability in later releases such as 4.15.[43] RODCs in Samba receive updates from writable DCs via RPC but do not store sensitive credentials locally, enhancing security in untrusted networks while maintaining authentication availability.[44]
Security
Known Vulnerabilities
One of the most significant vulnerabilities in Samba's history is CVE-2017-7494, commonly known as SambaCry, disclosed in May 2017. This remote code execution flaw stemmed from a buffer overflow in the server message block (SMB) file-sharing protocol implementation, allowing a malicious client to upload and execute arbitrary shared libraries on writable shares without authentication. It affected all Samba versions from 3.5.0 up to but not including 4.4.14, 4.5.10, and 4.6.4. The vulnerability was exploited in various malware campaigns, including variants reminiscent of the WannaCry ransomware that targeted Linux systems for cryptocurrency mining and backdoor installation.[45][46][47] In early versions of Samba, particularly those supporting the deprecated SMB1 protocol, weaknesses in message signing and the NTLM authentication mechanism exposed systems to man-in-the-middle attacks and relay exploits. SMB1 signing could be bypassed, enabling attackers to intercept, modify, and replay SMB traffic, while NTLM relay attacks allowed captured authentication credentials to be relayed to other network services for unauthorized privilege escalation, often without requiring password cracking. These issues were inherent to the protocol designs implemented in Samba versions prior to widespread adoption of SMB2 and later dialects with stronger protections.[48][49] The Zerologon vulnerability, designated CVE-2020-1472, affected Samba's implementation of the Netlogon Remote Protocol (MS-NRPC) and was disclosed in August 2020. This elevation-of-privilege flaw allowed an unauthenticated attacker with network access to a domain controller to impersonate any computer account, potentially compromising the entire Active Directory domain by resetting machine account passwords or crashing the server. As a protocol-level issue originally identified in Windows, it impacted Samba domain controllers in versions prior to 4.11.9, 4.12.4, and 4.13.1; the patch enforced AES encryption and signing for Netlogon secure channels to prevent such bypasses.[50][51][52] CVE-2021-44142, disclosed in December 2021, involved an out-of-bounds heap read/write vulnerability in the vfs_fruit module, which provides interoperability with macOS file systems via Apple extensions to SMB. A remote attacker with write access to a share could craft extended attribute (EA) metadata to trigger the flaw during file operations, leading to arbitrary code execution with the privileges of the smbd process, typically root. This affected all Samba versions before 4.13.17, 4.14.12, 4.15.6, and 4.16.1 when the module was enabled, which is the default in shared builds.[53][54] Post-2023 vulnerabilities highlight ongoing risks in Samba's Active Directory Domain Controller (AD DC) role and protocol implementations. For instance, CVE-2023-3961 is a path traversal vulnerability that allows a Samba client to gain unauthorized root access to internal Unix domain socket services, such as winbindd, by including directory traversal characters in client pipe names. It affects Samba versions 4.0.0 through 4.18.2 (excluding patched versions: up to 4.13.20, 4.14.14, 4.15.8, 4.16.6, 4.17.3).[55] Another example is CVE-2024-28834, a design flaw in the DirSync control that exposes Active Directory passwords and secrets to privileged users and Read-Only Domain Controllers (RODCs) in Samba versions prior to 4.19.8, 4.20.4, and 4.21.1.[56] In 2025, CVE-2025-10230 exposed a critical remote code execution flaw (CVSS 10.0) in the WINS server component for AD DCs, allowing unauthenticated attackers to execute arbitrary commands via the configured 'wins hook' script when WINS is enabled, affecting Samba versions from 4.0.0 onward; this underscored persistent protocol weaknesses in legacy features.[57] These incidents have prompted a broader shift toward mandatory use of SMB3.1.1, which incorporates enhanced encryption, signing, and multichannel capabilities to mitigate risks from older SMB dialects like SMB1 and vulnerable SMB3 implementations.[58]Mitigation and Best Practices
To secure Samba deployments, administrators should begin by hardening the core configuration in thesmb.conf file. Disabling the legacy SMB1 protocol is essential due to its known vulnerabilities; this can be achieved by setting min protocol = SMB2 in the [global] section, ensuring only SMB2 and later versions are used.[24] Additionally, enforcing SMB signing prevents man-in-the-middle attacks by requiring authentication of all SMB packets; configure this with server signing = mandatory and client signing = mandatory to mandate signing for both server and client communications.[24] These settings significantly reduce the attack surface without impacting modern clients.
Network-level protections further enhance security. Firewall rules should restrict access to Samba's primary ports, allowing only TCP 445 (and optionally TCP 139, UDP 137, and UDP 138 for legacy NetBIOS compatibility) from trusted IP ranges, such as using iptables or firewalld to block external traffic by default.[59] For brute-force protection against authentication attempts, integrate tools like Fail2Ban, which monitors Samba logs for failed logins and dynamically bans offending IPs via firewall rules; a dedicated filter for Samba's log.smbd can detect patterns like repeated invalid credentials.[60]
Maintaining up-to-date deployments is critical for addressing emerging threats. Subscribe to Samba's security notifications via the official mailing list at [email protected] or the samba-announce list to receive alerts on patches and vulnerabilities.[58] Regularly apply updates from the stable release channel, and use the smbstatus tool to monitor active connections, shares, and locks in real-time, helping detect anomalous activity such as excessive concurrent sessions.[61]
For comprehensive logging, enable the full_audit VFS module in smb.conf under specific shares with vfs objects = full_audit, which records client operations like file opens, reads, writes, and permission checks to syslog, facilitating forensic analysis of access attempts without performance overhead in most setups.[62]
When configuring Samba as an Active Directory Domain Controller (AD DC), adhere to separation of duties by isolating provisioned AD users from Unix system administrators, using distinct accounts and avoiding shared privileges to prevent privilege escalation.[34] Prefer MIT Kerberos over Samba's bundled Heimdal implementation for the KDC, as it offers better interoperability with enterprise tools and upstream support; provision Samba with MIT Kerberos during compilation or via distro packages for enhanced compatibility.[63]
As of 2025, incorporate emerging protocols like SMB over QUIC for deployments requiring encrypted tunnels over untrusted networks; enable it in Samba 4.23+ via the server smb transport options in smb.conf, leveraging TLS 1.3 for secure, VPN-alternative file access.[64] Align with zero-trust principles by integrating multi-factor authentication (MFA) through AD federation with identity providers, enforcing device trust and continuous verification for all access requests.[65]
