Skip to content

Instantly share code, notes, and snippets.

@kenjij
Last active February 16, 2016 06:38
Show Gist options
  • Save kenjij/70439b6d55a3d7a27b62 to your computer and use it in GitHub Desktop.
Save kenjij/70439b6d55a3d7a27b62 to your computer and use it in GitHub Desktop.
Create New Host from Ubuntu Backup Image
# Better to be root
sudo bash
# Change IP address (static)
nano /etc/network/interfaces
# Update hostnames
nano /etc/hostname
nano /etc/hosts
# Generate new SSH host keys
rm /etc/ssh/ssh_host_*
dpkg-reconfigure openssh-server
# If dpkg-reconfigure doesn't work
ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment