LUKS
Skript
Skript welches das LUKS Passwort auf mehreren USB-Sticks sucht.
/etc/cryptkey/keyscripts.sh
#!/bin/sh # by neobiker (2020-04) # KEYDEVICE_MODULES="usb_storage" # list where LUKS looks for keys (the 1.st found will be taken by keyscript.sh) # as listed in /dev/disk/by-id/ key1=/dev/disk/by-id/usb-FSC_Memorybird_P_10003446F7000109-0:0 key2=/dev/disk/by-id/usb-LEXAR_DIGITAL_FILM_0301190000000297886800000000000-0:0 key3= key4= key5= key6= key7= key8= KEYDEVICES="$key1 $key2 $key3 $key4 $key5 $key6 $key7 $key8" KEYDEVICE_BLOCKSIZE="512" KEYDEVICE_SKIPBLOCKS="1" KEYDEVICE_READBLOCKS="4" for module in $KEYDEVICE_MODULES; do cat /proc/modules | grep -q $module && continue modprobe $module >/dev/null 2>&1 sleep 3 done keynr=-1 for KEYDEVICE in $KEYDEVICES; do if [ -e $KEYDEVICE ]; then keynr=$(( $keynr + 1 )) if [ "0$CRYPTTAB_TRIED" -gt "$keynr" ]; then echo "CryptKeydevice NO_KEY: $KEYDEVICE" >&2 continue fi dd if=$KEYDEVICE bs=$KEYDEVICE_BLOCKSIZE skip=$KEYDEVICE_SKIPBLOCKS count=$KEYDEVICE_READBLOCKS 2>/dev/null && break fi done