Samba: connecting to a DFS share using smbclient

7,054

The error "tree connect failed: NT_STATUS_BAD_NETWORK_NAME" is because the path is not correct. Example: Path = //<dfs-url>/data/share1 Path = //<dfs-url>/data/share2

When mounting cifs, you can mount //<dfs-url>/data and see both shares. With smbclient you only can use //<dfs-url>/data/share1 or share2

Share:
7,054

Related videos on Youtube

equaeghe
Author by

equaeghe

Updated on September 18, 2022

Comments

  • equaeghe
    equaeghe over 1 year

    I have a problem connecting to a DFS share using smbclient. It does work using mount -t cifs. Namely, when I do

    sudo mount -t cifs //<dfs-url>/<service> ~/mountpoint/ -o username=<username>   
    

    things work perfectly. However, doing

    smbclient //<dfs-url>/<service> -U <username> -W <workgroup>
    Enter <username>'s password:
    Domain=[<domain>] OS=[Windows Server 2012 R2 Datacenter 9600] Server=[Windows Server 2012 R2 Datacenter 6.3]
    tree connect failed: NT_STATUS_BAD_NETWORK_NAME 
    

    I would expect that if I can connect using a cifs mount, I should be able to connect using smbclient. Am I doing something wrong with the smbclient invokation? Has anbody managed to connect to a DFS share using smbclient?

  • equaeghe
    equaeghe over 7 years
    Thanks for looking at this. However, I have a path to the share under the service, but adding it does not help. I'd need to get a more helpful response from smbclient to be able to test further.