No description
Find a file
2025-12-03 12:50:57 +01:00
debian Workaround for Ubuntu (24.04 LTS and above) and read-only mount 2025-11-20 12:02:23 +01:00
.gitignore Workaround for Ubuntu (24.04 LTS and above) and read-only mount 2025-11-20 12:02:23 +01:00
.shellcheckrc Make shellcheck happy 2022-03-28 13:31:38 +02:00
luks-keyscript Workaround for Ubuntu (24.04 LTS and above) and read-only mount 2025-11-20 12:02:23 +01:00
luks-keyscript.conf.ex Mention the required update-initramfs in config file 2022-03-11 15:40:51 +01:00
luks-keyscript.initramfs-hook Provide debian hook for initramfs (close #2) 2022-03-11 15:35:46 +01:00
Makefile Silence make 2022-03-28 12:08:45 +02:00
README.md Allow multiple targets in luks-keyscript.conf 2022-03-11 15:35:52 +01:00
zzz-getopt.ex Workaround for Ubuntu (24.04 LTS and above) and read-only mount 2025-11-20 12:02:23 +01:00
zzz-util-linux-mount.ex Workaround for Ubuntu (24.04 LTS and above) and read-only mount 2025-11-20 12:02:23 +01:00

Keyscript for luks unlocking via USB stick

This is a simple keyscript that can used to automatically open a Luks device with a key stored in a removable file system (e.g. USB stick).

Preparation

This section explains how to use an USB stick for holding the Luks passphrase. For complete and up-to-date information please consult the manpage.

  1. Create a file system on the USB stick

  2. Get the UUID of the block device containing this file system (not the file system UUID, but the UUID of the block device!)

  3. Create the Luks key on this filesystem (e.g. with file name key)

    head -c 128 </dev/random > .../key
    
  4. Create a config file /etc/luks-keyscript.conf

    # configuration for luks-keyscript
    # Format
    # target: settings
    #         where settings are key=value pairs for
    #         - dev: device description (e.g. "UUID=abcd-efgh" or "LABEL=xyz")
    #                for the *block* device containing the filesystem and file
    #         - fs: file type on the above mentioned block device (e.g. "ext4")
    #         - file: file name relativ to the root of the above file system
    #ex: md1_crypt dev=UUID=c2720d9f-53d0-4150-94d8-0a55e4d212d0 fs=ext4 file=key
    
  5. Edit the /etc/crypttab accordingly:

    <TARGET> <SOURCE> none keyscript=/usr/bin/luks-keyscript,luks,discard
    
  6. Re-Create the initrd.