Questions tagged [pysftp]

pysftp is a thin wrapper over paramiko's SFTPClient.

pysftp is a thin wrapper over 's SFTPClient.

372 questions
1
vote
1 answer

Custom file name while uploading to your server via SFTP

I'm working on uploading a file to a server via SFTP. The given put method of the SFTP client expects as first argument the relative or absolute local path of the file I want to upload and as second argument the remote path where the file should be…
Amamra
  • 89
  • 1
  • 9
1
vote
1 answer

How to transfer zip files from one server to another using Python SFTP/Paramiko

I am trying to do SFTP between two servers using a Python script. At first, my attempt was to download the files to my local machine, it is failing with permission error, not sure why it is restricting to copy files to my local folder. Any ideas…
1
vote
0 answers

Failed to read the file from sever using pysftp

I'm trying to read a latestfile from the sftp server using python but it shows the error msg as OSError: Bad message. could someone help me out thanks in advance. import os from six import BytesIO import base64 myUsername = "a123" myPassword =…
1
vote
1 answer

"SSHException: encountered EC key, expected DSA key" when connecting to SFTP server using pysftp

I have been trying to create an SFTP connection thorough Python pysftp with the following parameters import pysftp srv = pysftp.Connection(host="some.hostname.com",…
rajsx
  • 61
  • 8
1
vote
1 answer

Download fails with "Authentication failed" when we try to download 50+ files from SFTP serially using pysftp in Python?

for remote_path in list_of_stfp_paths: with pysftp.Connection(HOSTNAME, username=USERNAME, password=PASSWORD) as sftp: sftp.get(remote_path, str(local_path)) #checks distinct count of a column for the csv downloaded, deletes it…
LearnerJS
  • 298
  • 2
  • 14
1
vote
1 answer

Verify host key with pysftp against known_hosts file with custom port

I'm trying to login in an SFTP server using pysftp. This is the code I'm testing: import pysftp cnopts = pysftp.CnOpts() # cnopts.hostkeys = None host = 'data-nz.metservice.com' username = 'my_user' password = 'my_passwd' ciphers = ['aes128-cbc',…
Pythonist
  • 1,937
  • 1
  • 14
  • 25
1
vote
0 answers

Importing pysftp issue

I am facing this error every time I try to import pysftp in my training.py in the ml.azure.com pipelines. I am using Conda to create the environment for the workspace. Traceback (most recent call last): File "start_training.py", line 18, in…
1
vote
1 answer

pysftp.Connection.walktree() fails if any directory don't have read permission

I am using pysftp connection using walktree() method to list all files as below with pysftp.Connection(domain, username=USER, password=PWD, port=port, cnopts=cnopts) as sftp: # call back method to…
Deepak N
  • 1,408
  • 3
  • 15
  • 37
1
vote
2 answers

Truncating the file while saving on SFTP server using Python?

This is extended question to Can we send data from Google cloud storage to SFTP server using GCP Cloud function? with pysftp.Connection(host=myHostName, username=myUsername, password=myPassword, cnopts=cnopts) as sftp: …
1
vote
1 answer

Can we send data from Google cloud storage to SFTP server using GCP Cloud function?

I want to take a .csv file from Google cloud storage and send it to SFTP server. I do not know, what I am doing wrong, but I am getting the error that file not found in the cloud storage. My code is below: import base64 import os import…
1
vote
1 answer

How to create a zip file on SFTP server from files on the server using pysftp

I want to write a Python script that connects to the remote SFTP server and creates a ZIP file in the remote server which consists of specific files present in remote server itself. I have written the below script, I m using pysftp for this, with…
gigahex
  • 367
  • 1
  • 5
  • 14
1
vote
1 answer

Use custom command to start SFTP server in pysftp/Paramiko

In WinSCP is an option to edit the SFTP server command/path (in the protocol options): Is there also such an option in pysftp/Paramiko or in an another SFTP package for Python? Thanks!
JP371
  • 15
  • 3
1
vote
1 answer

Pysftp/Paramiko "No such file" when repeatedly doing cwd and listdir

I am writing a Python script (for testing purposes) that, downloads an xml file from a directory, converts it into json, converts it back to xml and uploads it again to a different directory, as long as there is an xml file left in the source…
Pypax
  • 83
  • 10
1
vote
1 answer

pysftp + py7zr decompress is hanging on archive

A little context : a client is putting 7-zip archive on a remote sftp server and i process them. My issue is that on some 7-zip file my program is hanging and the decompress function is never ending but all the files of the archive are found…
nathdev
  • 61
  • 5
1
vote
1 answer

Most recent SFTP python package and best practices

I've been looking for SFTP python packages, ftpretty works fine for me: https://pypi.org/project/ftpretty/ but I want to use a more secure protocol. PySftp is obviously a bit outdated (Edit: it seems that pysftp is still frequently used, about the…