Score:0

ssh pass host fingerprint and private key without creating them as files

co flag

I'm trying to invoke ssh with a custom private key and host fingerprint stored in local vars rather than in files. I would like to avoid creating temp files because if my script is killed I'll get no chance to clean them up (not even with trap EXIT). My current attempt is:

ssh -o UserKnownHostsFile=<(echo -n "$HOST_FINGERPRINT") -i <(echo -n "$PRIVATE_KEY")

But the process substitution doesn't seem to work, I get:

Warning: Identity file /dev/fd/62 not accessible: No such file or directory.
        Host key verification failed.

Any alternatives to that? Thanks! I'm on Debian 10 btw.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.