Starting with Samba 4.20, administrators have reported that using include = /etc/samba/smb.conf.%I does not reliably apply settings like server min protocol = NT1. The reason is that protocol negotiation happens at the very start of the connection, before the include file is loaded. As a result, even if you specify NT1 in the per-IP include file, the server has already locked onto the global default (SMB2_02 or higher), and the client will fail with “No protocol supported”.
This article explains why this happens and how to fix it using config file = %I.
includefiles are processed after the initial configuration has already been loaded.- The protocol negotiation phase occurs immediately when the client connects. At this point, Samba has not yet read the per-IP include file.
- Therefore, critical parameters like
server min protocolorntlm authare not in effect during the handshake.
Unlike include, the config file directive switches the entire configuration to the specified file before negotiation starts. This ensures that per-IP settings apply from the very first packet.
Move shared settings and share definitions into a common file, e.g.:
/etc/samba/smb.conf.common
In your main config:
[global]
config file = /etc/samba/smb.conf.%I
include = /etc/samba/smb.conf.common- If
/etc/samba/smb.conf.%Idoes not exist for a given client IP, Samba ignores it and continues with the rest of the config. %Iexpands to the client’s IP address.
Example for client 172.19.37.72:
# /etc/samba/smb.conf.172.19.37.72
[global]
server min protocol = NT1
ntlm auth = yes
lanman auth = no
include = /etc/samba/smb.conf.commontestparm -s /etc/samba/smb.conf.172.19.37.72
systemctl restart smbd
smbclient -L //SERVER -U user -m NT1-
Keep per-IP files minimal: only override what differs from the default.
-
Always include the common config to avoid duplication and errors.
-
Secure SMB1/NTLMv1 usage:
- Restrict access to known client IPs (
hosts allow/ firewall rules). - Keep shares read-only whenever possible.
- Isolate legacy instances (e.g., bind to a separate interface/IP).
- Plan for deprecation—SMB1/NTLMv1 are inherently insecure.
- Restrict access to known client IPs (
include = %Iis too late for protocol negotiation.- Use
config file = %Iinstead to ensure per-client IP settings likeserver min protocol = NT1are applied during the initial handshake. - Restrict and isolate any SMB1 usage to minimize security risks.