Hướng dẫn

Full-disk encryption on a VPS with remote unlock

Nâng cao30 phút đọcCập nhật 11 tháng 6, 2026
Câu trả lời ngắn

LUKS2 với daemon SSH dropbear trong initramfs cho phép bạn mã hóa hệ thống tệp gốc và cung cấp cụm mật khẩu từ xa ở mỗi lần khởi động. Nhà cung cấp không bao giờ giữ khóa, vì vậy ổ đĩa khi tắt nguồn là bản mã (ciphertext). Điều này không bảo vệ chống lại một hypervisor bị xâm nhập, và không nhà cung cấp nào có thể trung thực tuyên bố khác.

01 Understand exactly what this protects

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 Install to an encrypted root

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 Add dropbear to the 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 Configure the boot network

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 Unlock after each reboot

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

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

Câu hỏi thường gặp

What happens if the server reboots while I am asleep?

Nó chờ tại dấu nhắc mở khóa. Đó là sự đánh đổi: việc khởi động lại không cần giám sát là không thể, điều này chính là thứ khiến cho khóa thực sự thuộc về bạn.

Can OnionVPS unlock my disk?

Không. Chúng tôi không bao giờ giữ cụm mật khẩu và không có cơ chế khôi phục. Nếu bạn mất nó, dữ liệu sẽ biến mất.