15

I'm stuck in NT_STATUS_BAD_NETWORK_NAME error but can't understand what I'm doing wrong.

My objective: copy a file from ubuntu to windows in a simple command line to be called by php.

The problem: when I add more than one folder to the path it throws the NT_STATUS_BAD_NETWORK_NAME error.

Example:

smbclient -U someuser%somepassword //10.0.1.250/Home/Public/Offline -c 'put "test.deb"'

Domain=[FILESERVER] OS=[Windows Server 2012 Standard 9200] Server=[Windows Server 2012 Standard 6.2]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

But when I try just:

smbclient -U someuser%somepassword //10.0.1.250/Home

It connects and I can do a put with the same file:

smb: \> cd Public/Offline
smb: \Public\Offline\> put test.deb

So it not seems to be a permissions issue.

What could I doing wrong?

Reto
  • 103
  • 3
cassiano
  • 253
  • 1
  • 2
  • 6

1 Answers1

15

Try to use the initial directory option (--directory Public/Offline)

andrej
  • 396
  • 3
  • 7
  • 6
    ``smbclient -U someuser%somepassword //10.0.1.250/Home --directory Public/Offline -c 'put "test.deb"'`` is working. Thanks! – cassiano Apr 25 '16 at 14:12
  • 1
    i am gertting this error tree connect failed: NT_STATUS_BAD_NETWORK_NAME – Jay Momaya Mar 20 '19 at 13:15
  • @JayMomaya check this https://serverfault.com/a/137298 it said this is caused by insufficient right to the whole path so check permissions to all dirs along the path you use – andrej May 06 '20 at 07:34
  • Make sure if you are using server_name instead of server_ip - you are using the full qualified name. like xx.yy.com or xx.yy.net etc. – technazi May 21 '21 at 16:14