Skip to content

Instantly share code, notes, and snippets.

@ScottKillen
Last active July 19, 2025 03:58
Show Gist options
  • Save ScottKillen/e6eb319e8ce5313680817b29f7831251 to your computer and use it in GitHub Desktop.
Save ScottKillen/e6eb319e8ce5313680817b29f7831251 to your computer and use it in GitHub Desktop.
Ubuntu VM Boilerplate
sudo rm -f /var/lib/dbus/machine-id
sudo rm -f /etc/machine-id
sudo dbus-uuidgen --ensure=/etc/machine-id
sudo ln -s /etc/machine-id /var/lib/dbus/
# For SSHD
sudo ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa -y
sudo ssh-keygen -f /etc/ssh/ssh_host_dsa_key -N '' -t dsa -y
sudo ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa -b 521 -y
sudo touch /etc/cloud-init.disabled
sed -i 's/ubuntu-template/nginx/g' /etc/hosts
sed -i 's/ubuntu-template/nginx/g' /etc/hostname
hostnamectl set-hostname nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment