Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
| Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
|
lpi2:cryptsetup-luks [2018/12/02 08:01] ingo_wichmann |
lpi2:cryptsetup-luks [2024/05/20 11:14] (aktuell) ingo_wichmann [Pakete] |
||
|---|---|---|---|
| Zeile 4: | Zeile 4: | ||
| ==== Pakete ==== | ==== Pakete ==== | ||
| ''cryptsetup-luks'' | ''cryptsetup-luks'' | ||
| + | |||
| + | Debian (ab 10): ''cryptsetup'' | ||
| ==== Kernel-Modul ==== | ==== Kernel-Modul ==== | ||
| - | modinfo dm_cyrpt | + | modinfo dm_crypt |
| muss vorhanden sein | muss vorhanden sein | ||
| Zeile 26: | Zeile 28: | ||
| ==== Partition verschlüsseln ==== | ==== Partition verschlüsseln ==== | ||
| - | cryptsetup --verbose luksFormat /dev/<partition> | + | cryptsetup --verbose luksFormat --type luks2 /dev/<partition> |
| (( | (( | ||
| Ausgabe genau lesen: da steht "UPPERCASE" ;-) | Ausgabe genau lesen: da steht "UPPERCASE" ;-) | ||
| Zeile 35: | Zeile 37: | ||
| ==== Partition öffnen ==== | ==== Partition öffnen ==== | ||
| - | cryptsetup open --type luks /dev/<partition> crypt | + | cryptsetup open --type luks2 /dev/<partition> crypt |
| === Testen === | === Testen === | ||
| Zeile 45: | Zeile 47: | ||
| cryptsetup status crypt | cryptsetup status crypt | ||
| - | ==== Dateisystem anlegen und mounten ==== | + | ==== 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 |
| <file txt /etc/crypttab> | <file txt /etc/crypttab> | ||
| - | crypt /dev/<partition> | + | crypt /dev/<partition> none |
| </file> | </file> | ||
| + | === testen === | ||
| + | TODO: ist das debian-spezifisch? | ||
| + | |||
| + | cryptdisks_start crypt | ||
| ===== Neues Passwort hinzufügen ===== | ===== Neues Passwort hinzufügen ===== | ||
| - | cryptsetup luksAddKey /dev/vg_centos6/lv_cryptsetup | + | cryptsetup luksAddKey /dev/<partition> |
| Vergebene Passwortslots anzeigen: | Vergebene Passwortslots anzeigen: | ||
| - | cryptsetup luksDump /dev/vg_centos6/lv_cryptsetup | + | cryptsetup luksDump /dev/<partition> |
| - | ====== cryptsetup (ohne luks) ====== | + | |
| - | //obsolet: heute benutzt man luks// | + | |
| - | ===== Pakete ===== | + | |
| - | ''cryptsetup-luks'' | + | |
| - | + | ||
| - | Partition oder logical volume anlegen: | + | |
| - | lvcreate --size 1G --name lv_cryptsetup vg_centos6 | + | |
| - | + | ||
| - | Partition verschlüsseln: | + | |
| - | cryptsetup create crypt /dev/vg_centos6/lv_cryptsetup | + | |
| - | + | ||
| - | Neues Device anzeigen: | + | |
| - | dmsetup ls | + | |
| - | ====== dmsetup ====== | + | |
| - | dmsetup ls | + | |
| - | dmsetup rm /dev/mapper/xy | + | |
| ====== 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 | ||