Steps to do when renaming a Linux host:
- Edit
/etc/hostname - Edit
/etc/hosts - Edit
/etc/mailname - Possibly generate a new ssh host key.
See
/var/lib/dpkg/info/openssh-server.postinst(functioncreate_keys) for details on how to do that. sudo grep -r $OLDNAME /etc
If you're copying a virtual machine using virt-clone, you may want to
do these as well:
- Edit the xml file to update the
<graphics>port attribute be unique. - If the emulated network card's MAC address has changed, edit
/etc/udev/rules.d/70-persistent-net.rulesaccordingly, otherwise udev will rename it to a new name, and network might not work.