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

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


Solution: create a ~/.ssh/config file and insert the line:

UserKnownHostsFile ~/.ssh/known_hosts

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

debug3: check_host_in_hostfile: filename /dev/nulldebug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hostsdebug3: check_host_in_hostfile: filename /dev/nulldebug3: check_host_in_hostfile: filename /etc/ssh/ssh_known_hostsWarning: Permanently added 'github.com,207.97.227.239' (RSA) to the list of known hosts.


Add the following line to your ssh config file ($HOME/.ssh/config):

LogLevel=quiet

If running ssh from the command line add the following option to the command string:

-o LogLevel=quiet

For example, the following prints out the gcc version installed on machine.example.org (and no warning):

ssh -o UserKnownHostsFile=/dev/null \    -o StrictHostKeyChecking=no \    -o LogLevel=quiet \    -i identity_file \    machine.example.org \    gcc -dumpversion


Set LogLevel to ERROR (not QUIET) in ~/.ssh/config file to avoid seeing these errors:

Host *   StrictHostKeyChecking no   UserKnownHostsFile /dev/null   LogLevel ERROR