An SSH host key is the cryptographic key that uniquely identifies every server running SSH. This key is associated with the server's IP address by your local SSH client and is checked every time you log into the server. If the key or IP change you are warned by SSH. This check is performed in order to protect you against a man-in-the-middle-attack.

This is an important consideration when using snapshots because a server snapshot is an exact copy of the original including its SSH host key. This is only a concern when several servers are all imaged from the same snapshot and running at the same time. When this happens they will all share the same SSH host key which should be avoided as the SSH host keys ought to be unique.

If you are running several live servers from the same image you should re-generate their SSH keys in order to avoid any problems.

This is done with the following commands:

Debian and Ubuntu

rm /etc/ssh/ssh_host*key*
ssh-keygen -A
BASH

CentOS

rm /etc/ssh/ssh_host*key*
/etc/init.d/sshd restart
BASH


When you log out and log back into the server you will be warned by SSH that the host key has changed and may have to delete a line from your known_hosts file.

Please note that all servers installed from Memset stock images have unique SSH host keys.