When attempting to connect from Linux to a Windows file share using smbclient, the NT_STATUS_DUPLICATE_NAME error typically indicates a naming conflict in the network environment. This isn't about authentication (which would throw NT_STATUS_LOGON_FAILURE), but rather about how your machines identify themselves on the network.
Several scenarios can trigger this error:
1. NetBIOS name collision (another machine using same name)
2. DNS/hosts file conflict
3. Incorrect name resolution order configuration
4. Cached name resolution problems
First, verify the Windows machine's actual NetBIOS name:
# On Windows command prompt:
hostname
Then check network visibility:
# On Linux:
nmblookup -A <windows_ip>
smbclient -L <windows_ip> -U%
1. Edit smb.conf to enforce proper name resolution:
[global]
name resolve order = bcast host lmhosts wins
netbios name = YOUR_LINUX_HOSTNAME
workgroup = YOUR_WORKGROUP
2. Clear NetBIOS cache on Windows:
nbtstat -R
3. Verify hosts file entries match actual NetBIOS names.
Try connecting using different identifiers:
smbclient //192.168.1.100/share -U user
smbclient //FQDN.of.server/share -U user
Or using more verbose logging:
smbclient -d3 //server/share -U user
For stable connections, consider:
1. Setting up WINS server
2. Using consistent DNS resolution
3. Ensuring unique NetBIOS names
4. Disabling NetBIOS if using pure TCP/IP
The NT_STATUS_DUPLICATE_NAME
error typically occurs when there's a naming conflict in the network environment. This happens when:
- Multiple machines respond to the same NetBIOS name
- DNS/hosts file entries conflict with NetBIOS resolution
- Workgroup/domain membership issues exist
First, verify your network configuration:
# Check NetBIOS name resolution
nmblookup -A <windows-machine-ip>
# Verify Samba connectivity
smbclient -L //<ip-address> -U username -W workgroup
If you get different results using the machine name versus IP address, you've likely found the naming conflict.
1. Fix Hostname Resolution
Ensure your /etc/hosts
entry matches the Windows machine's actual NetBIOS name:
# Instead of this (may cause conflicts):
192.168.1.100 windows-machine
# Use the actual NetBIOS name (check in Windows System Properties):
192.168.1.100 WIN-PC-NAME
2. Adjust Samba Client Parameters
Try connecting with these additional parameters:
smbclient -U username -W workgroup -m SMB2 \
--option='client min protocol=SMB2' \
--option='client max protocol=SMB3' \
//WIN-PC-NAME/share
3. Check Windows Configuration
On the Windows machine:
- Open
System Properties
- Verify the
Computer Name
tab shows a unique name - Ensure
Workgroup
matches what you're using in smbclient
If the issue persists, enable Samba debugging:
smbclient -d3 -U username -W workgroup //WIN-PC-NAME/share
This will show detailed negotiation attempts and may reveal the exact point of failure.
Create or modify /etc/samba/smb.conf
with these settings:
[global]
workgroup = WORKGROUP
client min protocol = SMB2
client max protocol = SMB3
name resolve order = bcast host lmhosts wins
netbios name = LINUX-CLIENT
Then test with:
smbclient -U username //WIN-PC-NAME/share