Samba is free, open-source software that implements Microsoft’s SMB protocol, letting Linux and Unix systems share files and printers with Windows.
How Samba works
Samba was started in 1992 by Andrew Tridgell and is released under the GPL. It implements the SMB (Server Message Block) protocol, also known in older versions as CIFS, used by Windows for network shares. With Samba a Linux server or NAS can:
- offer file shares and printers to Windows, macOS and Linux clients;
- join a Windows domain as a member server with user authentication through Active Directory;
- act as an Active Directory domain controller itself (since Samba 4).
Almost every home and office NAS (Synology, QNAP and others) uses Samba to provide Windows shares.
Why Samba matters for security
File shares hold valuable data and are an obvious target for ransomware. Samba has had critical vulnerabilities, the best known being SambaCry (CVE-2017-7494), which allowed remote code execution by uploading a malicious library to a writable share and was used to infect NAS devices with cryptominers. Other risks are weak or guest-accessible shares, outdated protocol versions and NAS devices exposed directly to the internet on port 445.
Best practices
- Keep Samba and NAS firmware up to date.
- Disable SMB1; use SMB3 with signing and encryption.
- Never expose SMB (TCP 445) to the internet; use a VPN for remote access.
- Give users only the shares they need, disable guest access and keep offline backups.