10.4.4.3. Server authentication
The ssh client/server system
automatically maintains and checks a database containing
identifications for all hosts it has ever been used with. Host keys
are stored in $HOME/.ssh/known_hosts in
the user's home directory. Additionally, the file /etc/ssh/ssh_known_hosts is automatically checked
for known hosts. Any new hosts are automatically added to the
user's file. If a host's identification ever changes, ssh warns about this and disables password
authentication to prevent a Trojan horse from getting the user's
password. Another purpose of this mechanism is to prevent
man-in-the-middle attacks which could otherwise be used to
circumvent the encryption. In environments where high security is
needed, sshd can even be configured to
prevent logins to machines whose host keys have changed or are
unknown.