Moin natürlich habe ich eine ganz normale Verschüsselung.
Hier auf sda2 und über crypttab mittels DeviceName als notwenige 'PasswortEingabe' angelegt.
Die 2 Platte wird über ein File das auf der verschlüsselten root liegt nach dem boot entschlüsselt.
Weiterhin habe ich natürlich auch unterschiedliche Keys zur Sicherheit in die Keystores abgelegt .. und diese auf unterschiedliche Medien verteilt.
Irgendwas sollte immer gehen.
Nochmal die Aufgabe Ziel ist :
wenn USB drin: root entschlüsseln
wenn kein USB: normale PasswortEingabe nach dem GrubMenü
Zur Frage :
Was hindert dich, ganz normal zu verschlüsseln,
ein Keyfile auf den Stick zu legen und dann damit zu arbeiten?
Ich kann das Henne Ei Problem nicht lösen :
Wie und wo soll man ein Keyfile das auf einem USB liegt optional angeben ?
+ UUID
+ LABEL
- DeviceName ist unbestimmt
- UDEV roules ? wann ziehen die ? - Henne Ei Problem ? ->
Der oder die den Stickeinstecker musst du so, oder so vertrauen.
OK das System kann entschlüsselt werden und mit knoppix kommt man dann an die Daten der Platte als root.
Aber normalerweise kann das nicht jeder.
Hier ein paar Daten :
* normale SSD als boot+root+home+swap Platte (0xe4b6d691)
# # # sfdisk -l /dev/sda | nl -ba
# # 1 Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
# # 2 Units: sectors of 1 * 512 = 512 bytes
# # 3 Sector size (logical/physical): 512 bytes / 512 bytes
# # 4 I/O size (minimum/optimal): 512 bytes / 512 bytes
# # 5 Disklabel type: dos
# # 6 Disk identifier: 0xe4b6d691
# # 7
# # 8 Device Boot Start End Sectors Size Id Type
# # 9 /dev/sda1 * 2048 2105343 2103296 1G 83 Linux
# # 10 /dev/sda2 2105344 250068991 247963648 118.2G 8e Linux LVM
# # #
* was sieht das System
# # # ~/bin> lsblk --fs -o NAME,FSTYPE,LABEL,UUID,MOUNTPOINT /dev/sda | nl -ba
# # # 1 NAME FSTYPE LABEL UUID MOUNTPOINT
# # # 2 sda
# # # 3 ├─sda1 /boot
# # # 4 └─sda2
# # # 5 └─system
# # # 6 ├─system-root /
# # # 7 ├─system-swap [SWAP]
# # # 8 └─system-home /home
# # # ~/bin>
# # # blkid /dev/sda* /dev/mapper/system*
# # /dev/sda: PTUUID="e4b6d691" PTTYPE="dos"
# # /dev/sda1: UUID="xxxxxxxx-54a2-4851-af28-xxxxxxxx" TYPE="ext4" PTTYPE="dos" PARTUUID="e4b6d691-01"
# # /dev/sda2: UUID="xxxxxxxx-9475-491a-b500-xxxxxxxx" TYPE="crypto_LUKS" PARTUUID="e4b6d691-02"
# # /dev/mapper/system: UUID="xxxxxxxx-3cdG-13MW-v1BA-fI10-AYGA-sHEFDR" TYPE="LVM2_member"
# # /dev/mapper/system-home: UUID="xxxxxxxx-68d4-4db0-bd3c-xxxxxxxx" TYPE="ext4"
# # /dev/mapper/system-root: UUID="xxxxxxxx-074a-44bb-b270-xxxxxxxx" TYPE="ext4"
# # /dev/mapper/system-swap: UUID="xxxxxxxx-659a-44f4-bf7e-xxxxxxxx" TYPE="swap"
# # #
* wie wird es entschlüsselt -> Hier DeviceName statt UUID
# # # grep -v "^#" /etc/crypttab
# # system /dev/disk/by-id/ata-SAMSUNG_MZ7TE128HMGR-00000_xxxxxxxxxxxxxx-part2 none none
# # data /dev/disk/by-id/ata-KINGSTON_SV300S37A120G_xxxxxxxxxxxxxx-part1 /etc/cryptfiles/key4data luks
* wo sind die keys
# # # cryptsetup luksDump /dev/sda2 | nl -ba
# # 1 LUKS header information for /dev/sda2
# # 2
# # 3 Version: 1
# # 4 Cipher name: aes
# # 5 Cipher mode: xts-plain64
# # 6 Hash spec: sha1
# # 7 Payload offset: 4096
# # 8 MK bits: 512
# # 9 MK digest: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX f6 5e 22 08
# # 10 MK salt: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
# # 11 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
# # 12 MK iterations: 157625
# # 13 UUID: xxxxxxxx-9475-491a-b500-xxxxxxxx
# # 14
# # 15 Key Slot 0: ENABLED
# # 16 Iterations: 627450
# # 17 Salt: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
# # 18 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX
# # 19 Key material offset: 8
# # 20 AF stripes: 4000
# # ... usw
# # 33 Key Slot 3: DISABLED
# # usw ..
# # 37 Key Slot 7: DISABLED
# # #
* was koennte man mit udev machen ? - link je nach USB-Stick usw
# # UDEV regel ?
# # KERNEL=="sd[b-z][2]", SUBSYSTEMS=="usb", \
# # ATTRS{idProduct}=="0817|1000", ATTRS{idVendor}=="1f75|090c", \
# # ATTRS{removable}=="removable", \
# # GOTO="usb_crypt_rules_checkit"