Alex Rivera | Logout

Git says "Warning: Permanently added to the list of known hosts"

Asked 2012-02-15T19:09:10.500
237

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.

Edit
Report

2 Answers

6

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.

answered 2012-02-15T19:31:41.297
5

To suppress warning messages for ssh you can add the following lines to ~/.ssh/config:

Host *
LogLevel error

That will disable warnings but not error messages. Like the other settings in ~/.ssh/config you can configure the LogLevel on a per-host basis if you want a more finegrained control.

answered 2013-03-03T11:42:52.737

Your Answer