SSH and Public Key

[ Introduction | Setting Example]

Basically, for a Public Key  Encryption system to work.
Both two sides have to store the public key of each other.
Here, we have server and terminal:
Server store public key of client  in $HOME/.ssh/authorized_keys
Clietn store public key of server in $HOME/.ssh/known_hosts

Attention: Each key is only one line  ( one very long line) in the file.

Generally, client could trust the server if it like. So, Once this occurs:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that the DSA host key has just been changed.
The fingerprint for the DSA key sent by the remote host is
14:b0:b4:42:01:5f:d6:20:69:4f:5b:e6:10:cb:65:cf.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:3
DSA host key for 10.0.0.3 has changed and you have requested strict checking.
Host key verification failed.

There could be solved by easily removed the offending line in known_hosts file.

Examples:

It's important to know that there are essentially two versions of SSH out in the wild. On most GNU/Linux systems the OpenSSH implementation is installed which (these days) defaults to SSH protocol 2. On Windows SSH Shell, the commercial version of SSH is installed (also using protocol 2).

Reference:

  1. Secure your connections with SSH