miketeo/pysmb

Cant connect w/ smb on mac os, python 3.8

Opened this issue · 6 comments

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

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

@davebeiler : The netbios name might be incorrect or port 139 is behind firewall.

No the documentation isn’t correct

Can you point out where the documentation is not correct? It could help others in using pysmb.

Hey @davebeiler, would you mind sharing the example you've used for connecting to your smb share on MacOS ?

Try the version 1.2.8.

It MIGHT help if you, in fact, encountered the OpenSSL-related problem described here: #196