Sub topic 2
SMB and the Samba daemons
Assume you are comfortable with Linux services, users, groups, file permissions, and basic TCP/IP networking. You should also know how to use systemctl and edit configuration files.
SMB as a network file protocol
SMB, originally called Server Message Block, is a client-server protocol for accessing files, directories, printers, and other resources over a network. CIFS is an older dialect of SMB. Modern Samba installations normally use SMB2 or SMB3 because SMB1 has serious security and design limitations.
A client requests an operation, such as opening a file or listing a directory. The server checks the authenticated identity and the share's rules, then applies the underlying Linux permissions. Access succeeds only when both layers allow it.
| Component | Role |
|---|---|
| SMB client | Requests files and other resources |
| Samba server | Implements SMB and serves configured resources |
| Share | A named resource, such as `projects` |
| Linux filesystem | Enforces ownership, modes, ACLs, and labels |
SMB commonly uses TCP port 445. Older NetBIOS-based operation can use TCP port 139 and UDP ports 137 and 138, but new deployments should avoid depending on these legacy services.
Samba's main daemons
Samba is a suite of programs that implements SMB on Linux. The main file-serving daemon is smbd. It accepts client connections, authenticates users, handles file operations, and enforces share-level settings.
nmbd provides older NetBIOS name service and browsing support. It is needed only for legacy discovery methods. It is not required for ordinary SMB access through DNS or a direct server name.
winbindd maps Windows domain users and groups to local identities. A standalone server with local Samba users does not normally need it. A domain member commonly uses it together with Kerberos and an identity service.
Service layout and protocol selection
On many distributions, the service is managed as smb or smbd. Check the package documentation for the exact unit name:
sudo systemctl status smb
sudo systemctl enable --now smbSamba reads its primary configuration from /etc/samba/smb.conf. The [global] section sets server-wide behavior, including the minimum SMB protocol. Individual sections define named shares. Authentication mode, permitted users, and filesystem permissions are separate concerns, so changing one does not automatically override the others.
Exercise
Which daemon normally handles file operations for an SMB client, and which daemon maps domain identities to Linux identities?
Show answer
smbd handles SMB file operations. winbindd maps Windows domain users and groups to local identities.