Every time I use git to interact with a remote, such as when pulling or pushing, I am shown the following message:
Warning: Permanently added '...' (RSA) to the list of known hosts.
How can I prevent this annoying message from displaying? It is only an annoyance—everything functions properly.
I am taking my solution down due to continued downvotes.
It was the best solution without actually hacking the source code of the SSH client itself.
If someone is interested, check the edit history.
Add the following line to your ssh config file ($HOME/.ssh/config):
If running ssh from the command line add the following option to the command string:
For example, the following prints out the gcc version installed on machine.example.org (and no warning):
It mainly means there are changes for the key for that host
~/.ssh/known_hosts
, and it will not automatically UPDATE it. Therefore every time you get this warning message.This happens often for the connecting to the re-created virtual machines, which changes the key with the same IP address
Solution
If you only have one entry, then you can delete the
~/.ssh/known_hosts
file, and after first connection, that the key will be there, and no warning messages after that.If you have multiple entries, then you can use command below to remove
It works fine for me
If you are using a repository from GitHub, consider using the HTTPS version of the URL instead, to sidestep this problem entirely:
If you clone your repository from within the Windows GitHub application, this is what it uses for the remote URL. Maybe they know something we don't know.
I have the same question, and I found there is not a
.ssh
file in my~
. So I just create the.ssh
directory under~
path, and the issue solved.I got into the same issue when I started using a Windows machine. In my case it was because my SSH setup was not done. Github has a very precise documentation on the SSH setup. Once that's taken care, the issue was resolved.
https://help.github.com/articles/checking-for-existing-ssh-keys/ https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/