tree connect failed: NT_STATUS_BAD_NETWORK_NAME

As noted at https://bbs.archlinux.org/viewtopic.php?id=124128 , smbclient was broken for a very long time in that it couldn’t / wouldn’t map to subdirectories under a top-level share.

I’ve seen this problem on many of my servers, and it has actually been a source of frustration for me for several years.  It never occurred to me to check visibility to subdirectories; until just recently, I’d only ever checked connectivity to subdirectories.  In many cases, I implemented work-arounds in the absence of finding any resolution (e.g., creating a new top-level share – and note that this was without understanding why the workaround was effective).

By way of example, the following will generate a permissions-related error, apparently indicating a server-side problem:

 $ smbclient //fileserver/fileserver_data/Public/Data/Restricted password -U user -W domain.com -c "dir"
Domain=[DOMAIN] OS=[Windows Server 2003 3790 Service Pack 2] Server=[Windows Server 2003 5.2]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
$

If you can do so, the correct (and rather obvious) fix is to install Samba 3.6.0.1 or newer.

If you can’t upgrade Samba (e.g., due to your OS, testing requirements, or whatever), do this instead:

 $ smbclient //fileserver/fileserver_data password -U user -W domain.com -c "dir Public/Data/Restricted/*"
Domain=[DOMAIN] OS=[Windows Server 2003 3790 Service Pack 2] Server=[Windows Server 2003 5.2]
.                                   D       0  Tue Sep 11 06:28:00 2012
..                                  D       0  Tue Sep 11 06:28:00 2012
<remaining output intentionally omitted>

And finally, note that if you’re using Samba 3.2 or lower, you cannot connect to Windows Server 2008 SMB shares.

 

Loading Facebook Comments ...