Manu Shamanna
2024-Oct-25 07:04 UTC
[Samba] Could not find a suitable mechtype in NEG_TOKEN_INIT error in libsmbclient 4.19.4
> >> Looking at the packet captures, when its working on libsmbclient 4.10, >> it first sends a SMB1 negotiate protocol request, to which server >> sends back a SMB2 response. Then there is a SMB2 negotiate protocol >> request/response again. >> >> In 4.19, there is a SMB2 client negotiate protocol request >> straightaway and to which the server responds with a SMB2 negotiate >> protocol response. >> > >From my understanding, it works in reverse, the client should send a >SMBv3 negotiate protocol request and the server should respond either >with basically 'yes, using SMBv3' or 'Do you understand SMBv2 ?'. >To put it another way, the client should start at the highest version >of SMB and then negotiate down to the highest mutual available version, >you appear to starting at the lowest version. > >RowlandI dont think this is something I am controlling in any way through the code. The client is very simple just doing smbc_init, smbc_opendir, smbc_read etc. Even the built-in smbget client in samba throws out with the same error. Works in 4.10, but does not work in 4.19. I think there is some setting in smb.conf which I am missing, but I cant figure out what. #smbget --use-kerberos=off -d 10 "smb:// 10.213.83.54/cifsshare/testing.dlpenc" -U "ePO\Administrator" smbc_setConfiguration: Configuration loaded successfully: /etc/samba/smb.conf Using netbios name PS. Using workgroup SAMBA. Password for [EPO\Administrator]:SMBC_server: server_n=[10.213.83.50] server=[10.213.83.50] -> server_n=[10.213.83.50] server=[10.213.83.50] Connecting to 10.213.83.50 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=46080, SO_RCVBUF=87380, SO_SNDLOWAT=1, SO_RCVLOWAT=1, SO_SNDTIMEO=0, SO_RCVTIMEO=0, TCP_QUICKACK=1, TCP_DEFER_ACCEPT=0, TCP_USER_TIMEOUT=0 cli_set_timeout: Changing connection timeout for server '10.213.83.50' from 20000 (ms) to 20000 (ms). cli_session_setup_spnego_send: Connect to 10.213.83.50 as Administrator at EPO 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 'ncalrpc_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 Starting GENSEC mechanism spnego gensec_spnego_client_negTokenInit_step: Could not find a suitable mechtype in NEG_TOKEN_INIT Regards, Manu