change the hostname in /etc/hostname and /etc/hosts delete all /etc/ssh/ssh_host* files run dpkg-reconfigure openssh-server