I am trying to setup a SFTP server on AWS.
I am using ssh2-sftp-client
as a client to connect to my server on AWS.
I have tried this before connecting to a local server and was working successfully, the only difference now is that I am trying to use a ppk instead of a password.
I used PuttyGen to convert my pub-key into a ppk but still doesn't like it.
This is what my connection looks like:
await sftp.connect({
host: process.env.SFTP_HOST,
port: process.env.SFTP_PORT,
username: process.env.SFTP_USERNAME,
privateKey: fs.readFileSync('./transfer_key.ppk')
})
and this is the error I get:
Error: ENOENT: no such file or directory, open './transfer_key.ppk'
Any idea how to connect to AWS transfer in this way?
Thank you