I'm using this command for testing the SMB connection:
smbclient -A=credential_file -L \\hostname
Sharename Type Comment
--------- ---- -------
ADMIN$ Disk Remote Admin
C$ Disk Default share
Acme Disk
Acme Directory Disk
Share Disk
SMB1 disabled -- no workgroup available
I can explore the Acme directory because there isn't space in its name with this command :
smbclient -A=credential_file \\\\hostname\\Acme -c "dir"
but if I want to explore the directory Acme Directory with these command as example I've error message
smbclient -A=credential_file \\\\hostname\\Acme\ Directory -c "dir"
NT_STATUS_ACCESS_DENIED listing \*
smbclient -A=credential_file \\\\hostname\\Acme\%20Directory -c "dir"
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
How to explore directory with space in its name ?
NT_STATUS_ACCESS_DENIED
means there is a problem with the name? In the last case there was a problem with the name and you gotNT_STATUS_BAD_NETWORK_NAME
.-L
output throughcat -t
. Note, you can use "/" instead of backslash in the cli, and then don't need to escape, eg:smbclient //hostname/Acme
.\040
in place of the space like//hostanme/directory1\040Super\040Directory
. I mean the backslash is used for mark a special character and in this case it's backslash. It's the reason there are 4 backslash before the hostname.