Using Python trying to download files from SFTP using pysftp module and save the files directly in S3 bucket. I should not save the files in my local. They should be directly saved into S3. I could not find an option to put the files directly in…
Trying to use pysftp to pull files from an sFTP server that requires both ssh key & password for authentication without much luck. Can use pysftp with just key and just password, but it breaks when I attempt to use both. Hoping someone has some…
I have an SFTP server. I can take data by transferring/downloading files. Is there a way that I can do without downloading files?
My code is as below:
# Connection to the SFTP server
with pysftp.Connection(hostname, username, passowrd, port) as…
I am trying to use pysftp's getfo() to read a shapefile (without downloading it). However the output I get does not seem workable and I'm not sure if its possible do this with a shapefile.
Ideally I would like to read in the file and convert it to a…
I am trying to upload all the files in my Windows folder to SFTP folder. Below is my code. If there are no files in csv folder, nothing should happen. How to achieve this?
with pysftp.Connection(host, username, password) as sftp:
localpath =…
I am using pysftp to access files on SFTP. But I want to get the last modified date of these files and store it in mongo. This is to access the date again next time I run the code.
I cannot find a function that returns me the date of the file.
class…
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")
file_contents = list(csv.reader(file))
But when I do this, I get the…
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 = 'thename'
private_key = 'private_key'
keydata…
I'm trying to import pysftp in my AWS lambda function, but I'm getting this error:
"Unable to import module 'app': cannot import name '_bcrypt' from partially initialized module 'bcrypt' (most likely due to a circular import)"
The only code I have…
I have a requirement to get the file details for certain locations (within the system and SFTP) and get the file size for some locations on SFTP which can be achieved using the shared code.
def getFileDetails(location: str):
filenames: list =…
Getting error
paramiko.ssh_exception.SSHException: No hostkey for host target.org found.
when using pysftp (for a connection that requires a specific port), even though I am providing the same known_hosts file that was initially used to connect to…
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 example, there will be a parent directory with…
I have setup a aws ec2 linux instnace with sftp server configured.
I am able to send curl command from cli of linux server to aws instance with below command:
curl sftp://username:password@ec2-instance/dir/
But when I use same command from python…
I have aws ssh key as awskey.pem.
I am trying to sftp to the host with pysftp.
import pysftp as sftp
keyfile='c:\\awskey.pem'
Cnopts=sftp.CnOpts()
Cnopts.hostkeys.load(keyfile)
srv=sftp.connection(host…