When I run
ssh-keyscan -p NNN -t rsa GITHOST
it produces sting like
GITHOST ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQCZwBe6yneM2q2KEuQ3UV194hUcEcQ7b0xoYdKXKU6RrsxP2wup3uwC4q2SbPlW6XkjVtOIXY4c5aBaieMjNhIBFxGa2yUnTwZPFZiGMh/fwoZ2IsLsIE7XCj2q4eO1jmxvgWf7VAE7DVkGg5VTcRRoVOP5V15z9/saP5u4Tcwu1w==
And I add it to ~/.ssh/known_hosts
file.
But the git still asks me about key verification. Could be it b/c there is no port information stored in the known_hosts
file ?
How can I create proper known_hosts
in a script?
HashKnownHosts=yes
? If so, you will need to hash your hosts fin that file usingssh-keygen -H
after that.