I would like to know whether it is possible to use SSH key pair without saving private key file permanently anywhere (it is not possible to use user/password authentication). After generating it (to the temp folder) with:
from paramiko import RSAKey
bits = 2048
filename='output'
#Private key
prv = RSAKey.generate(bits=bits)
prv.write_private_key_file(filename, password='')
#Public key
pub = RSAKey(filename=filename, password='')
with open("%s.pub" % filename, "w") as f:
f.write("%s %s" % (pub.get_name(), pub.get_base64()))
Can one provide the public key to the remove server owner to add it to his known keys and then while attempting to join to his server use some kind of mechanism that does not require having private key stored permanently anywhere?
Thanks for letting me know that.