I am creating a Python AWS Lambda function that connects to db to extract data as CSV then sftp that CSV into an SFTP server (abc.example.com). I am using pysftp and Paramiko. Looks like pysftp needs a private key file for password less connection to SFTP host. How do I get this private key file?
Do we need to create a public/private key pair (ssh-keygen
) at destination SFTP host? And then use the public part of that key within Lambda function?
Thanks