I had to solve a fringe case lately where I had to add a number of server fingerprints to a user's
known_hosts (the authorization is performed with a keypair). I thought the easiest solution would be to just call
yes yes | ssh *login@host*
. Surprisingly (to me at least), this doesn't work:
ssh still asks whether to add the fingerprint, and requires manual input.
My question is: why is this the case, as in, what is the mechanism underlying this behavior?