Cant connect w/ smb on mac os, python 3.8
Opened this issue · 6 comments
davebeiler commented
Successfully installed pysmb-1.2.7
(venv) s153152@MB20OXDHQ60774 ssd_dashboard % python3 smb2-connect-windows.py
Traceback (most recent call last):
File "smb2-connect-windows.py", line 16, in
assert conn.connect(server_name, 139)
AssertionError
import SmbClient, SMBConnection
class SmbClient(object):
def __init__(self,ip,username,password,sharename):
self.ip = 10.28.7.249
self.username = 'username'
self.password = 'password$'
self.sharename = 'Tableau Output'
def connect(self):
self.server = SMBConnection(self.username,
self.password,client,netbios_name,use_ntlm_v2=True)
self.server.connect(self.ip,139)
def list(self):
' list files of remote share '
filelist = self.server.listPath(self.sharename,'/')
for f in filelist:
print f.filename
davebeiler commented
same error on python 3.9
doesnt work either
def connect(self):
self.server = SMBConnection(self.username,
self.password,client,netbios_name,use_ntlm_v2=True)
assert self.server.connect(self.ip,139)
def list(self):
' list files of remote share '
filelist = self.server.listPath(self.sharename,'/')
for f in filelist:
print f.filename
miketeo commented
@davebeiler : The netbios name might be incorrect or port 139 is behind firewall.
davebeiler commented
No the documentation isn’t correct I was finally able to connect to it
useing a better example
…On Sat, Feb 12, 2022 at 8:43 AM Michael Teo ***@***.***> wrote:
@davebeiler <https://github.com/davebeiler> : The netbios name might be
incorrect or port 139 is behind firewall.
—
Reply to this email directly, view it on GitHub
<#193 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUMAOXULWRH52NNFGD3WER3U22E4HANCNFSM5OFOPDSQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
miketeo commented
No the documentation isn’t correct
Can you point out where the documentation is not correct? It could help others in using pysmb.
praveen-elastic commented
Hey @davebeiler, would you mind sharing the example you've used for connecting to your smb share on MacOS ?