I am in need of python sftp client to download files from a sftp server. I started to use Paramiko. Small files in KB works well but however when I try to download 600 MB of
I did two things to solve a similar problem:
increase window size – you say you tried that too; for me, this helped to get from a few ten MBs to half a GB but no further
effectively disable rekeying – this might have security implications, but helped me to get files over a GB from a weird windows sftp server
with paramiko.Transport((_SFTP['host'], 22)) as transport:
# SFTP FIXES
transport.default_window_size=paramiko.common.MAX_WINDOW_SIZE
transport.packetizer.REKEY_BYTES = pow(2, 40) # 1TB max, this is a security degradation!
transport.packetizer.REKEY_PACKETS = pow(2, 40) # 1TB max, this is a security degradation!
# / SFTP FIXES
transport.connect(username=_SFTP['user'], password=_SFTP['password'])
with paramiko.SFTPClient.from_transport(transport) as sftp:
listdir = sftp.listdir()
# ...
sftp.get(remotepath=filename, localpath=localpath)