ubuntu-bootstrap
Bootstrapper for remote installation of Ubuntu server with encrypted, remotely unlockable root (on ZFS).
Introduction
The purpose of this script is to bootstrap an Ubuntu server installation with root on LUKS encrypted ZFS or another FS, over SSH from a hosted rescue environment. The specific features of this installation are as follows:
- LUKS encrypted (ZFS) root, remotely unlockable via SSH
- Unencrypted /boot (on ext4)
- Basic GPT partitioning with /boot, optional swap partition and root
- Initramfs with Dropbear, using the same SSH key as main sudoer admin account (see below) and same SSH server key as the main OpenSSH server (except the user is root)
- Disables systemd-resolved (static resolv.conf)
- Disables network interface renaming (uses old eth0 naming)
- Sets up an "admin" sudoer account
The LUKS container is encrypted with a passphrase rather than a key, to allow regular logins via console, should the need arise.
This setup is ubuntu-minimal (debootstrap'd), and sufficient for successful reboot into a working Ubuntu server, from which config management can pick up and continue with the installation.
Wishlist
- Add ext4, xfs or another FS beside ZFS
- LUKS keys in addition to passphrase
- Configurable cryptsetup options (key size, iterations, ...)
- Make removal of systemd-resolved optional
- Make net.ifnames optional
- Bootstrap SaltStack minion that can pick up config right after reboot
- Add more rescue environments, maybe as separate plugins instead
- Set up /boot on more than one drive
WARNING! This is alpha-grade software. Used in production by the author but it still requires more testing and tuning to be generally applicable.