Fix ‘NT_STATUS_DUPLICATE_NAME’ Error When Connecting Samba to Windows Share

file-sharinglinuxsambawindows

I have set a shared directory on my Windows machine, and given full control permissions to username@workgroup.

When I try to connect to the Windows machine with Linux using smbclient, I get the error NT_STATUS_DUPLICATE_NAME. Here is the transcript:

$ smbclient -U username -W workgroup -L //windows-machine
Enter username's password: 
Domain=[workgroup] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
tree connect failed: NT_STATUS_DUPLICATE_NAME

If I intentionally enter the wrong username, password or workgroup, I get a different error: NT_STATUS_LOGON_FAILURE. So it seems like I'm getting the other information right.

I put an entry in /etc/hosts that points windows-machine to its IP address. The NetBIOS name of the windows machine is something different.

Does anyone know what this error means?

Best Answer

The NetBIOS name of the windows machine is something different

That's your problem. It's easily fixed by a registry hack on the Windows machine. See http://support.microsoft.com/kb/281308 for the details.

Update

The original support article linked above has disappeared (thanks Microsoft). The new article is SMB file server share access is unsuccessful through DNS CNAME alias.

Joril also points out that a server can have multiple NetBIOS names. This is done by editing the registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\lanmanserver\parameters\OptionalNames

and adding the extra names.