Necessary Changes After Cloning A System

  1. Change the hostname in the files /etc/hostname, /etc/mailname and /etc/hosts. Afterwards run the script /etc/init.d/hostname.sh to set the new hostname on the running system:

    root@host:~# /etc/init.d/hostname.sh
  2. Remove the SSH host keys which were generated on the old system:

    root@host:~# rm /etc/ssh/ssh_host_*key{,.pub}

    and create new SSH host keys for the new system:

    root@host:~# ssh-keygen -A
  3. If a static IP address configuration is used, change the IP addresses in /etc/network/interfaces

  4. If postfix is installed change the hostname in the file /etc/postfix/main.cf:

    /etc/postfix/main.cf
    myhostname = <new hostname>
    mydestination = <new hostname>, <new fqdn>, localhost.localdomain, localhost

    Update the local aliases file:

    root@host:~# newaliases
  5. Reboot the system.