LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   tree connect failed: NT_STATUS_BAD_NETWORK_NAME (https://www.linuxquestions.org/questions/linux-newbie-8/tree-connect-failed-nt_status_bad_network_name-4175712031/)

riahc3 05-13-2022 03:06 AM

tree connect failed: NT_STATUS_BAD_NETWORK_NAME
 
Im trying to use smbclient to connect and I get this error tree connect failed: NT_STATUS_BAD_NETWORK_NAME

Here is debug:

root@CLIENTPC:/usr/lib/nagios/plugins# smbclient \\\\192.168.3.222\\SHARE\\folder -I 192.168.3.222 --debuglevel=10
INFO: Current debug levels:
all: 10
tdb: 10
printdrivers: 10
lanman: 10
smb: 10
rpc_parse: 10
rpc_srv: 10
rpc_cli: 10
passdb: 10
sam: 10
auth: 10
winbind: 10
vfs: 10
idmap: 10
quota: 10
acls: 10
locking: 10
msdfs: 10
dmapi: 10
registry: 10
scavenger: 10
dns: 10
ldb: 10
tevent: 10
auth_audit: 10
auth_json_audit: 10
kerberos: 10
drs_repl: 10
smb2: 10
smb2_credits: 10
dsdb_audit: 10
dsdb_json_audit: 10
dsdb_password_audit: 10
dsdb_password_json_audit: 10
dsdb_transaction_audit: 10
dsdb_transaction_json_audit: 10
dsdb_group_audit: 10
dsdb_group_json_audit: 10
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
INFO: Current debug levels:
all: 10
tdb: 10
printdrivers: 10
lanman: 10
smb: 10
rpc_parse: 10
rpc_srv: 10
rpc_cli: 10
passdb: 10
sam: 10
auth: 10
winbind: 10
vfs: 10
idmap: 10
quota: 10
acls: 10
locking: 10
msdfs: 10
dmapi: 10
registry: 10
scavenger: 10
dns: 10
ldb: 10
tevent: 10
auth_audit: 10
auth_json_audit: 10
kerberos: 10
drs_repl: 10
smb2: 10
smb2_credits: 10
dsdb_audit: 10
dsdb_json_audit: 10
dsdb_password_audit: 10
dsdb_password_json_audit: 10
dsdb_transaction_audit: 10
dsdb_transaction_json_audit: 10
dsdb_group_audit: 10
dsdb_group_json_audit: 10
Processing section "[global]"
doing parameter client min protocol = CORE
doing parameter client max protocol = SMB3
doing parameter workgroup = WORKGROUP
doing parameter log file = /var/log/samba/log.%m
doing parameter max log size = 1000
doing parameter logging = file
doing parameter panic action = /usr/share/samba/panic-action %d
doing parameter server role = standalone server
doing parameter obey pam restrictions = yes
doing parameter unix password sync = yes
doing parameter passwd program = /usr/bin/passwd %u
doing parameter passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
doing parameter pam password change = yes
doing parameter map to guest = bad user
doing parameter usershare allow guests = yes
pm_process() returned Yes
lp_servicenumber: couldn't find homes
added interface eth0 ip=192.168.20.6 bcast=192.168.20.255 netmask=255.255.255.0
Netbios name list:-
my_netbios_names[0]="CLIENTPC"
Client started (version 4.13.13-Debian).
Connecting to 192.168.3.222 at port 445
Socket options:
SO_KEEPALIVE = 0
SO_REUSEADDR = 0
SO_BROADCAST = 0
TCP_NODELAY = 1
TCP_KEEPCNT = 9
TCP_KEEPIDLE = 7200
TCP_KEEPINTVL = 75
IPTOS_LOWDELAY = 0
IPTOS_THROUGHPUT = 0
SO_REUSEPORT = 0
SO_SNDBUF = 87040
SO_RCVBUF = 131072
SO_SNDLOWAT = 1
SO_RCVLOWAT = 1
SO_SNDTIMEO = 0
SO_RCVTIMEO = 0
TCP_QUICKACK = 1
TCP_DEFER_ACCEPT = 0
TCP_USER_TIMEOUT = 0
session request ok
negotiated dialect[NT1] against server[192.168.3.222]
Enter WORKGROUP\root's password:
cli_session_setup_spnego_send: Connect to 192.168.3.222 as root@WORKGROUP using SPNEGO
GENSEC backend 'gssapi_spnego' registered
GENSEC backend 'gssapi_krb5' registered
GENSEC backend 'gssapi_krb5_sasl' registered
GENSEC backend 'spnego' registered
GENSEC backend 'schannel' registered
GENSEC backend 'naclrpc_as_system' registered
GENSEC backend 'sasl-EXTERNAL' registered
GENSEC backend 'ntlmssp' registered
GENSEC backend 'ntlmssp_resume_ccache' registered
GENSEC backend 'http_basic' registered
GENSEC backend 'http_ntlm' registered
GENSEC backend 'http_negotiate' registered
GENSEC backend 'krb5' registered
GENSEC backend 'fake_gssapi_krb5' registered
Starting GENSEC mechanism spnego
Starting GENSEC submechanism gse_krb5
Cannot do GSE to an IP address
Failed to start GENSEC client mech gse_krb5: NT_STATUS_INVALID_PARAMETER
Starting GENSEC submechanism ntlmssp
negotiate: struct NEGOTIATE_MESSAGE
Signature : 'NTLMSSP'
MessageType : NtLmNegotiate (1)
NegotiateFlags : 0x62088215 (1644724757)
1: NTLMSSP_NEGOTIATE_UNICODE
0: NTLMSSP_NEGOTIATE_OEM
1: NTLMSSP_REQUEST_TARGET
1: NTLMSSP_NEGOTIATE_SIGN
0: NTLMSSP_NEGOTIATE_SEAL
0: NTLMSSP_NEGOTIATE_DATAGRAM
0: NTLMSSP_NEGOTIATE_LM_KEY
0: NTLMSSP_NEGOTIATE_NETWARE
1: NTLMSSP_NEGOTIATE_NTLM
0: NTLMSSP_NEGOTIATE_NT_ONLY
0: NTLMSSP_ANONYMOUS
0: NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED
0: NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED
0: NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL
1: NTLMSSP_NEGOTIATE_ALWAYS_SIGN
0: NTLMSSP_TARGET_TYPE_DOMAIN
0: NTLMSSP_TARGET_TYPE_SERVER
0: NTLMSSP_TARGET_TYPE_SHARE
1: NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
0: NTLMSSP_NEGOTIATE_IDENTIFY
0: NTLMSSP_REQUEST_NON_NT_SESSION_KEY
0: NTLMSSP_NEGOTIATE_TARGET_INFO
1: NTLMSSP_NEGOTIATE_VERSION
1: NTLMSSP_NEGOTIATE_128
1: NTLMSSP_NEGOTIATE_KEY_EXCH
0: NTLMSSP_NEGOTIATE_56
DomainNameLen : 0x0000 (0)
DomainNameMaxLen : 0x0000 (0)
DomainName : *
DomainName : ''
WorkstationLen : 0x0000 (0)
WorkstationMaxLen : 0x0000 (0)
Workstation : *
Workstation : ''
Version: struct ntlmssp_VERSION
ProductMajorVersion : NTLMSSP_WINDOWS_MAJOR_VERSION_6 (6)
ProductMinorVersion : NTLMSSP_WINDOWS_MINOR_VERSION_1 (1)
ProductBuild : 0x0000 (0)
Reserved: ARRAY(3)
[0] : 0x00 (0)
[1] : 0x00 (0)
[2] : 0x00 (0)
NTLMRevisionCurrent : NTLMSSP_REVISION_W2K3 (15)
gensec_update_send: ntlmssp[0x56112c805d90]: subreq: 0x56112c7fffc0
gensec_update_send: spnego[0x56112c7ff340]: subreq: 0x56112c8052a0
gensec_update_done: ntlmssp[0x56112c805d90]: NT_STATUS_MORE_PROCESSING_REQUIRED tevent_req[0x56112c7fffc0/../../auth/ntlmssp/ntlmssp.c:180]: state[2] error[0 (0x0)] state[struct gensec_ntlmssp_update_state (0x56112c800170)] timer[(nil)] finish[../../auth/ntlmssp/ntlmssp.c:215]
gensec_update_done: spnego[0x56112c7ff340]: NT_STATUS_MORE_PROCESSING_REQUIRED tevent_req[0x56112c8052a0/../../auth/gensec/spnego.c:1631]: state[2] error[0 (0x0)] state[struct gensec_spnego_update_state (0x56112c805450)] timer[(nil)] finish[../../auth/gensec/spnego.c:2116]
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
NTLMSSP_NEGOTIATE_UNICODE
NTLMSSP_REQUEST_TARGET
NTLMSSP_NEGOTIATE_SIGN
NTLMSSP_NEGOTIATE_NTLM
NTLMSSP_NEGOTIATE_ALWAYS_SIGN
NTLMSSP_TARGET_TYPE_SERVER
NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
NTLMSSP_NEGOTIATE_TARGET_INFO
NTLMSSP_NEGOTIATE_VERSION
NTLMSSP_NEGOTIATE_128
NTLMSSP_NEGOTIATE_KEY_EXCH
challenge: struct CHALLENGE_MESSAGE
Signature : 'NTLMSSP'
MessageType : NtLmChallenge (0x2)
TargetNameLen : 0x0016 (22)
TargetNameMaxLen : 0x0016 (22)
TargetName : *
TargetName : 'TARGETSERVER'
NegotiateFlags : 0x628a8215 (1653244437)
1: NTLMSSP_NEGOTIATE_UNICODE
0: NTLMSSP_NEGOTIATE_OEM
1: NTLMSSP_REQUEST_TARGET
1: NTLMSSP_NEGOTIATE_SIGN
0: NTLMSSP_NEGOTIATE_SEAL
0: NTLMSSP_NEGOTIATE_DATAGRAM
0: NTLMSSP_NEGOTIATE_LM_KEY
0: NTLMSSP_NEGOTIATE_NETWARE
1: NTLMSSP_NEGOTIATE_NTLM
0: NTLMSSP_NEGOTIATE_NT_ONLY
0: NTLMSSP_ANONYMOUS
0: NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED
0: NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED
0: NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL
1: NTLMSSP_NEGOTIATE_ALWAYS_SIGN
0: NTLMSSP_TARGET_TYPE_DOMAIN
1: NTLMSSP_TARGET_TYPE_SERVER
0: NTLMSSP_TARGET_TYPE_SHARE
1: NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
0: NTLMSSP_NEGOTIATE_IDENTIFY
0: NTLMSSP_REQUEST_NON_NT_SESSION_KEY
1: NTLMSSP_NEGOTIATE_TARGET_INFO
1: NTLMSSP_NEGOTIATE_VERSION
1: NTLMSSP_NEGOTIATE_128
1: NTLMSSP_NEGOTIATE_KEY_EXCH
0: NTLMSSP_NEGOTIATE_56
ServerChallenge : e9005e42aab7c3f7
Reserved : 0000000000000000
TargetInfoLen : 0x0074 (116)
TargetInfoMaxLen : 0x0074 (116)
TargetInfo : *
TargetInfo: struct AV_PAIR_LIST
count : 0x00000006 (6)
pair: ARRAY(6)
pair: struct AV_PAIR
AvId : MsvAvNbDomainName (0x2)
AvLen : 0x0016 (22)
Value : union ntlmssp_AvValue(case 0x2)
AvNbDomainName : 'TARGETSERVER'
pair: struct AV_PAIR
AvId : MsvAvNbComputerName (0x1)
AvLen : 0x0016 (22)
Value : union ntlmssp_AvValue(case 0x1)
AvNbComputerName : 'TARGETSERVER'
pair: struct AV_PAIR
AvId : MsvAvDnsDomainName (0x4)
AvLen : 0x0016 (22)
Value : union ntlmssp_AvValue(case 0x4)
AvDnsDomainName : 'TARGETSERVER'
pair: struct AV_PAIR
AvId : MsvAvDnsComputerName (0x3)
AvLen : 0x0016 (22)
Value : union ntlmssp_AvValue(case 0x3)
AvDnsComputerName : 'TARGETSERVER'
pair: struct AV_PAIR
AvId : MsvAvFlags (0x6)
AvLen : 0x0004 (4)
Value : union ntlmssp_AvValue(case 0x6)
AvFlags : 0x00000001 (1)
1: NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT
0: NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE
0: NTLMSSP_AVFLAG_TARGET_SPN_FROM_UNTRUSTED_SOURCE
pair: struct AV_PAIR
AvId : MsvAvEOL (0x0)
AvLen : 0x0000 (0)
Value : union ntlmssp_AvValue(case 0x0)
Version: struct ntlmssp_VERSION
ProductMajorVersion : NTLMSSP_WINDOWS_MAJOR_VERSION_5 (0x5)
ProductMinorVersion : NTLMSSP_WINDOWS_MINOR_VERSION_1 (0x1)
ProductBuild : 0x0a28 (2600)
Reserved : 000000
NTLMRevisionCurrent : NTLMSSP_REVISION_W2K3 (0xF)
authenticate: struct AUTHENTICATE_MESSAGE
Signature : 'NTLMSSP'
MessageType : NtLmAuthenticate (3)
LmChallengeResponseLen : 0x0018 (24)
LmChallengeResponseMaxLen: 0x0018 (24)
LmChallengeResponse : *
LmChallengeResponse : union ntlmssp_LM_RESPONSE_with_len(case 24)
v1: struct LM_RESPONSE
Response : 000000000000000000000000000000000000000000000000
NtChallengeResponseLen : 0x0110 (272)
NtChallengeResponseMaxLen: 0x0110 (272)
NtChallengeResponse : *
NtChallengeResponse : union ntlmssp_NTLM_RESPONSE_with_len(case 272)
v2: struct NTLMv2_RESPONSE
Response : d2292848702161b019cb48347b0e3d17
Challenge: struct NTLMv2_CLIENT_CHALLENGE
RespType : 0x01 (1)
HiRespType : 0x01 (1)
Reserved1 : 0x0000 (0)
Reserved2 : 0x00000000 (0)
TimeStamp : Fri May 13 10:01:13 AM 2022 CEST
ChallengeFromClient : 235762c75000d94d
Reserved3 : 0x00000000 (0)
AvPairs: struct AV_PAIR_LIST
count : 0x00000009 (9)
pair: ARRAY(9)
pair: struct AV_PAIR
AvId : MsvAvNbDomainName (0x2)
AvLen : 0x0016 (22)
Value : union ntlmssp_AvValue(case 0x2)
AvNbDomainName : 'TARGETSERVER'
pair: struct AV_PAIR
AvId : MsvAvNbComputerName (0x1)
AvLen : 0x0016 (22)
Value : union ntlmssp_AvValue(case 0x1)
AvNbComputerName : 'TARGETSERVER'
pair: struct AV_PAIR
AvId : MsvAvDnsDomainName (0x4)
AvLen : 0x0016 (22)
Value : union ntlmssp_AvValue(case 0x4)
AvDnsDomainName : 'TARGETSERVER'
pair: struct AV_PAIR
AvId : MsvAvDnsComputerName (0x3)
AvLen : 0x0016 (22)
Value : union ntlmssp_AvValue(case 0x3)
AvDnsComputerName : 'TARGETSERVER'
pair: struct AV_PAIR
AvId : MsvAvFlags (0x6)
AvLen : 0x0004 (4)
Value : union ntlmssp_AvValue(case 0x6)
AvFlags : 0x00000001 (1)
1: NTLMSSP_AVFLAG_CONSTRAINTED_ACCOUNT
0: NTLMSSP_AVFLAG_MIC_IN_AUTHENTICATE_MESSAGE
0: NTLMSSP_AVFLAG_TARGET_SPN_FROM_UNTRUSTED_SOURCE
pair: struct AV_PAIR
AvId : MsvAvSingleHost (0x8)
AvLen : 0x0030 (48)
Value : union ntlmssp_AvValue(case 0x8)
AvSingleHost: struct ntlmssp_SingleHostData
Size : 0x00000030 (48)
Z4 : 0x00000000 (0)
token_info: struct LSAP_TOKEN_INFO_INTEGRITY
Flags : 0x00000000 (0)
TokenIL : 0x00000000 (0)
MachineId : bb4cb35bc7c6828ed5039c7d6935a6811b7d6fa45438f8849dd34db4f339cf06
remaining : DATA_BLOB length=0
pair: struct AV_PAIR
AvId : MsvChannelBindings (0xA)
AvLen : 0x0010 (16)
Value : union ntlmssp_AvValue(case 0xA)
ChannelBindings : 00000000000000000000000000000000
pair: struct AV_PAIR
AvId : MsvAvTargetName (0x9)
AvLen : 0x0024 (36)
Value : union ntlmssp_AvValue(case 0x9)
AvTargetName : 'cifs/192.168.3.222'
pair: struct AV_PAIR
AvId : MsvAvEOL (0x0)
AvLen : 0x0000 (0)
Value : union ntlmssp_AvValue(case 0x0)
DomainNameLen : 0x0012 (18)
DomainNameMaxLen : 0x0012 (18)
DomainName : *
DomainName : 'WORKGROUP'
UserNameLen : 0x0008 (8)
UserNameMaxLen : 0x0008 (8)
UserName : *
UserName : 'root'
WorkstationLen : 0x0010 (16)
WorkstationMaxLen : 0x0010 (16)
Workstation : *
Workstation : 'CLIENTPC'
EncryptedRandomSessionKeyLen: 0x0010 (16)
EncryptedRandomSessionKeyMaxLen: 0x0010 (16)
EncryptedRandomSessionKey: *
EncryptedRandomSessionKey: DATA_BLOB length=16
[0000] C5 D1 41 4C B1 E5 62 2C 03 2D D5 5F 55 1F F5 4D ..AL..b, .-._U..M
NegotiateFlags : 0x62088215 (1644724757)
1: NTLMSSP_NEGOTIATE_UNICODE
0: NTLMSSP_NEGOTIATE_OEM
1: NTLMSSP_REQUEST_TARGET
1: NTLMSSP_NEGOTIATE_SIGN
0: NTLMSSP_NEGOTIATE_SEAL
0: NTLMSSP_NEGOTIATE_DATAGRAM
0: NTLMSSP_NEGOTIATE_LM_KEY
0: NTLMSSP_NEGOTIATE_NETWARE
1: NTLMSSP_NEGOTIATE_NTLM
0: NTLMSSP_NEGOTIATE_NT_ONLY
0: NTLMSSP_ANONYMOUS
0: NTLMSSP_NEGOTIATE_OEM_DOMAIN_SUPPLIED
0: NTLMSSP_NEGOTIATE_OEM_WORKSTATION_SUPPLIED
0: NTLMSSP_NEGOTIATE_THIS_IS_LOCAL_CALL
1: NTLMSSP_NEGOTIATE_ALWAYS_SIGN
0: NTLMSSP_TARGET_TYPE_DOMAIN
0: NTLMSSP_TARGET_TYPE_SERVER
0: NTLMSSP_TARGET_TYPE_SHARE
1: NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
0: NTLMSSP_NEGOTIATE_IDENTIFY
0: NTLMSSP_REQUEST_NON_NT_SESSION_KEY
0: NTLMSSP_NEGOTIATE_TARGET_INFO
1: NTLMSSP_NEGOTIATE_VERSION
1: NTLMSSP_NEGOTIATE_128
1: NTLMSSP_NEGOTIATE_KEY_EXCH
0: NTLMSSP_NEGOTIATE_56
Version: struct ntlmssp_VERSION
ProductMajorVersion : NTLMSSP_WINDOWS_MAJOR_VERSION_6 (6)
ProductMinorVersion : NTLMSSP_WINDOWS_MINOR_VERSION_1 (1)
ProductBuild : 0x0000 (0)
Reserved: ARRAY(3)
[0] : 0x00 (0)
[1] : 0x00 (0)
[2] : 0x00 (0)
NTLMRevisionCurrent : NTLMSSP_REVISION_W2K3 (15)
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62088215
NTLMSSP_NEGOTIATE_UNICODE
NTLMSSP_REQUEST_TARGET
NTLMSSP_NEGOTIATE_SIGN
NTLMSSP_NEGOTIATE_NTLM
NTLMSSP_NEGOTIATE_ALWAYS_SIGN
NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
NTLMSSP_NEGOTIATE_VERSION
NTLMSSP_NEGOTIATE_128
NTLMSSP_NEGOTIATE_KEY_EXCH
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62088215
NTLMSSP_NEGOTIATE_UNICODE
NTLMSSP_REQUEST_TARGET
NTLMSSP_NEGOTIATE_SIGN
NTLMSSP_NEGOTIATE_NTLM
NTLMSSP_NEGOTIATE_ALWAYS_SIGN
NTLMSSP_NEGOTIATE_EXTENDED_SESSIONSECURITY
NTLMSSP_NEGOTIATE_VERSION
NTLMSSP_NEGOTIATE_128
NTLMSSP_NEGOTIATE_KEY_EXCH
dump_arc4_state: NTLMSSP send seal arc4 state:

dump_arc4_state: NTLMSSP recv seal arc4 state:

gensec_update_send: ntlmssp[0x56112c805d90]: subreq: 0x56112c8013e0
gensec_update_send: spnego[0x56112c7ff340]: subreq: 0x56112c808fe0
gensec_update_done: ntlmssp[0x56112c805d90]: NT_STATUS_OK tevent_req[0x56112c8013e0/../../auth/ntlmssp/ntlmssp.c:180]: state[2] error[0 (0x0)] state[struct gensec_ntlmssp_update_state (0x56112c801590)] timer[(nil)] finish[../../auth/ntlmssp/ntlmssp.c:222]
gensec_update_done: spnego[0x56112c7ff340]: NT_STATUS_MORE_PROCESSING_REQUIRED tevent_req[0x56112c808fe0/../../auth/gensec/spnego.c:1631]: state[2] error[0 (0x0)] state[struct gensec_spnego_update_state (0x56112c809190)] timer[(nil)] finish[../../auth/gensec/spnego.c:2116]
session setup ok
tree connect failed: NT_STATUS_BAD_NETWORK_NAME


The client is Debian 11 and the server it is trying to connnect is Windows XP.

The odd thing is that this did work before.

ferrari 05-13-2022 04:42 AM

What does the following return?
Code:

smbclient -L 192.168.3.222

riahc3 05-13-2022 05:31 AM

Quote:

Originally Posted by ferrari (Post 6352837)
What does the following return?
Code:

smbclient -L 192.168.3.222


It returns the list of shares on the server.

michaelk 05-13-2022 05:56 AM

Quote:

smbclient \\\\192.168.3.222\\SHARE\\folder
I don't remember if connecting to a folder within a share every worked.

BTW while using backslashes works you can also you the standard //server/share too.

riahc3 05-13-2022 07:40 AM

Quote:

Originally Posted by michaelk (Post 6352854)
I don't remember if connecting to a folder within a share every worked.

BTW while using backslashes works you can also you the standard //server/share too.

Same error:

tree connect failed: NT_STATUS_BAD_NETWORK_NAME

riahc3 05-13-2022 07:41 AM

Repeated what was in OP

michaelk 05-13-2022 07:53 AM

My comment was that I do not remember if smbclient //server/share/folder every worked regardless of using forward or backward slashes. However, it is possible to mount a shared folder i.e mount -t cifs //server/share/folder...

allend 05-13-2022 09:59 AM

FWIW - Both 'smbclient //<ip-address>/<Sharename>' and 'smbclient \\\\<ip-address>\\<Sharename>' connect to my XP virtual machine. You can use 'cd' to enter a folder.
Trying to connect directly to a folder within the share leads to the "tree connect failed: NT_STATUS_BAD_NETWORK_NAME" error message.

ferrari 05-13-2022 04:04 PM

Like others have suggested trying to access a particular folder within a share fails for me as well....

Code:

~> smbclient //192.168.1.2/Documents/4RF
Password for [WORKGROUP\dean]:
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
~>

Accessing the valid share works as expected...

Code:

~> smbclient //192.168.1.2/Documents
Password for [WORKGROUP\dean]:
Try "help" to get a list of possible commands.
smb: \>


allend 05-13-2022 08:09 PM

I believe the behaviour is by design as a protection from directory traversal exploits.

riahc3 05-16-2022 03:41 AM

Quote:

Originally Posted by allend (Post 6353106)
I believe the behaviour is by design as a protection from directory traversal exploits.



But I need to access it directly;

For example


root@CLIENTPC:/usr/lib/nagios/plugins# smbclient \\\\192.168.3.222\\SHARE --directory FOLDER

Works. No issues. I can dir, etc. all I want.

So connectivity wise and protocol wise, I am able to access it.

Also, If I do a get command over the file I want to get, it downloads, so no issues there either

ferrari 05-16-2022 04:08 AM

Quote:

But I need to access it directly;

For example


Code:

root@CLIENTPC:/usr/lib/nagios/plugins# smbclient \\\\192.168.3.222\\SHARE --directory FOLDER

So what is the problem with invoking that as you have?

Or if using in a script, something like the following for example...
Code:

smbclient //server/share -D folder -c "get foo.txt ; exit"

ferrari 05-16-2022 04:20 AM

From 'man smbclient'...

https://www.samba.org/samba/docs/cur...bclient.1.html

it describes the servicename as taking the form //server/service. It is not intended to be used for specifying the network path as such.

Quote:

servicename

servicename is the name of the service you want to use on the server. A service name takes the form //server/service where server is the NetBIOS name of the SMB/CIFS server offering the desired service and service is the name of the service offered. Thus to connect to the service "printer" on the SMB/CIFS server "smbserver", you would use the servicename //smbserver/printer

Note that the server name required is NOT necessarily the IP (DNS) host name of the server ! The name required is a NetBIOS server name, which may or may not be the same as the IP hostname of the machine running the server.

The server name is looked up according to either the -R|--name-resolve parameter to smbclient or using the name resolve order parameter in the smb.conf(5) file, allowing an administrator to change the order and methods by which server names are looked up.


All times are GMT -5. The time now is 10:09 PM.