This episode hardens Samba: disabling SMB1 via server min protocol = SMB2_10, evaluating ntlm auth = no, requiring server signing and encryption, and building an audit with smbstatus and the right log level. You get a hardening baseline you can apply directly in production.

The firewall in episode 13 secured the entrance; now we harden the server itself. SMB hardening means closing the fragile legacy features, requiring modern security mechanisms, and building an audit so suspicious behavior becomes visible. The goal: a configuration that, if audited by a pentester or SOC, produces no major findings.
SMB1 has been disabled by default since Samba 4.11 (episode 2), but you should assert and document it so it doesn't silently shift:
[global]
server min protocol = SMB2_10
server max protocol = SMB3_11server min protocol = SMB2_10 rejects clients below SMB2.1. Don't choose SMB1 or NT1 under any circumstances — every dialect below SMB2 carries an unjustifiable attack surface. For environments with only modern clients, SMB3 (not SMB3_11) is also a valid, stricter option.
Warning
Lowering server min protocol "so legacy clients can connect" is a decision that should be firmly rejected. Devices that only speak SMB1 (old USB-to-LAN printers, ancient NAS, Windows XP) are a risk not worth taking. Replace the devices, don't weaken the server. If truly forced, isolate those devices on a separate VLAN and dedicated share — not by weakening global policy.
NTLM is a legacy authentication protocol vulnerable to pass-the-hash and relay attacks (we can dampen relay with signing, but not all of it). Kerberos is the modern standard in AD domains. The parameter:
[global]
ntlm auth = no
lanman auth = nontlm auth = no: reject NTLM authentication — clients must use Kerberos. Consequence: legacy devices/consoles that don't support Kerberos will fail to log in.lanman auth = no: reject the even weaker LM hashes — this is almost always safe to turn off.ntlm auth = no can't be applied blindly:
no is generally safe.Signing protects integrity and dampens SMB relay attacks (protocol smuggling). In Samba:
[global]
server signing = required
smb encrypt = requiredserver signing = required + smb encrypt = required is the hardest combination: every connection is signed and encrypted. Trade-offs: extra CPU load (minimal on modern CPUs with AES-NI) and compatibility — legacy devices without SMB3 encryption support will be rejected. For a modern production baseline, that's a fair price.
1. server min protocol = SMB2_10 (matikan SMB1)
2. lanman auth = no (matikan LM hash)
3. server signing = required (cegah relay)
4. smb encrypt = required (enkripsi wire)
5. ntlm auth = no (Kerberos only, bila aman)smbstatus is a window into active connections — make it a habit:
smbstatus
smbstatus -b # detail per user/klien
smbstatus -L # share yang sedang diaksessmbstatus -b shows user, origin host, IP, and protocol. You'll immediately see strange connections (e.g. a foreign IP at unusual working hours) — this is the cheapest real-time audit.
log level controls log verbosity. Default 1 (errors only); for troubleshooting we use 3 (episode 16). For an authentication audit, enable a dedicated log:
[global]
log level = 1 auth_audit:2
log file = /var/log/samba/log.%m
max log size = 1024log level = 1 auth_audit:2 raises verbosity only for the auth_audit category — you get successful/failed login records without being flooded by whole-system logs. Check:
sudo grep -i "NT_STATUS" /var/log/samba/*.log
sudo journalctl -u smbd | grep -iE "(failed|denied|authenticat)"NT_STATUS_LOGON_FAILURE is a sign of failed login attempts — if the frequency is high from one IP, that's a brute-force signal to act on (episode 15).
Tip
Don't jump straight to log level = 10 — that's a debug mode that floods logs and slows the server. Raise the level gradually and per-category: auth_audit for security, smbd:3 for connection issues. Logs that are too verbose get ignored — and ignored logs are useless for auditing.
The minimum hardening set for a modern file server:
[global]
security = user
map to guest = never
server min protocol = SMB2_10
server max protocol = SMB3_11
ntlm auth = no
lanman auth = no
server signing = required
smb encrypt = required
log level = 1 auth_audit:2
log file = /var/log/samba/log.%m
max log size = 1024Validate after all changes: testparm then smbcontrol all reload-config (episode 3). For an AD DC, adjust: ntlm auth = no can break apps still on NTLM — apply it after an audit.
smb encrypt = required: there are clients without encryption support — use desired first while auditing, then move up to required.smbstatus -b — if the protocol is SMB3_11 but without enc/signing, there's an override at the share level.ntlm auth = no: legacy devices connect with NTLM — restrict them to a separate VLAN or allow NTLM only for specific accounts via a per-allowlist ntlm auth.Key takeaways:
server min protocol = SMB2_10 closes SMB1 and all fragile dialects below it.ntlm auth = no and lanman auth = no remove legacy authentication protocols — apply after an audit.server signing = required + smb encrypt = required is the modern connection baseline.smbstatus is real-time auditing; auth_audit in log level records login events.In episode 15 next, we'll cover privilege & ransomware mitigation — immutable snapshots, read-only shares for backup targets, recycle as a safety net, monitoring suspicious access, plus least privilege and share segregation best practices. Your server will be prepared for the worst-case scenario!