Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
lpi2:cryptsetup-luks [2014/06/30 14:02] ingo_wichmann |
lpi2:cryptsetup-luks [2024/05/20 11:14] (aktuell) ingo_wichmann [Pakete] |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== cryptsetup-luks ====== | ====== cryptsetup-luks ====== | ||
TODO: http://www.heise.de/security/artikel/Erfolgreicher-Angriff-auf-Linux-Verschluesselung-2072199.html beachten | TODO: http://www.heise.de/security/artikel/Erfolgreicher-Angriff-auf-Linux-Verschluesselung-2072199.html beachten | ||
- | ===== Pakete ===== | + | ===== Vorbereitung ===== |
+ | ==== Pakete ==== | ||
''cryptsetup-luks'' | ''cryptsetup-luks'' | ||
- | Partition oder logical volume anlegen: | + | Debian (ab 10): ''cryptsetup'' |
+ | |||
+ | ==== Kernel-Modul ==== | ||
+ | modinfo dm_crypt | ||
+ | muss vorhanden sein | ||
+ | |||
+ | ===== Verschlüsseltes Dateisystem anlegen ===== | ||
+ | ==== Partition oder logical volume anlegen ==== | ||
+ | fdisk /dev/<platte> | ||
+ | oder | ||
lvcreate --size 1G --name lv_cryptsetup vg_centos6 | lvcreate --size 1G --name lv_cryptsetup vg_centos6 | ||
- | Partition verschlüsseln: | + | ==== alte (Meta)daten von Partition entfernen ==== |
- | cryptsetup luksFormat /dev/vg_centos6/lv_cryptsetup | + | wipefs -af /dev/<partition> |
- | | + | ((oder |
- | Partition öffnen: | + | dd if=/dev/zero of=/dev/<partition> status=progress bs=1M |
- | cryptsetup luksOpen /dev/vg_centos6/lv_cryptsetup crypt | + | oder |
+ | cryptsetup open --type plain -d /dev/urandom /dev/<partition> wipe_me | ||
+ | dd if=/dev/zero of=/dev/mapper/wipe_me status=progress bs=1M | ||
+ | cryptsetup close /dev/mapper/wipe_me | ||
+ | )) | ||
- | Dateisystem anlegen und mounten: | + | ==== Partition verschlüsseln ==== |
+ | cryptsetup --verbose luksFormat --type luks2 /dev/<partition> | ||
+ | (( | ||
+ | Ausgabe genau lesen: da steht "UPPERCASE" ;-) | ||
+ | )) | ||
+ | |||
+ | === testen === | ||
+ | cryptsetup luksDump /dev/<partition> | ||
+ | |||
+ | ==== Partition öffnen ==== | ||
+ | cryptsetup open --type luks2 /dev/<partition> crypt | ||
+ | |||
+ | === Testen === | ||
+ | == Neues Device anzeigen == | ||
+ | dmsetup ls | ||
+ | ls -l /dev/mapper/crypt | ||
+ | |||
+ | == Verschlüsselungsverfahren anzeigen == | ||
+ | cryptsetup status crypt | ||
+ | |||
+ | ==== Dateisystem anlegen ==== | ||
mkfs.ext4 /dev/mapper/crypt | mkfs.ext4 /dev/mapper/crypt | ||
+ | |||
+ | ===== mounten und rebootfest machen ===== | ||
+ | ==== mounten ==== | ||
mkdir /mnt/crypt | mkdir /mnt/crypt | ||
mount /dev/mapper/crypt /mnt/crypt | mount /dev/mapper/crypt /mnt/crypt | ||
- | Rebootfest machen: | + | ==== Rebootfest machen ==== |
umount /mnt/crypt | umount /mnt/crypt | ||
- | cryptsetup luksClose crypt | + | cryptsetup close crypt none |
- | ''/etc/crypttab'' : | + | <file txt /etc/crypttab> |
- | <file> | + | crypt /dev/<partition> none |
- | crypt /dev/vg_centos6/lv_cryptsetup | + | |
</file> | </file> | ||
+ | |||
+ | === testen === | ||
+ | TODO: ist das debian-spezifisch? | ||
+ | |||
+ | cryptdisks_start crypt | ||
+ | ===== Neues Passwort hinzufügen ===== | ||
+ | cryptsetup luksAddKey /dev/<partition> | ||
+ | |||
+ | Vergebene Passwortslots anzeigen: | ||
+ | cryptsetup luksDump /dev/<partition> | ||
====== Links ====== | ====== Links ====== | ||
* http://en.wikipedia.org/wiki/Disk_encryption_theory | * http://en.wikipedia.org/wiki/Disk_encryption_theory | ||
+ | * https://cryptsetup-team.pages.debian.net/cryptsetup/encrypted-boot.html | ||
+ | * https://0pointer.net/blog/authenticated-boot-and-disk-encryption-on-linux.html |