Questions tagged [pysftp]

pysftp is a thin wrapper over paramiko's SFTPClient.

pysftp is a thin wrapper over 's SFTPClient.

372 questions
7
votes
1 answer

Python pysftp get_r from Linux works fine on Linux but not on Windows

I would like to copy an entire directory structure with files and subfolders recursively using SFTP from a Linux server to a local machine (both Windows and Linux) using Python 2.7. I am able to ping the server and download the files using WinSCP…
user3399495
  • 167
  • 1
  • 12
7
votes
2 answers

Python - pysftp / paramiko - Verify host key using its fingerprint

This code throws an exception. How can I verify an SSH fingerprint without storing it in a file? I believe the code below is designed for a public key. But the client with the SFTP server validated the fingerprint and did not get me the public…
TamusJRoyce
  • 817
  • 1
  • 12
  • 25
7
votes
3 answers

Python Connect over HTTP proxy with pysftp

Currently, I am doing SFTP transfer using Python subprocess.POPEN and PuTTY psftp.exe. It is working, but not really clean nor transportable. I would like to reproduce the same behavior using Python pysftp, but I do not know where to input all the…
Steven
  • 14,048
  • 6
  • 38
  • 73
7
votes
6 answers

How do i monitor the progress of a file transfer through pysftp

I'm using python 3.3.2 and pysftp to make a back-up utility that stores copies of files on another computer on my network. I already know how to use pysftp to transfer theses files however i would like to see the progress of the transfer (bytes per…
user3751069
  • 101
  • 1
  • 1
  • 4
7
votes
4 answers

Python Pysftp Error

My code: import pysftp s = pysftp.Connection(host='test.rebex.net', username='demo', password='password') data = s.listdir() s.close() for i in data: print i I'm getting an error trying to connect to a SFTP server using pysftp. This should…
Gavin Hinfey
  • 279
  • 1
  • 2
  • 13
6
votes
1 answer

Python PYSFTP - pass private-key as string/text instead of passing file path

I would like to pass my actual private-key value as argument instead of providing the file path. I have used below code as of now: import pysftp import os cnopts = pysftp.CnOpts() if str(host_keys).lower() =='none': cnopts.hostkeys =…
6
votes
1 answer

pysftp library not working in AWS lambda layer

I want to upload files to EC2 instance using pysftp library (Python script). So I have created small Python script which is using below line to connect pysftp.Connection( host=Constants.MY_HOST_NAME, …
6
votes
3 answers

"Failed to load HostKeys" warning while connecting to SFTP server with pysftp

I wrote a Python script to connect to SFTP server using key authentication. It connects to server successfully but shows the following warning (see below). What does it mean and how to remove it. What changes has to made in code? My code: import…
udit kanotra
  • 328
  • 1
  • 3
  • 17
6
votes
2 answers

Imported package not available in Jupyter-Python

Importing pysftp into Jupyter Notebook While importing pysftp into Jupyter Notebook, ModuleNotFoundError is shown. Checking import of pysftp on device? I have verified the package installation with pip list and pip show pysftp Had imported…
Anudeep S
  • 85
  • 6
6
votes
1 answer

How to sync only the changed files from the remote directory using pysftp?

I am using pysftp library's get_r function (https://pysftp.readthedocs.io/en/release_0.2.9/pysftp.html#pysftp.Connection.get_r) to get a local copy of a directory structure from sftp server. Is that the correct approach for a situation when the…
5
votes
2 answers

How to connect EC2 using pysftp via AWS Lambda without .pem file or alternate to .pem file

I want to connect EC2 using pysftp library via AWS Lambda. I use below code to connect. mysftp = pysftp.Connection( host=Constants.MY_HOST_NAME, username=Constants.MY_EC2_INSTANCE_USERNAME, private_key="./clientiot.pem", …
Vikramsinh Gaikwad
  • 827
  • 1
  • 9
  • 23
5
votes
2 answers

With pysftp, how can I specify a timeout value for the connection?

With pysftp, I see how to set a timeout for any commands once you're already connected, but I don't see how to set a timeout for the connection itself. I feel like I'm missing something somewhere. Just to try it, I tried adding timeout=3 to the…
CyberTaco
  • 338
  • 1
  • 3
  • 14
5
votes
3 answers

How to import .pem file to an AWS Lambda function

I am trying to connect to STFP using AWS Lambda which needs a private key file. I am able to connect from local and now I need to deploy it into a Lambda function. But pysftp.connection needs filepath rather than keystring to connect. Can I package…
5
votes
2 answers

python pysftp [Errno 13] Permission denied:

I'm trying to copy files from SFTP server . I can connect using python pysftp . I can run: data = srv.listdir() for i in data: print I And I get the Directory list. But when I try sftp.put (localpath,"file_name.txt") I get >"IOError: [Errno…
Saddem
  • 51
  • 1
  • 1
  • 2
5
votes
4 answers

pysftp -- paramiko SSHException, Bad host key from server

I'm trying to connect to a remote host via pysftp: try: with pysftp.Connection(inventory[0], username='transit', private_key='~/.ssh/id_rsa.sftp', port=8055) as sftp: sftp.put('/home/me/test.file') except…
MrDuk
  • 16,578
  • 18
  • 74
  • 133
1
2
3
24 25