luks

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
luks [23/06/2016 - 15:20] – gelöscht administratorluks [06/04/2024 - 07:02] (aktuell) thommie4
Zeile 1: Zeile 1:
 +====== LUKS ======
 +
 +Basisinfo: [[https://de.opensuse.org/SDB:Sicherheit_Verschl%C3%BCsselung_mit_LUKS|https://de.opensuse.org/SDB:Sicherheit_Verschl%C3%BCsselung_mit_LUKS]]
 +
 +[[https://wiki.ubuntuusers.de/LUKS/|https://wiki.ubuntuusers.de/LUKS/]]
 +
 +**Vor LEAP: Image *.img reparieren**
 +
 +Die *.key Datei ist auch verschlüsselt, daher geht es nicht direkt siehe dazu [[https://forums.opensuse.org/showthread.php/501003-How-to-check-encrypted-home-directory-by-fsck|https://forums.opensuse.org/showthread.php/501003-How-to-check-encrypted-home-directory-by-fsck]]
 +
 +''openssl aes-256-cbc -d -in /home/image.key | cryptsetup luksOpen /home/image.img my_home ''
 +
 +Danach fsck auf /dev/mapper/my_home
 +
 +Mit luksclose wird das Image geschlossen
 +
 +''cryptsetup luksClose my_home ''
 +
 +**Ab Leap werden normale LUKS Partitionen benutzt.**
 +
 +**LUKS Partitionen (ab OpenSUSE Leap)**
 +
 +Die Partition wird über ein Loop Setup ins Dateisystem gemountet:
 +<code>
 +
 +dev/sda1              932G  352G  578G  38% /srv/vm
 +/dev/mapper/cr-auto-1  120G   89G   32G  74% /home
 +tmpfs                  3.2G      3.2G   0% /run/user/497
 +
 +</code>
 +
 +Die Zuordnung der gemappten Partition zur Partition auf der Platte steht in in /etc/crypttab
 +
 +<code>
 +less /etc/crypttab
 +
 +cr_swap UUID=8e3cdf66-aea2-4a93-a5f3-bb8bd8d1d77f
 +cr_home UUID=a8332074-8ff7-474b-9b07-ae15cfc71ca0
 +cr_root UUID=eb9ebba2-262a-4ab8-aa31-2b024d825679 none x-initrd.attach
 +
 +</code>
 +
 +Die Befehle für cryptsetup funktionieren nur an der Originalpartition, auch über
 + <font inherit/monospace;;inherit;;#000000background-color:#ffffff;>/dev/disk/by-uuid/</font>
 +
 +<code>
 +less /etc/crypttab
 +
 +cr_swap  UUID=8e3cdf66-aea2-4a93-a5f3-bb8bd8d1d77f
 +cr_home  UUID=a8332074-8ff7-474b-9b07-ae15cfc71ca0
 +cr_root  UUID=eb9ebba2-262a-4ab8-aa31-2b024d825679  none  x-initrd.attach
 +
 +</code>
 +
 +<code>
 +odysseus3:~ # cryptsetup luksDump /dev/nvme0n1p3
 +
 +LUKS header information for /dev/nvme0n1p3
 +
 +Version:        1
 +Cipher name:    aes
 +Cipher mode:    xts-plain64
 +Hash spec:      sha256
 +Payload offset: 4096
 +MK bits:        256
 +MK digest:      1f 06 0e 96 37 13 1c 25 d8 03 cd 64 df 2a 67 94 26 a5 6b 69
 +MK salt:        e2 b4 a9 e0 c3 89 84 e6 cc 6f cb d0 fc da 3a 92
 +                ce 52 95 ce c4 ca fa 65 7b bf 06 a8 ea 8a 03 3e
 +MK iterations:  173146
 +UUID:           7b1703a0-0ff9-4836-b67a-9e9e951b5182
 +
 +Key Slot 0: ENABLED
 +        Iterations:             2770346
 +        Salt:                   f1 de c8 30 e1 80 5e eb 66 93 0d 03 b6 9a ee 90
 +                                75 5b a5 29 1c 50 17 79 18 b9 4d 5f c2 82 61 38
 +        Key material offset:    8
 +        AF stripes:             4000
 +Key Slot 1: ENABLED
 +        Iterations:             3912596
 +        Salt:                   89 fc dd 4c 1c f9 6f ff b2 4e 2e 40 03 a7 a4 5f
 +                                de 7a 7a 08 3e 72 16 58 b2 5f 24 c8 b6 87 86 c0
 +        Key material offset:    264
 +        AF stripes:             4000
 +Key Slot 2: DISABLED
 +Key Slot 3: DISABLED
 +Key Slot 4: DISABLED
 +Key Slot 5: DISABLED
 +Key Slot 6: DISABLED
 +Key Slot 7: DISABLED
 +
 +</code>
 +
 +Passphrase hinzufügen:
 +
 +<code>
 +cryptsetup luksAddKey /dev/nvme0n1p3 --key-slot 0
 +
 +</code>
 +
 +Passphrase in Slot gezielt ändern:
 +
 +<code>
 +cryptsetup luksChangeKey /dev/nvme0n1p3 --key-slot 3
 +
 +</code>
 +
 +Passphrase entfernen
 +
 +<code>
 +cryptsetup luksKillSlot /dev/nvme0n1p3 --key-slot 3
 +
 +</code>
 +
 +Passphrase testen
 +
 +<code>
 +cryptsetup luksOpen --test-passphrase
 +
 +</code>
 +
  
  • luks.1466695246.txt.gz
  • Zuletzt geändert: 05/03/2024 - 10:52
  • (Externe Bearbeitung)