Ive tried to unlock my encrypted root with a keyfile on a USB but i cant seem to get an understanding of how to do it on OpenSUSE.
And i cant find any explanations of anyone who have unlocked encrypted root with USB keyfile on OpenSUSE.
It unlocks fine with nomal password on boot but i would like to be able to just put in a USB key and unlock LUKS root with the keyfile put on there.
On Kubuntu/LinuxMint i could get it to work by the help of https://github.com/chadoe/luks-triple-unlock
I know that there scripts is meant for Ubuntu/Debian/Mint. But i tried inserting the the keyfile for the luks volume and added the information in crypttab myself. But it wont find the keyfile. Here is how my system looks followed by my different crypttab attempts.
My system lsblk looks like this
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 1G 0 part
├─sda2 8:2 0 25G 0 part
│ └─md0 9:0 0 50G 0 raid0
├─sda3 8:3 0 1G 0 part /boot
└─sda4 8:4 0 23G 0 part
└─md1 9:1 0 46G 0 raid0
└─OpenSUSECrypt 254:0 0 46G 0 crypt
├─OpenSUSE-lvroot 254:1 0 20G 0 lvm /
├─OpenSUSE-lvhome 254:2 0 20G 0 lvm /home
└─OpenSUSE-lvswap 254:3 0 6G 0 lvm [SWAP]
sdb 8:16 0 50G 0 disk
├─sdb1 8:17 0 1G 0 part
├─sdb2 8:18 0 25G 0 part
│ └─md0 9:0 0 50G 0 raid0
├─sdb3 8:19 0 1G 0 part
└─sdb4 8:20 0 23G 0 part
└─md1 9:1 0 46G 0 raid0
└─OpenSUSECrypt 254:0 0 46G 0 crypt
├─OpenSUSE-lvroot 254:1 0 20G 0 lvm /
├─OpenSUSE-lvhome 254:2 0 20G 0 lvm /home
└─OpenSUSE-lvswap 254:3 0 6G 0 lvm [SWAP]
sdc 8:32 0 7.5G 0 disk
├─sdc1 8:33 0 3.7G 0 part /mnt
└─sdc2 8:34 0 3.7G 0 part
sr0 11:0 1 613.5M 0 rom
Where sdc1 contains the keyfile and is NTFS
and sdc1 allso contains the keyfile and is Ext4
Ive tried several versions of crypttab first where i try to load the same script (crypto-usb-key.sh) as on Kubuntu/Debian/LinuxMint
This one works on Kubuntu/Debian/Mint
OpenSUSECrypt UUID=(my UUID for the device) crypt_keyfile.bin luks,keyscript=/usr/local/sbin/crypto-usb-key.sh
The crypto-usb-key.sh script looks like this on github
https://github.com/chadoe/luks-triple-unlock/blob/master/crypto-usb-key.sh
and with another try on loading keyfile i did on NTFS
OpenSUSECrypt UUID=(my UUID for the device) /dev/disk/by-label/SECURIKEY:/crypt_keyfile.bin luks,keyscript=keyscript=/lib/cryptsetup/scripts/passdev
and on a Ext4
OpenSUSECrypt UUID=(my UUID for the device) /dev/disk/by-label/SECURIKEYEXT4:/crypt_keyfile.bin luks,keyscript=keyscript=/lib/cryptsetup/scripts/passdev
I find dracut very confusing and cant figure out how to make an mkinitrd that loads a keyfile from a USB and unlock the LUKS encrypted root on boot.
I hope anyone out there can help me and will happely add more information if needed.
Best Regards and thank you for your time
Darkyere