0

Hello Gentlemen


I am trying working in SFTP Server using python (paramiko). My projects needs my client to periodically upload a file (say 10 seconds) but simultaneously have to download a crucial file (say every 1 second). I tried threading but It throws me Continuous errors so Instead I thought of running two separate SFTP clients in the same machine. So that when one uploads the file to the server for every 10 seconds the other downloads simultaneously every 1 seconds. but is it possible to so. because when I tried executing the second client program when first client program is running smoothly I am getting SSH protocol banner error, Can someone provide me a workaround over this issue

Thanks Gentlemen

Regards Mr.B

4
  • This should be no problem at all. You just have to make sure the server accepts multiple simultaneous connections from the same device and/or with the same user. – Lenniey Aug 26 '19 at 11:12
  • Thanks Mr.Lenniey . But do you have any idea how to allow multiple clients simultaneously in paramiko python library – Mr.B Aug 26 '19 at 11:35
  • IMHO, Your first approach (one thread per client) is the good one. Manage to fix your errors and it'll be ok :) – binarym Aug 26 '19 at 12:05
  • Hello, Mr.binarym In my first approach I am not using one thread per client, Im using one process per thread to be precise I used one thread to download in a stipulated time interval and another separate thread or even main thread to upload file in some other time interval but it shows SSH banner error – Mr.B Aug 26 '19 at 12:08
0

Hi Gentlemen


Thanks for the comments, Finally I figured out a solution.I was able to create two SFTP clients on the same machine. The only thing I struggled was on the Server Side where I was using a Single threaded server so it can handle only one client at a time so I altered the SFTP Server to support multiple thread using the code in the link as reference now I am able to connect two clients without a problem

https://gist.github.com/Girgitt/2df036f9e26dba1baaddf4c5845a20a2

Thanks to Mr.Lenniey and Mr.binarym

Regards,

Mr.B

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.