Questions tagged [pysftp]

pysftp is a thin wrapper over paramiko's SFTPClient.

pysftp is a thin wrapper over 's SFTPClient.

372 questions
1
vote
2 answers

Connecting to Globalscape SFTP server with two-factor password and key authentication using Python Paramiko/pysftp

While working on a file upload project, using pysftp/paramiko I stumbled on an SFTP server connection issue: The SFTP server requires the following authentication flow: username + private key -> 'welcome the sftp server' -> password Using Linux…
RafalSiwek
  • 11
  • 3
1
vote
1 answer

Connecting to SFTP server with .ppk key using Python pysftp: not a valid DSA private key file

Everyday I am uploading files to SFTP server using WinSCP. I decided to use Python to automate this process. This SFTP has host, username, port, and .ppk file I found a code, but it didn't work. It says SSHException: not a valid DSA private key…
NKG
  • 69
  • 1
  • 7
1
vote
1 answer

Upload all files listed by os.listdir to SFTP server using pysftp in Python

I am trying to upload files from C:/Test/ folder. Code: import pysftp import os host = host port = 22 username = username password= pass cnopts = pysftp.CnOpts() cnopts.hostkeys = None try: conn =…
Kirill
  • 11
  • 3
1
vote
1 answer

How to resolve error Incompatible ssh server (no acceptable ciphers) in python SFTP/paramiko connexion?

I'm beginner in python, I am looking to automate a file transfer from my computer (windows 10 21H2) to a Linux server (Rocky Linux 8.6) via the SFTP protocol. I'm using a key pair with passphrase for authentication. The connection is not…
Olivier MM
  • 53
  • 7
1
vote
2 answers

How to verify a successful upload if I use pysftp to transfer a file?

I am using pysftp to transfer files over network. I want to ensure reliability in this process. There's a put API in pysftp and it returns a SFTPAttributes object containing size of the transferred files. Is that enough to verify a successful…
1
vote
1 answer

How to read contents and attributes of files in remote SFTP server using pysftp/Paramiko

I am using below code to get list of file objects in list from two different nodes. My purpose is to get the file metadata and compare the files later. But using filelist = mysftp.listdir(), I am only getting the filenames and unable to fetch…
Pixzium Media
  • 109
  • 2
  • 10
1
vote
1 answer

Download multiple files in different SFTP directories to local

I have a scenario where we need to download certain image files in different directories in SFTP server to local. Example : /IMAGES/folder1 has img11, img12, img13, img14 /IMAGES/folder2 has img21, img22, img23, img24 /IMAGES/folder3 has img31,…
thatGuy
  • 57
  • 6
1
vote
1 answer

pysftp throwing OSError: General failure

I have been trying to sftp a file to remote server using pysftp library, but getting some ambiguous error OSError: General failure, it seems I was able to connect to the server, but not able to run commands like list or put. Code: def…
Arar
  • 1,926
  • 5
  • 29
  • 47
1
vote
2 answers

Recursively move files from SFTP to S3 preserving structure

I'm trying to recursively move files from an SFTP server to S3, possibly using boto3. I want to preserve the folder/file structure as well. I was looking to do it this way: import pysftp private_key = "/mnt/results/sftpkey" srv =…
mlenthusiast
  • 1,094
  • 1
  • 12
  • 34
1
vote
1 answer

Python pysftp fails with "[Errno 11001] getaddrinfo failed"

I am trying to upload a file to Adobe Stock using SFTP in Python 3.8. Here are the instructions on their website: https://helpx.adobe.com/stock/how-to/upload-video-to-adobe-stock.html. Here's my Python code: import pysftp pw = r'mypassword' id =…
joejoejoejoe4
  • 1,206
  • 1
  • 18
  • 38
1
vote
1 answer

Pysftp fails with "Authentication failed" and "Server did not send a server-sig-algs list; defaulting to our first preferred algo ('rsa-sha2-512')"

I have ec2 instance with ubuntu v20.04 and it has python v3.8.10 and pysftp 0.2.9. I have generate .pem file from .ppk file using below command puttygen sftp_server.ppk -O private-openssh -o sftp_server.pem I am able to connect successfully to…
SRK
  • 97
  • 2
  • 14
1
vote
1 answer

Paramiko: "not a valid DSA private key file"

I am trying to connect to some SFTP using a private key file that looks like: ---- BEGIN SSH2 ENCRYPTED PRIVATE KEY ---- Subject: L0709146 Comment: "1024-bit dsa, L0709146@pxz102, Wed Jan 12 2022 11:25:54 +010\ 0" P2/bla...bla...bla ---- END SSH2…
Eric Bellet
  • 1,732
  • 5
  • 22
  • 40
1
vote
1 answer

SFTP download with pysftp put fails with "FileNotFoundError: [Errno 2] No such file or directory"

I am trying to automate the transfer of files from an SFTP sever through Airflow, but I am running into a problem where I cannot save the files anywhere except to the root folder. Here is a snippet of my code: cnopts =…
biomed
  • 23
  • 2
1
vote
2 answers

Pyshp reading shapefile: "error: int too large to convert"

Follow up from Read SHP file from SFTP using pysftp for more context. I am trying to use pyshp and pysftp to read a shapefile and convert to a GeoPandas geodataframe. This has worked successfully for all files tested until the following error…
jtownsend
  • 55
  • 4
1
vote
2 answers

Using pysftp to connect via jump server

I am trying to upload a file to my home network via pysftp. My local device is connected via WireGuard to a VPS. I can use ssh jumps to connect to the local device with ssh -J user@VPS user@localdevice Is there any way to do the same with pysftp?
A-wels
  • 77
  • 1
  • 8