Running git clone git@github.com/repo.git
warns me of a potential man-in-the-middle attack when GitHub change their SSH key, and that's cool. I then get the new key by running ssh-keyscan -t rsa github.com
and carry on cloning the repo.
Both of these commands run against the same domain. I'm thinking that if the attacker got me to connect to their server to clone, they can just do the same for the ssh-keyscan
call.
What am I missing here? Should I not run ssh-keyscan
blindly and verify the new key some other way? Or is this verification not doing much for cases like GitHub? Or is there some other class of attack that this process protects me against?