Change hostname on ubuntu 16.04 xenial

All operations from sudo user sudo su

1. Replace old name with new name in files:

/etc/hostname
/etc/hosts

2. Run commands inĀ  terminal:

3. Recreate ssh keys on the machine:

After reboot machine should be accessed by new name

Leave a Reply

Your email address will not be published.