Connecting with Samba to a Windows Share returns "NT_STATUS_DUPLICATE_NAME"
Solution 1
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.
Solution 2
You're probably getting that error because the Windows machine doesn't understand itself to be identified as what you're connecting to it as. (Using a wrong auth information changes the error because this issue doesn't crop up until later in the connection process.)
Try connecting to it as its IP number, not windows-machine
. If that works, it confirms that the name thing is what's going on, and you can resolve it either by making the PDC understand itself to be windows-machine
or by just using the IP number.
Solution 3
You should use the "-m" flag to specify the max protocol version you'll be using. By default it's "NT1", here from the smbclient's man page:
-m|--max-protocol protocol
This allows the user to select the highest SMB protocol level that
smbclient will use to connect to the server. By default this is set
to NT1, which is the highest available SMB1 protocol. To connect
using SMB2 or SMB3 protocol, use the strings SMB2 or SMB3
respectively. Note that to connect to a Windows 2012 server with
encrypted transport selecting a max-protocol of SMB3 is required.
I suspect the "NT1" version to rely on netbios things, unlike SMB2 and next.
So try again with "-m SMB3" or "-m SMB2", you also benefit a lot in performance as well.
Solution 4
you can use the -I option and provide the ip address.
smbclient -U username -W workgroup -L //windows-machine -I <machine-ipaddr>
Related videos on Youtube
Dennis Plucinik
Updated on September 17, 2022Comments
-
Dennis Plucinik over 1 year
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?
-
Dennis Plucinik almost 15 yearsI wonder why this isn't just fixed in a patch.
-
Joril almost 5 yearslink looks dead (404). Anyway the key should be
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\LanmanServer\Parameters\DisableStrictNameChecking
-
Joril almost 5 years...or better yet, OptionalNames