<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=LXD_security_luks_dropbear</id>
	<title>LXD security luks dropbear - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://tech.uvoo.io/index.php?action=history&amp;feed=atom&amp;title=LXD_security_luks_dropbear"/>
	<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=LXD_security_luks_dropbear&amp;action=history"/>
	<updated>2026-05-16T01:02:23Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://tech.uvoo.io/index.php?title=LXD_security_luks_dropbear&amp;diff=5664&amp;oldid=prev</id>
		<title>Busk: Created page with &quot;Setting up **Dropbear** for **Initramfs** is the gold standard for &quot;headless&quot; secure servers. It allows you to SSH into your server *before* the main operating system even sta...&quot;</title>
		<link rel="alternate" type="text/html" href="https://tech.uvoo.io/index.php?title=LXD_security_luks_dropbear&amp;diff=5664&amp;oldid=prev"/>
		<updated>2026-03-20T03:25:46Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Setting up **Dropbear** for **Initramfs** is the gold standard for &amp;quot;headless&amp;quot; secure servers. It allows you to SSH into your server *before* the main operating system even sta...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Setting up **Dropbear** for **Initramfs** is the gold standard for &amp;quot;headless&amp;quot; secure servers. It allows you to SSH into your server *before* the main operating system even starts, just to type the LUKS passphrase.&lt;br /&gt;
&lt;br /&gt;
This gives you the security of a manual passphrase with the convenience of not needing a physical keyboard and monitor attached to the server.&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
### 1. Install the Dropbear Initramfs Tool&lt;br /&gt;
Ubuntu has a specific package that integrates the lightweight Dropbear SSH server into the boot process.&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
sudo apt update&lt;br /&gt;
sudo apt install dropbear-initramfs -y&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
### 2. Configure Your SSH Key&lt;br /&gt;
For security, you should use an **SSH Key** rather than a password to log in during this pre-boot phase.&lt;br /&gt;
&lt;br /&gt;
1.  **Copy your public key** (usually found at `~/.ssh/id_ed25519.pub` on your local machine).&lt;br /&gt;
2.  **Add it to the authorized keys for boot:**&lt;br /&gt;
    ```bash&lt;br /&gt;
    sudo nano /etc/dropbear/initramfs/authorized_keys&lt;br /&gt;
    ```&lt;br /&gt;
    *Paste your public key there and save.*&lt;br /&gt;
&lt;br /&gt;
### 3. Set the Network Config (Optional but Recommended)&lt;br /&gt;
If your server doesn't get an IP automatically via DHCP during boot, you can hardcode one in the GRUB config, but usually, the default is fine if your router is active. &lt;br /&gt;
&lt;br /&gt;
To change the port (to avoid conflicts with your main SSH later), edit the config:&lt;br /&gt;
```bash&lt;br /&gt;
sudo nano /etc/dropbear/initramfs/config&lt;br /&gt;
```&lt;br /&gt;
Change to: `DROPBEAR_OPTIONS=&amp;quot;-p 2222&amp;quot;` (This puts the &amp;quot;Unlock SSH&amp;quot; on port 2222).&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
### 4. Update and Reboot&lt;br /&gt;
Tell the system to rebuild the boot image with Dropbear inside it.&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
sudo update-initramfs -u&lt;br /&gt;
sudo reboot&lt;br /&gt;
```&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
### 5. How to Unlock Remotely&lt;br /&gt;
Once the server starts booting, it will &amp;quot;hang&amp;quot; at the encryption prompt. From your local laptop, run:&lt;br /&gt;
&lt;br /&gt;
```bash&lt;br /&gt;
ssh -p 2222 root@your-server-ip&lt;br /&gt;
```&lt;br /&gt;
*Note: It will always be `root`, even if that's not your main user.*&lt;br /&gt;
&lt;br /&gt;
Once you are logged in, you will see a minimal prompt. Run the unlock command:&lt;br /&gt;
```bash&lt;br /&gt;
cryptroot-unlock&lt;br /&gt;
```&lt;br /&gt;
Type your passphrase. Once accepted, the SSH session will close automatically, the drive will mount, and Ubuntu will finish booting into the main OS (and start your LXD containers).&lt;br /&gt;
&lt;br /&gt;
---&lt;br /&gt;
&lt;br /&gt;
### Summary of your &amp;quot;Private Cloud&amp;quot; Security&lt;br /&gt;
You now have a setup that mirrors high-end cloud security:&lt;br /&gt;
1.  **LXD Isolation:** Your apps are siloed in containers or VMs.&lt;br /&gt;
2.  **Full Disk Encryption:** Data is encrypted at rest (LUKS).&lt;br /&gt;
3.  **Encrypted Storage Pool:** Your LXD data lives on a ZFS-over-LUKS layer.&lt;br /&gt;
4.  **Remote Secure Unlock:** You can manage reboots from anywhere without leaving keys &amp;quot;in the lock&amp;quot; (the keyfile).&lt;br /&gt;
&lt;br /&gt;
# small bash script that checks the status of your LXD encrypted pool and alerts you if it fails to mount after an unlock&lt;br /&gt;
&lt;br /&gt;
Goal,Config Setting&lt;br /&gt;
Specify a Key,IdentityFile ~/.ssh/key_name&lt;br /&gt;
Use a Nickname,Host nickname&lt;br /&gt;
Set User,User username&lt;br /&gt;
Force Port,Port 2222 (if you changed it for security)&lt;/div&gt;</summary>
		<author><name>Busk</name></author>
	</entry>
</feed>