elastic / enterprise-search-network-drive-connector

Official Enterprise Search | Workplace Search - Network Drives Connector
Other
6 stars 3 forks source link

Can't connect SMB drive on MacOS #20

Closed danajuratoni closed 2 years ago

danajuratoni commented 2 years ago

Testing this using a MacBook with Monterey 12.3.1 as a network drive, with SMB File Sharing enabled. And a runtime environment with MacOS Monterey 12.4, Python 3.9.13.

I enabled logging of SMB.SMBConnection in the Network Drive client and see the following error:

INFO SMB.SMBConnection:base.py:98 Authentication with remote machine "MYSMB.FRITZ.BOX" for user "spacetime" will be using NTLM v2 authentication (with extended security) INFO SMB.SMBConnection:base.py:124 Now switching over to SMB2 protocol communication DEBUG SMB.SMBConnection:base.py:141 Received SMB2 message "SMB2_COM_NEGOTIATE" (command:0x0000 flags:0x0001) INFO SMB.SMBConnection:base.py:248 SMB2 dialect negotiation successful DEBUG SMB.SMBConnection:base.py:141 Received SMB2 message "SMB2_COM_SESSION_SETUP" (command:0x0001 flags:0x0001) INFO SMB.SMBConnection:base.py:360 Performing NTLMv2 authentication (on SMB2) with server challenge "b'474eec6eedacc2be'" INFO SMB.SMBConnection:base.py:363 Performing NTLMv2 authentication (on SMB2) with server challenge "b'474eec6eedacc2be'" DEBUG SMB.SMBConnection:base.py:383 NT challenge response is "b'7bfc190cfe1527def5f7ed29de81659801010000000000000000000000000000ec4a27540fbaacb80000000001001200440041004e00410053002d004d004200500002001200440041004e00410053002d004d004200500003002600440061006e00610073002d004d00420050002e0066007200690074007a002e0062006f0078000400120066007200690074007a002e0062006f0078000700080000a705a12670d80100000000'" (168 bytes) DEBUG SMB.SMBConnection:base.py:384 LM challenge response is "b'3a2143d16dcc1f6e29a48364471f49fdec4a27540fbaacb8'" (24 bytes) INFO SMB.SMBConnection:base.py:390 Server requires all SMB messages to be signed INFO SMB.SMBConnection:base.py:399 SMB signing activated. All SMB messages will be signed. INFO SMB.SMBConnection:base.py:402 SMB signing key is b'364d753757413464474941544f304f59' DEBUG SMB.SMBConnection:base.py:141 Received SMB2 message "SMB2_COM_SESSION_SETUP" (command:0x0001 flags:0x0001) INFO SMB.SMBConnection:base.py:292 Authentication (on SMB2) failed. Please check username and password.

Username and password are correct and I'm able to connect to the drive via Finder and via command line using mount, so the issue in not on the drive side.

Already tested alternatives such as without direct TCP & port 139, and NTLM v1 but no success. Seems to be a config issue others experienced too while using this library https://github.com/miketeo/pysmb/issues/193.

Slack chat related to this: https://elastic.slack.com/archives/C02AV5C8ZDE/p1653404652854019

serenachou commented 2 years ago

What's the latest on this @praveen-elastic ?

praveen-elastic commented 2 years ago

Hey @serenachou, We tried various ways for connecting to a shared folder on Mac. I am attaching a doc describing all the explored approaches. I am still working on finding a proper resolution for this issue. I'll update you for the same. https://docs.google.com/document/d/1aGYiZbtN-t-M_Wz58ywI0U_PjJKnDIGMkdbzrP6iTn4/edit?usp=sharing

serenachou commented 2 years ago

@praveen-elastic thanks for the link and the approached tried. Please update us in tomorrow's sync on the progress.

serenachou commented 2 years ago

Revisit this in the version added to the updated connector framework in scope of https://github.com/elastic/enterprise-search-network-drive-connector/issues/24 cc @danajuratoni