Closed wfleurant closed 2 years ago
Thanks for the interest and report.
Yes, I agree this is good to have. Had been considering this feature, good to track it. It is now supported by both ssh2-python and ssh-python.
This is planned for next release - 2.8.0
.
2.8.0
now supports pkey
as bytes for private key data.
pkey_data = b"""----BEGIN RSA PRIVATE KEY-----
<some data>
-----END RSA PRIVATE KEY-----
"""
client = <any client>(pkey=pkey_data)
Feature request alleviates having to provide a private key file to pssh client if i could provide a base64 value of the private key to
ParallelSSHClient
(pkey=
andproxy_pkey=
)then I can keep privatekeys in ram, versus copying them from ram to disk.
Describe the solution you'd like there is a section here https://ssh-python.readthedocs.io/en/latest/key.html
and in it, references the current way keys are loaded by file. so i think i would like to do something where the above key document includes base64, as in
ssh.key.import_privkey_base64(bytes b64_key, passphrase=b'')
Alternatives . run ssh agent and add keys, but this does not scale with many keys.
. copy keys to tmpfs (ram) with a unique name, then run commands and then destroy keys.
Context/Setup . using multi-thread execution (huey)