Questions tagged [pysftp]

pysftp is a thin wrapper over paramiko's SFTPClient.

pysftp is a thin wrapper over 's SFTPClient.

372 questions
2
votes
2 answers

Read CSV/Excel files from SFTP file, make some changes in those files using Pandas, and save back

I want to read some CSV/Excel files on a secure SFTP folder, make some changes (fixed changes in each file like remove column 2) in those files, upload them to a Postgre DB and also the upload them to a different SFTP path in Python What's the best…
Sanchit
  • 131
  • 3
  • 10
2
votes
1 answer

Download the latest file according to timestamp in file name from SFTP server

I'm trying to get latest new file in a directory of remote Linux server. The file in SFTP server is created every 4 hours and the file have specific name start with filegen_date_hour.json as per example below. In this case latest file…
chenoi
  • 575
  • 3
  • 8
  • 30
2
votes
1 answer

OSError: size mismatch in put! 4628344 != 330596

I was trying to send a file using SFTP python library pysftp to a remote mailbox server. But when I try to put the file I get this Error: I'm using python 3.7.4 Traceback (most recent call last): File "SFTP.py", line 54, in
Amrouane
  • 143
  • 3
  • 16
2
votes
2 answers

Connect FTP server with pysftp

I have the following code to download from 4 different FTP servers. It works on my local machine, but on server "ftp4" is not connecting. It is weird that I can connect to "ftp4" with FileZilla without any problem on the server. Here is the…
Dexter py
  • 53
  • 1
  • 8
2
votes
2 answers

Can AWS Glue connect to a remote server via SFTP?

I am trying to establish a connection from AWS Glue to a remote server via SFTP using Python 3.7. I tried using the pysftp library for this task. But pysftp uses a library named bcrypt that has python and c code. As of this moment, AWS Glue only…
Amlan Alok
  • 99
  • 2
  • 8
2
votes
1 answer

Download large files using pysftp

I have a file >500 MB to download using sftp connection, I tried using pysptp and getting error SSHException: Server connection dropped: import pysftp import sys myHostname = "dbfiles.xyz.org" myUsername = "XXXX" myPassword = "YYYY" cnopts =…
Hari_pb
  • 7,088
  • 3
  • 45
  • 53
2
votes
1 answer

paramiko.ssh_exception.SSHException: No hostkey for host xx.xx.xx.xxx found

I am trying to use pysftp and gets the same error as many others. That there is no hostkey for host. I have tried many fixes, but none of them seem to work. When I try to set hostname I get these errors: cnopts =…
Magne Moe
  • 21
  • 2
2
votes
1 answer

Define transfer mode when trying to SFTP files using Python

We are trying to transfer text files from a Linux server to a Windows server using a python script (which resides on the SFTP server). It is necessary for us to ensure the files are transferred using text mode. I don't see this possibility in…
Yamini
  • 129
  • 1
  • 10
2
votes
2 answers

Obtaining attributes of files and folders iterated with pysftp Connection.walktree?

I am trying to list files and its modification time recursively under a directory using pysftp. The problem is, it shows file doesn't exist for all files, but not for directories. Here is my code: class SftpOps: def __init__(self): …
defiant
  • 3,161
  • 11
  • 41
  • 65
2
votes
3 answers

Paramiko/pysftp connection fails with "Negotiation failed/invalid DH value", however GUIs and sftp connects

I'm trying to connect to a remote SFTP server using Python, specifically pysftp. I can connect with no problems using FileZilla or WinSCP on Windows, or sftp on Linux (specifically AWS Linux). The connection fails with the error SSHException:…
Mark
  • 41
  • 1
  • 3
2
votes
1 answer

Getting PermissionError while downloading files to local machine from SFTP server using pysftp

I'm unable to copy files from SFTP server. I'm getting the permission error. I have tried changing the mode in os.mkdirs() function. sftp = pysftp.Connection(host = myhostname, username= myusername, password= mypassword, port=22, cnopts=mycn`enter…
2
votes
0 answers

Connect to sftp server with host key fingerprint using python 3.0 on Windows

I am trying to connect to an sftp server using python on Windows. I cannot connect to the server without a hostkey. A lot of options, especially with pysftp ask for hostkey files which apparently aren't generated on Windows. From what I can see is…
mkhd
  • 21
  • 3
2
votes
1 answer

Simple pysFTP was working last night, but now does not

Last night I was writing my first pySFTP Notebook, and I was able to get it to work. It was working when I went to bed, but now it does not. I get an error on the connection command.... import pysftp cnopts = pysftp.CnOpts() cnopts.hostkeys = None …
2
votes
1 answer

How to stream from one SFTP to another SFTP using python and pysftp

I want to transfer files from one SFTP server to another. I don't want to write locally, and I don't want to read the whole file into memory. Pysftp has getfo and putfo methods. But getfo doesn't give you a reader -- it gives just writes to an…
dstandish
  • 2,328
  • 18
  • 34
2
votes
1 answer

pysftp not connecting to server. No error message. python 3.7

Python 3.7.4 Idle 3.7 32-bit I am attempting to connect to an SFTP and download a .CSV file to a local network drive. When I run my code, I get no error message, but nothing prints in the shell and nothing is being downloaded to my local…
BigZA86
  • 113
  • 1
  • 6