Guida

Crittografia completa del disco su una VPS con sblocco remoto

AvanzatoLettura di 30 minAggiornato 11 giugno 2026
Risposta breve

LUKS2 con un demone SSH dropbear nell'initramfs ti consente di crittografare il filesystem di root e fornire la passphrase da remoto a ogni avvio. Il provider non detiene mai la chiave, quindi un disco spento è testo cifrato. Non protegge da un hypervisor compromesso, e nessun provider può onestamente affermare il contrario.

01 Capire esattamente cosa protegge

Protects against: physical seizure of a powered-off disk, decommissioned hardware, a datacentre incident, a technician with physical access. Does not protect against: a compromised running hypervisor, or a compromise of the running instance. The key is in memory while the machine runs.

02 Installa su una root crittografata

On the Bastion line this is preconfigured. On any other instance, boot the distribution installer through the out-of-band console and choose an encrypted LVM layout.

03 Aggiungi dropbear all'initramfs

This is what lets you supply the passphrase over SSH before the root filesystem is mounted.

apt install -y dropbear-initramfs cryptsetup-initramfs
echo 'DROPBEAR_OPTIONS="-p 2222 -s -j -k"' >> /etc/dropbear/initramfs/dropbear.conf
cat ~/.ssh/id_ed25519.pub > /etc/dropbear/initramfs/authorized_keys
update-initramfs -u -k all

04 Configura la rete di avvio

The initramfs has no DHCP client by default; give it a static configuration matching your instance.

# /etc/initramfs-tools/initramfs.conf
IP=203.0.113.10::203.0.113.1:255.255.255.0::eth0:off

05 Sblocca dopo ogni riavvio

Connect on the initramfs port and supply the passphrase. The boot then continues normally.

ssh -p 2222 [email protected]
# then: cryptroot-unlock

Domande frequenti

Cosa succede se il server si riavvia mentre dormo?

Attende al prompt di sblocco. Questo è il compromesso: i riavvii non presidiati sono impossibili, il che è esattamente ciò che rende la chiave davvero tua.

OnionVPS può sbloccare il mio disco?

No. Non conserviamo mai la passphrase e non esiste alcun meccanismo di recupero. Se la perdi, i dati sono persi.