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.
That message is from SSH, which is warning you that you are connecting to a host which you've never connected to before. I wouldn't recommend turning it off, since it would mean that you might miss a warning about a host key changing, which can indicate a MITM attack on your SSH session.
To suppress warning messages for
ssh
you can add the following lines to~/.ssh/config
:That will disable warnings but not error messages. Like the other settings in
~/.ssh/config
you can configure theLogLevel
on a per-host basis if you want a more finegrained control.Add ssh key
crate config file
add below line.
Then add pub key and clone your repository... Done.....
I had faced the same error in Linux/Cent OS VM and it was because the IP was changing after restart. In order to get around this problem, I defined a static IP in the network and added that entry to /etc/hosts file. For static IP mention a slightly higher range value. For example if your current IP (ipconfig/ifconfig) is 192.168.0.102, next time after restart this may become 192.168.0.103. So define your static IP in IPV4 settings as 192.168.0.181 which should do the trick.
Solution: create a
~/.ssh/config
file and insert the line:You will then see the message the next time you access Github, but after that you'll not see it anymore because the host is added to the
known_hosts
file. This fixes the issue, rather than just hiding the log message.This problem was bugging me for quite some time. The problem occurs because the OpenSSH client compiled for Windows doesn't check the known_hosts file in
~/.ssh/known_hosts
ssh -vvvvvvvvvvvvvvvvvvv git@github.com
Set
LogLevel
toERROR
(notQUIET
) in~/.ssh/config
file to avoid seeing these errors: