Open sw-samuraj opened 6 years ago
Hahah, your timing is impeccable. We had just discussed a little while back how nice it would be if Terratest, when running locally, or perhaps when some env var was set, would import your existing public key (i.e., from ~/.ssh/id_rsa.pub
) into AWS, rather than creating a totally new one. That way, if a test failed, you could SSH to the relevant resources with your regular SSH key, which is probably already in ssh-agent. A PR for that is most welcome 😄
With that goes another question - as I understand from the source code, all the private keys are unencrypted, right? Would be nice to be able to work with encrypted keys as well.
Ah, that's a good point. Not sure the best way to handle that. Interactively asking for a password could be a weird user experience. Perhaps providing the password via env var? Or is there some way to get the encrypted key from ssh-agent?
I'll try to sketch a first draft and then discuss/develop it further.
Question: I went through the examples and
ssh
package source code, but I didn't find a function for loading of existing SSH keys/key-pair. All the scenarios are about:I'm missing a function which just performs key-pair loading, but not from the transient test data, but from the "real" keys stored somewhere on the filesystem.