Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
392 views

How to use pysftp with the -o"HostKeyAlgorithms=+ssh-rsa" -o"PubkeyAcceptedKeyTypes=+ssh-rsa" options?

Using paramiko I want to select the list of pubkey algorithm my key is in, do you know how I can run a similar command like: sftp \ -i private_key.pem \ -P 22 \ -o"HostKeyAlgorithms=+...
Natim's user avatar
  • 18.1k
0 votes
1 answer
946 views

Failed building wheel for bcrypt when running pip install paramiko

I'm trying run pip install paramiko, but i'm running into the following error : please help me, i already tried pip update, installing rust. it keep returning this kind of error. i already tried to ...
victorxu2's user avatar
  • 514
0 votes
1 answer
608 views

Negotiation failed while trying to connect to SFTP server using Paramiko, but command line SFTP works properly. Same failure with js ssh2-sftp-client

I am trying to move files into an SFTP server at 8001 port using code and not just GUI and command line tools. FileZilla, sftp CLI in Windows and Linux works just fine. But somehow the Python code or ...
Dan Alex's user avatar
2 votes
0 answers
334 views

SFTP server authentication require username and private key

We have SFTP server with authentication enabled. To access the server we need to provide both the password and private key. I'm able to access the server using winscp. But not able to access using the ...
srikanth gunuputi's user avatar
1 vote
2 answers
2k views

Paramiko SFTPClient class throws "Authentication failed", but Transport class and WinSCP work

I have an issue using Paramiko and connecting to an SFTP server. The connecting work fine using same credentials in WinSCP. I am also able to use pysftp. But I would prefer to be able to use Paramiko, ...
jakobdo's user avatar
  • 1,302
1 vote
1 answer
927 views

Python OSError: Failure with SFTP

I'm testing SFTP communication on a Windows 11 laptop with SFTP server running at localhost:3373. An sftp.get request generates an "OSError: Failure" error with this code: import pysftp ...
Henry Thornton's user avatar
0 votes
1 answer
700 views

OSError: Int or String expected received with pysftp.Connection in kubernetes

I am trying to connect SFTP server using pysftp. I receive below error on pysftp.Connection() in Jupyter notebook running in Kubernetes inside IBM Elyra. Python version is 3.7.6 and pysftp 0.2.9 with ...
arundeep78's user avatar
1 vote
0 answers
275 views

PySFTP file transfer suddenly slower than before

Background: I have a python backup script on a local server that runs periodically every night at midnight and transfers files from a remote server to the local one using pysftp. It ran perfectly fine ...
Nab's user avatar
  • 36
2 votes
1 answer
1k views

Download chunk of the large file using pysftp in Python

I have one use case in which I want to read only top 5 rows of a large CSV file which is present in one of my sftp server and I don't want to download the complete file to just read the top 5 rows. I ...
Shubham Bansal's user avatar
0 votes
1 answer
965 views

Unable to import pysftp / paramiko through AWS lambda (facing different errors)

When a file is uploaded to s3 bucket, we need to process it in AWS lambda, gzip the processed file and send it some remote machine. We are able to process it and able to gzip the file. We thought of ...
kadina's user avatar
  • 5,336
1 vote
2 answers
1k views

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 -> '...
RafalSiwek's user avatar
2 votes
1 answer
2k views

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 ...
Olivier MM's user avatar
1 vote
1 answer
4k views

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 ...
Pixzium Media's user avatar
1 vote
1 answer
3k views

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, ...
thatGuy's user avatar
  • 57
1 vote
1 answer
440 views

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 ...
Arar's user avatar
  • 2,066
3 votes
0 answers
381 views

How can I speed up downloading files using paramiko?

I have written code for downloading file from SFTP server but the process is taking a lot of time. Could you please tell me is there any way to speed up the process? Code I am using - import paramiko ...
Shivika's user avatar
  • 229
-1 votes
1 answer
689 views

pysftp giving AuthenticationException

I am trying to develop azure function in python where I have to upload some files on SFTP server. I have got following code for the same. logging.info('Uploading file to mysguard sftp server') # Get ...
Vijay's user avatar
  • 55
1 vote
1 answer
6k views

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 ...
Eric Bellet's user avatar
  • 2,035
1 vote
1 answer
965 views

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 ...
biomed's user avatar
  • 23
1 vote
2 answers
187 views

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 ...
jtownsend's user avatar
0 votes
1 answer
2k views

Get Recursive folder using SFTP and Paramiko Python

Trying to implement a python script to and put get recursive folder from remote machine to local machine , this code works for copy : put folders and get folders , now i want to create move , the ...
Karim Azzouzi's user avatar
1 vote
1 answer
2k views

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 ...
Aaron Morales's user avatar
0 votes
0 answers
25 views

pysftp - IOError - No such file when I can see the full file on the other end [duplicate]

I have a program which transfers files to different endpoints. Only one endpoint in particular fails on this conn.put(): try: conn.put(fileToPush, pushedFile) except IOError as ioe: self.logPush(...
dreami's user avatar
  • 31
1 vote
0 answers
243 views

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 ...
Manoj Selvam 's user avatar
-1 votes
1 answer
2k views

paramiko rekeying causes EOFError()

After Rekeying, _read_all receives string of len(0) and closes connection. What can i do to solve this. Please find the debug log and stack trace below. DEB [20211007-15:13:46.331] thr=2 paramiko....
zza's user avatar
  • 85
4 votes
0 answers
1k views

pysftp paramiko.ssh_exception.SSHException: unpack requires a buffer of 4 bytes

I am using pysftp for the first time. I have seen this error before with struct and other libraries, but the problem with pysftp seems tricky. I can't connect to the server. I am sure I am missing ...
RforResearch's user avatar
0 votes
1 answer
2k views

Upload file to SFTP directly without storing it into local system [duplicate]

I am trying to encrypt a file and then directly upload the encrypted file to SFTP using python. At the moment, I am firstly storing the encrypted file into my local system and then pushing it into ...
loyala's user avatar
  • 175
0 votes
1 answer
2k views

Python script to SSH into a jumphost and sftp from within that box

I'm currently trying to write an airflow job that will allow me to ssh into an EC2 instance and then start an sftp session with another host from within this EC2 box. My current code that I have is as ...
Ash_s94's user avatar
  • 807
1 vote
1 answer
551 views

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, ...
Deepak N's user avatar
  • 1,609
0 votes
0 answers
595 views

EOFError using pysftp

I am using below code host='xxx.xxxxxxxx.xxx' username='xxxx' password='xxxx' port=5022 cnopts = pysftp.CnOpts() cnopts.hostkeys = None with pysftp.Connection(host=host,username=username,password=...
skut's user avatar
  • 1
-1 votes
1 answer
239 views

Python code to move a directory from one server to another server using paramiko? [duplicate]

I am writing a python program in which i want to move a directory and its file to another server my code is as below import paramiko client = paramiko.SSHClient() client.set_missing_host_key_policy(...
TONY FRANK C's user avatar
1 vote
1 answer
203 views

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's user avatar
  • 15
1 vote
1 answer
798 views

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 ...
Pypax's user avatar
  • 103
1 vote
1 answer
1k views

Problem in importing Paramiko in AWS Lambda

I am trying to import paramiko library to AWS Lambda. I have tried to do so on lambda using Python version 2.7, 3.6, 3.8. I upload the zip file (created on ec2 machine using cmd, containing all ...
Dev1509's user avatar
  • 11
1 vote
0 answers
2k views

Airflow cannot establish SFTP connection using encrypted private key

I am trying to establish a SFTP connection in Airflow 1.10.14 with the SFTPOperator from airflow.providers.sftp.operators.sftp or airflow.contrib.operators.sftp_operator. The contrib operator and the ...
Pascal GILLET's user avatar
2 votes
1 answer
1k views

Is it possible to specify the encoding of a file with Paramiko?

I'm trying to read a CSV over SFTP using pysftp/Paramiko. My code looks like this: input_conn = pysftp.Connection(hostname, username, password) file = input_conn.open("Data.csv") ...
Walt Gottlieb's user avatar
0 votes
0 answers
41 views

Paramiko Upload Errors [Errno 2] [duplicate]

I'm attempting to create a script in python that will upload a CSV to a vendors sftp server. After getting too any errors trying to use pysftp, I tried using Paramiko and got farther, but now I'm ...
Chester Bennett's user avatar
3 votes
2 answers
4k views

Slow upload of many small files with SFTP

When uploading 100 files of 100 bytes each with SFTP, it takes 17 seconds here (after the connection is established, I don't even count the initial connection time). This means it's 17 seconds to ...
Basj's user avatar
  • 46k
18 votes
3 answers
34k views

"'Connection' object has no attribute '_sftp_live'" when pysftp connection fails

I'd like to catch nicely the error when "No hostkey for host *** is found" and give an appropriate message to the end user. I tried this: import pysftp, paramiko try: with pysftp....
Basj's user avatar
  • 46k
1 vote
1 answer
2k views

pysftp.CnOpts() 'No Host Keys Found' error despite known_hosts file generated using ssh-keyscan

I am trying to follow solution from Verify host key with pysftp. I run: import pysftp fn = r'C:\Users\UWAdmin\.ssh\known_hosts' cnopts = pysftp.CnOpts() cnopts.hostkeys.load(fn) but I get the error: ...
Hud's user avatar
  • 301
1 vote
1 answer
1k views

EOFError with keyboard interactive authentication using pysftp

I am trying to download some files from an SFTP server. I use this code for it: keydata = b"""AAAAB3Nza.............CNpvoUP7p""" key = paramiko.RSAKey(data=decodebytes(...
Alfonso_MA's user avatar
2 votes
1 answer
3k views

pysftp Paramiko PasswordRequiredException: Private key file is encrypted

When connecting to an SFTP server with the following code I am getting the error below. from base64 import decodebytes import pysftp from paramiko import RSAKey host = 'where_it_should_be' username =...
Daniel Butler's user avatar
0 votes
2 answers
261 views

How to not wait for the output of the remote execution?

I am using pysftp for remote execution, and the thing is that I don't want to wait for the output of the remote execution, I just want to start the execution and be done with it. import pysftp as sftp ...
Radhey Patel's user avatar
1 vote
2 answers
2k views

Resume SFTP download after connection fails (pysftp / paramiko)

I'm trying to build a simple SFTP client using pysftp / paramiko. How can I resume a transfer if it gets interrupted, e.g. if the connection fails? Is there a way to restart the transfer, find that ...
lexipenia's user avatar
1 vote
2 answers
5k views

Paramiko TypeError: from_buffer() cannot return the address of the raw string within a str or unicode or bytearray object

I'm trying to connect to an SFTP server using Python and Paramiko, but I'm getting this error (the same error occurs when I use pysftp): starting thread (client mode): 0x17ccde50L Local version/...
Dr. Div's user avatar
  • 971
2 votes
1 answer
4k views

Python SFTP issue With Sockets Closing - An existing connection was forcibly closed by the remote host (10054) - How to continue? Breaks process,

So I have a process where I sunbmit a series of directories and files to a service. The service processes those files and then returns the directories and output files into a different directory For ...
Stumbling Through Data Science's user avatar
1 vote
2 answers
2k views

pysftp: How to update last modified date

I am trying to move a certain file to another directory after doing some process over it. Moving the file was easy using Connection.rename import pysftp conn = pysftp.Connection(host = 'host', ...
Sandeep Roy's user avatar
1 vote
1 answer
2k views

Checking if a file on SFTP server is a symbolic link, and deleting the symbolic link, using Python Paramiko/pysftp

I have a directory on a linux-based server, that contains subdirectories, one of which contains a symbolic link to another directory elsewhere on the server. I would like to, using a python script, ...
moink's user avatar
  • 888
1 vote
1 answer
482 views

SFTP with pysftp and paramiko on AWS using Elastic Beanstalk EB known_hosts

So I am building a Flask micro-service to connect up two API's. One of the API's requires all communication to be via SFTP to move XML files around (yay! 😢). On Windows, I was able to get this ...
Shmuli's user avatar
  • 56
0 votes
1 answer
389 views

Unable to use hostkey from registry to connect to EFT server using pySFTP [duplicate]

I'm at a total loss with this code. I'm trying to set up a script to transfer files from an EFT server to a local folder on a regular basis. I'n using pySFTP and by the looks of ti the file transfer ...
TomCrow's user avatar
  • 47