Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions tutorials/install-almalinux-10-with-full-disk-encryption/01.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,20 @@ Dieses Tutorial verwendet zwei Beispieldateien:
**Voraussetzungen**

* Hetzner-Konto
* Server welcher in das Rescue-System gebootet ist
* Server, welcher in das Rescue-System gebootet ist und eine IPv4-Adresse besitzt
* Öffentlicher RSA, ECDSA oder ED25519 SSH-Schlüssel
* Keine privaten Netzwerke über die Hetzner Cloud an den Servern angeschlossen

> Bei Servern, welche nur eine IPv6-Adresse besitzen, muss die Konfiguration über einen vollen Networkprovider (z.B. systemd-networkd oder NetworkManager) durchgeführt werden, da der IP-Parameter des Kernels nur IPv4 und nur Gateways im gleichen Netz unterstützt.

**Hinweis: Diese Anleitung ist explizit nur für AlmaLinux 10 geschrieben. Es könnte sein, dass diese nicht auf anderen Distributionen funktioniert.**

## Schritt 1 - Erstellen oder Kopieren des öffentlichen SSH-Schlüssels

Es wird ein SSH-Schlüssel benötigt, um das verschlüsselte System während dem Boot aus der Ferne entsperren zu können. Dieser Schlüssel wird auch für die spätere Anmeldung am gebooteten System verwendet.

> Falls das Rescuesystem bereits mit hinterlegten SSH-Schlüsseln gestartet wurde, kann auch direkt der Pfad `/root/.ssh/authorized_keys` in installimage genutzt werden.

Wenn du keinen solchen Schlüssel hast, musst du einen auf deinem lokalen Gerät generieren. **Wir empfehlen die Nutzung von ED25519 oder ECDSA Schlüsseln**

Um z. B. einen ED25519-Schlüssel zu erzeugen, führe folgenden Befehl auf dem lokalen Gerät aus:
Expand Down Expand Up @@ -80,7 +84,7 @@ SSHKEYS_URL /tmp/authorized_keys

> **Hinweis:** Es sollte auch RockyLinux 10 (`Rocky-1001-amd64-base.tar.gz`) oder CentOS Stream 10 (`CentOS-1000-stream-amd64-base.tar.gz`) funktionieren — allerdings ohne Garantie.

Diese Konfiguration installiert Ubuntu auf einem einzelnen verschlüsselten Laufwerk (`/dev/sda`) mit einer separaten unverschlüsselten `/boot` Partition, das für die Entschlüsselung benötigt wird.
Diese Konfiguration installiert AlmaLinux auf einem einzelnen verschlüsselten Laufwerk (`/dev/sda`) mit einer separaten unverschlüsselten `/boot` Partition, das für die Entschlüsselung benötigt wird.

<br>

Expand Down Expand Up @@ -243,6 +247,11 @@ Erstelle im Rescue-System eine Datei `/tmp/post-install.sh` mit folgendem Inhalt
#!/bin/bash

add_initramfs_network() {
if systemd-detect-virt; then # cloud servers can still use DHCP
echo -e "kernel_cmdline=\"rd.neednet=1 ip=dhcp\"\nadd_dracutmodules+=\" network \"" > /etc/dracut.conf.d/90-network.conf
return
fi

mainif="$(ip --json a show up | jq -r 'del(.[] | select(.ifname == "lo")) | .[0]')" # main network interface
ip="$(echo $mainif | jq -r '.addr_info[0].local')" # main IP
gw="$(ip --json n | jq -r '.[0].dst')" # gateway
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,20 @@ This tutorial will use the following example files:
**Prerequisites**

* Hetzner account
* Server booted into the Rescue System
* Server with an IPv4 address booted into the Rescue System
* RSA, ECDSA or ED25519 SSH public key
* No private networks attached on Hetzner Cloud

> For servers which only have an IPv6 address, the configuration needs to be done with a full network provider (e.g. systemd-networkd or NetworkManager), as the IP parameter of the Kernel does not support IPv6 or out-of-network gateways.

**Note: This guide is explicitly written for AlmaLinux 10 only. It might not work on other distributions.**

## Step 1 - Create or copy SSH public key

You will need an SSH key to remotely unlock the disk during boot. You will also use this key later to login to the booted system.

> If the rescue system was activated with an active SSH key, you can also directly use `/root/.ssh/authorized_keys` within installimage.

If you don't have such an SSH key, you need to generate one now on your local system. **We recommend the use of ED25519 or ECDSA keys**.

For example to generate an ED25519 SSH key, run:
Expand Down Expand Up @@ -242,6 +246,11 @@ Create a file `/tmp/post-install.sh` in the rescue system with the following con
#!/bin/bash

add_initramfs_network() {
if systemd-detect-virt; then # cloud servers can still use DHCP
echo -e "kernel_cmdline=\"rd.neednet=1 ip=dhcp\"\nadd_dracutmodules+=\" network \"" > /etc/dracut.conf.d/90-network.conf
return
fi

mainif="$(ip --json a show up | jq -r 'del(.[] | select(.ifname == "lo")) | .[0]')" # main network interface
ip="$(echo $mainif | jq -r '.addr_info[0].local')" # main IP
gw="$(ip --json n | jq -r '.[0].dst')" # gateway
Expand Down
20 changes: 16 additions & 4 deletions tutorials/install-ubuntu-2004-with-full-disk-encryption/01.de.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,20 @@ Dieses Tutorial verwendet zwei Beispieldateien:
**Voraussetzungen**

* Hetzner-Konto
* Server welcher in das Rescue-System gebootet ist
* Server, welcher in das Rescue-System gebootet ist und eine IPv4-Adresse besitzt
* Öffentlicher RSA, ECDSA oder ED25519 SSH-Schlüssel
* Keine privaten Netzwerke über die Hetzner Cloud an den Servern angeschlossen

> Bei Servern, welche nur eine IPv6-Adresse besitzen, muss die Konfiguration über einen vollen Networkprovider (z.B. systemd-networkd oder NetworkManager) durchgeführt werden, da der IP-Parameter des Kernels nur IPv4 und nur Gateways im gleichen Netz unterstützt.

**Hinweis: Diese Anleitung ist explizit nur für Ubuntu 24.04 geschrieben. Es könnte sein, dass diese nicht auf anderen Distributionen funktioniert.**

## Schritt 1 - Erstellen oder Kopieren des öffentlichen SSH-Schlüssels

Es wird ein SSH-Schlüssel benötigt, um das verschlüsselte System während dem Boot aus der Ferne entsperren zu können. Dieser Schlüssel wird auch für die spätere Anmeldung am gebooteten System verwendet. Der in Ubuntu 24.04 enthaltene SSH-Daemon dropbear unterstützt RSA, ED25519 und ECDSA-Schlüssel.

> Falls das Rescuesystem bereits mit hinterlegten SSH-Schlüsseln gestartet wurde, kann auch direkt der Pfad `/root/.ssh/authorized_keys` in installimage genutzt werden.

Wenn du keinen solchen Schlüssel hast, musst du einen auf deinem lokalen Gerät generieren. **Wir empfehlen die Nutzung von ED25519 oder ECDSA Schlüsseln**

Um z. B. einen ED25519-Schlüssel zu erzeugen, führe folgenden Befehl auf dem lokalen Gerät aus:
Expand Down Expand Up @@ -233,16 +237,19 @@ SSHKEYS_URL /tmp/authorized_keys

## Schritt 3 - Post-Installations-Skript erstellen oder kopieren

Um die verschlüsselte Partition über SSH zu entsperren, müssen wir den Dropbear-SSH-Server installieren und zum initramfs hinzufügen, das auf der unverschlüsselten `/boot`-Partition gespeichert ist. Dadurch wird auch die Einbindung von `dhclient` zur Konfiguration des Netzwerks ausgelöst, allerdings ohne jegliche Extras. Um die Unterstützung für die Hetzner Cloud zu aktivieren, müssen wir einen Hook hinzufügen, der die Unterstützung für RFC3442-Routen beinhaltet.

Um diese zusätzlichen Schritte ausführen zu können, benötigen wir ein Post-Install-Skript für das `installimage` Skript.
Um die verschlüsselte Partition über SSH zu entsperren, müssen wir den Dropbear-SSH-Server installieren und zum initramfs hinzufügen, das auf der unverschlüsselten `/boot`-Partition gespeichert ist. Um diese zusätzlichen Schritte ausführen zu können, benötigen wir ein Post-Install-Skript für das `installimage` Skript.

Erstelle im Rescue-System eine Datei `/tmp/post-install.sh` mit folgendem Inhalt:

```bash
#!/bin/bash

add_initramfs_network() {
if systemd-detect-virt; then # cloud servers can still use DHCP
echo "IP=dhcp" >> /etc/initramfs-tools/initramfs.conf
return
fi

mainif="$(ip --json a show up | jq -r 'del(.[] | select(.ifname == "lo")) | .[0]')" # main network interface
ip="$(echo $mainif | jq -r '.addr_info[0].local')" # main IP
gw="$(ip --json n | jq -r '.[0].dst')" # gateway
Expand Down Expand Up @@ -295,6 +302,11 @@ update-initramfs -u
#!/bin/bash

add_initramfs_network() {
if systemd-detect-virt; then # cloud servers can still use DHCP
echo "IP=dhcp" >> /etc/initramfs-tools/initramfs.conf
return
fi

mainif="$(ip --json a show up | jq -r 'del(.[] | select(.ifname == "lo")) | .[0]')" # main network interface
ip="$(echo $mainif | jq -r '.addr_info[0].local')" # main IP
gw="$(ip --json n | jq -r '.[0].dst')" # gateway
Expand Down
20 changes: 16 additions & 4 deletions tutorials/install-ubuntu-2004-with-full-disk-encryption/01.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,20 @@ This tutorial will use the following example files:
**Prerequisites**

* Hetzner account
* Server booted into the Rescue System
* Server with an IPv4 address booted into the Rescue System
* RSA, ECDSA or ED25519 SSH public key
* No private networks attached on Hetzner Cloud

> For servers which only have an IPv6 address, the configuration needs to be done with a full network provider (e.g. systemd-networkd or NetworkManager), as the IP parameter of the Kernel does not support IPv6 or out-of-network gateways.

**Note: This guide is explicitly written for Ubuntu 24.04 only. It might not work on other distributions.**

## Step 1 - Create or copy SSH public key

You will need an SSH key to remotely unlock the disk during boot. You will also use this key later to login to the booted system. The dropbear SSH daemon included in Ubuntu 24.04 only supports RSA and ECDSA keys.

> If the rescue system was activated with an active SSH key, you can also directly use `/root/.ssh/authorized_keys` within installimage.

If you don't have such an SSH key, you need to generate one now on your local system. **We recommend the use of ED25519 or ECDSA keys**.

For example to generate an ED25519 SSH key, run:
Expand Down Expand Up @@ -232,16 +236,19 @@ SSHKEYS_URL /tmp/authorized_keys

## Step 3 - Create or copy post-install script

In order to remotely unlock the encrypted partition, we need to install and add the dropbear SSH server to the initramfs which is stored on the unencrypted `/boot` partition. This will also trigger the inclusion of `dhclient` to configure networking, but without any extras. To enable support for Hetzner Cloud, we need to add a hook which includes support for RFC3442 routes.

In order to run these additional steps, we need a post-install script for `installimage`
In order to remotely unlock the encrypted partition, we need to install and add the dropbear SSH server to the initramfs which is stored on the unencrypted `/boot` partition. In order to run these additional steps, we need a post-install script for `installimage`

Create a file `/tmp/post-install.sh` in the rescue system with the following content:

```bash
#!/bin/bash

add_initramfs_network() {
if systemd-detect-virt; then # cloud servers can still use DHCP
echo "IP=dhcp" >> /etc/initramfs-tools/initramfs.conf
return
fi

mainif="$(ip --json a show up | jq -r 'del(.[] | select(.ifname == "lo")) | .[0]')" # main network interface
ip="$(echo $mainif | jq -r '.addr_info[0].local')" # main IP
gw="$(ip --json n | jq -r '.[0].dst')" # gateway
Expand Down Expand Up @@ -294,6 +301,11 @@ update-initramfs -u
#!/bin/bash

add_initramfs_network() {
if systemd-detect-virt; then # cloud servers can still use DHCP
echo "IP=dhcp" >> /etc/initramfs-tools/initramfs.conf
return
fi

mainif="$(ip --json a show up | jq -r 'del(.[] | select(.ifname == "lo")) | .[0]')" # main network interface
ip="$(echo $mainif | jq -r '.addr_info[0].local')" # main IP
gw="$(ip --json n | jq -r '.[0].dst')" # gateway
Expand Down