We have been given the public & private keys to connect to an external (outside our firewall) WSFTP site. We need to use this/these keys to connect this vendor's WSFTP and pull the data into our systems.

We are using a RHEL Linux instance. And trying to write the process to connect & pull the data using Python. Something like this: https://stackoverflow.com/questions/42480787/loading-selected-file-from-sftp-to-s3-using-python

The question I have is how do we take the ieys provided to use and store them on our system such that they will work during a connect statement (See below).

import datetime, gspread, json, paramiko

# Variable Set Up
hostname = 'HOST.NAME'
myuser = 'USER.NAME'
mySSHK = 'PATH.To.Key'

# Actual Script (no changes should be needed)
ssh = paramiko.SSHClient()
ssh.connect(hostname, username=myuser, key_filename=mySSHK)

This was fixed by having the individual who created the key using puttygen on a windows instance, export the key as an OpenSSL key.

Copy Paste that information into ~/.ssh/id_rsa, and it worked beautifully. Apologizes for the noise. Hope this helps at least one other person.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.