omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Python SMB Connection

    Pythonista
    3
    85
    24343
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cvp
      cvp @DavinE last edited by

      @DavinE said:

      smb is in the module of pysmb

      Yes

      DavinE 1 Reply Last reply Reply Quote 0
      • cvp
        cvp last edited by

        I have the same problem on another WD NAS....

        DavinE 1 Reply Last reply Reply Quote 0
        • DavinE
          DavinE @cvp last edited by

          @cvp said:

          @DavinE said:

          smb is in the module of pysmb

          Yes

          okay... then i have no idea what and how i solve my what ever ^^....

          1 Reply Last reply Reply Quote 0
          • DavinE
            DavinE @cvp last edited by

            @cvp said:

            I have the same problem on another WD NAS....

            oh okay for test now ?

            cvp 1 Reply Last reply Reply Quote 0
            • cvp
              cvp @DavinE last edited by

              @DavinE said:

              okay for test now ?

              Test what?

              1 Reply Last reply Reply Quote 0
              • DavinE
                DavinE last edited by

                @cvp said:

                @DavinE said:

                okay for test now ?

                Test what?

                The Connection or do you have this problem longer ?

                cvp 1 Reply Last reply Reply Quote 0
                • cvp
                  cvp @DavinE last edited by

                  @DavinE I normally access this NAS via FTP but I just tested it with your script and I meet the same connection error.

                  DavinE 1 Reply Last reply Reply Quote 0
                  • DavinE
                    DavinE last edited by

                    @cvp

                    i found this:
                    ftp

                    is Pythonista Able to use ftp/sftp to upload files ?

                    1 Reply Last reply Reply Quote 0
                    • DavinE
                      DavinE @cvp last edited by

                      @cvp said:

                      @DavinE I normally access this NAS via FTP but I just tested it with your script and I meet the same connection error.

                      hehe okay and my idea is now FTP ^^

                      works this with Pythonista ?

                      cvp 1 Reply Last reply Reply Quote 0
                      • cvp
                        cvp @DavinE last edited by

                        @DavinE FTP is ok and SFTP (SSH) also

                        DavinE 1 Reply Last reply Reply Quote 0
                        • cvp
                          cvp last edited by

                          But my old WD NAS does not support SFTP...

                          1 Reply Last reply Reply Quote 0
                          • cvp
                            cvp last edited by

                            from ftplib import FTP
                            import paramiko
                            

                            ftplib for FTP
                            paramiko for SFTP

                            DavinE 2 Replies Last reply Reply Quote 0
                            • DavinE
                              DavinE @cvp last edited by

                              @cvp said:

                              from ftplib import FTP
                              import paramiko
                              

                              ftplib for FTP
                              paramiko for SFTP

                              I know I'm annoying you a lot, but would you have a script like with SMB?

                              cvp 2 Replies Last reply Reply Quote 0
                              • DavinE
                                DavinE @cvp last edited by

                                @cvp said:

                                @DavinE FTP is ok and SFTP (SSH) also

                                SFTP i don't know it works because i use Private Key's for my SSH connection...

                                1 Reply Last reply Reply Quote 0
                                • cvp
                                  cvp @DavinE last edited by

                                  @DavinE upload or download?

                                  DavinE 1 Reply Last reply Reply Quote 0
                                  • DavinE
                                    DavinE @cvp last edited by

                                    @cvp said:

                                    @DavinE upload or download?

                                    upload ;)

                                    cvp 1 Reply Last reply Reply Quote 0
                                    • cvp
                                      cvp @DavinE last edited by cvp

                                      @DavinE try first this

                                      from ftplib import FTP
                                      ip = '192.168.0.47'
                                      user = 'admin'
                                      pwd = 'xxxxxxx''
                                      ftp = FTP(ip) #connect
                                      ftp.encoding = 'utf-8'
                                      ftp.login(user,pwd)
                                      ftp.retrlines('NLST *')
                                      ftp.quit()
                                      
                                      DavinE 1 Reply Last reply Reply Quote 0
                                      • cvp
                                        cvp last edited by

                                        Upload

                                        ftp = FTP(ip) #connect
                                        ftp.encoding = 'utf-8'
                                        ftp.login(user,pwd)
                                        local_file = open(path,'rb')
                                        ftp.storbinary('STOR '+server_file, local_file, blocksize=32768)
                                        local_file.close()
                                        ftp.quit()
                                        
                                        DavinE 1 Reply Last reply Reply Quote 0
                                        • cvp
                                          cvp @DavinE last edited by

                                          @DavinE said:

                                          I'm annoying you a lot,

                                          Not at all, but less available tonight

                                          1 Reply Last reply Reply Quote 1
                                          • DavinE
                                            DavinE @cvp last edited by

                                            @cvp said:

                                            from ftplib import FTP
                                            import paramiko
                                            

                                            ftplib for FTP
                                            paramiko for SFTP

                                            There is also FTPS is that better for security?
                                            how can i use this with Ports ?

                                            from ftplib import FTP_TLS
                                            
                                            ftp = FTP_TLS()
                                                ftp.ssl_version = ssl.PROTOCOL_SSLv23
                                                ftp.ssl_version = ssl.PROTOCOL_TLSv1_2
                                                ftp.debugging = 2
                                                ftp.connect('localhost', 2121)
                                                ftp.login('developer', 'password')
                                                return ftp
                                            

                                            but which version TLS or SSL ?

                                            cvp 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors