I'm trying to connect to a machine with SSH and log a message to a file. Here is my example:
ssh -i .ssh/mykey firstname.lastname@example.org > ~/log.txt 2> ~/err.txt
I am getting most messages written to file, just not those that require user input. For example, when connecting to a machine the first time, the following message doesn't get logged:
The authenticity of host 'blah.blah.blah (10.10.10.10)' can't be established. RSA key fingerprint is a4:d9:a4:d9:a4:d9a4:d9:a4:d9a4:d9a4:d9a4:d9a4:d9a4:d9. Are you sure you want to continue connecting (yes/no)?
I know there are options such as this
however, I don't want to disable this security feature. I still want the prompt. My app will look for this message, offer a (yes/no) button, and can then pipe the result to the stdin.
Any idea how I can get this message into a file for reading? And if not, why not?