将Samba连接到Windows Share将返回“NT_STATUS_DUPLICATE_NAME”

我已经在我的Windows机器上设置了一个共享目录,并赋予用户名@工作组完整的控制权限。

当我使用smbclient尝试使用Linux连接到Windows机器时,出现错误NT_STATUS_DUPLICATE_NAME 。 成绩单:

 $ 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 

如果我故意input错误的用户名,密码或工作组,我会得到一个不同的错误: NT_STATUS_LOGON_FAILURE 。 所以好像我正在获取其他信息。

我把/ etc / hosts中的一个条目指向了windows-machine的IP地址。 Windows机器的NetBIOS名称是不同的。

有谁知道这个错误是什么意思?

Windows机器的NetBIOS名称是不同的

这是你的问题。 它很容易通过在Windows机器上的registry黑客修复。 有关详细信息,请参阅http://support.microsoft.com/kb/281308

JR

你可能会得到这个错误,因为Windows机器不理解自己被识别为你连接的那个。 (使用错误的身份validation信息会更改错误,因为此问题在连接过程中稍后才会出现。)

尝试连接到它的IP号码,而不是windows-machine 。 如果这样做,它确认名称的事情是怎么回事,你可以通过使PDC了解自己是windows-machine还是只使用IP号码来解决它。

您应该使用“-m”标志来指定您将使用的最大协议版本。 默认情况下,它是“NT1”,在这里从smbclient的手册页:

 -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. 

我怀疑“NT1”版本依靠netbios的东西,不像SMB2和下一个。

所以用“-m SMB3”或者“-m SMB2”再试一次,你也可以在性能上得到很多的好处。

您可以使用-I选项并提供IP地址。

 smbclient -U username -W workgroup -L //windows-machine -I <machine-ipaddr> 

您不能在/ etc / hosts中使用机器的名称,也不能使用DNS服务器的名称。

您必须使用计算机的IP地址或Windows中指定的计算机的NetBIOS名称。

在Windows XP中查找NetBIOS名称:

  1. 右键单击“我的电脑”
  2. 点击“属性”
  3. 点击“计算机名称”选项卡
  4. 阅读“完整计算机名称”字段,直到第一个时间段'.'