Results 1 to 3 of 3

Thread: LUKS/dm-crypt auto-mount with USB key

  1. #1
    Only@Hexus! watercooled's Avatar
    Join Date
    Jan 2009
    Posts
    7,381
    Thanks
    1,245
    Thanked
    560 times in 495 posts

    LUKS/dm-crypt auto-mount with USB key

    Right, so I've been playing with LUKS and I'm working towards setting up a system similar to Bitlocker where you can use a USB key to store a keyfile and have the system mount an encrypted data partition automatically at boot (for a headless system). Easier said than done...

    I have no problem setting up an encrypted volume and mounting it but I'm having trouble thinking of an elegant way to automate the process at boot time. I've found a few guides on the net for mounting root partitions but, well, they're not perfect to start with and they seem over-complicated for a data partition i.e. mod-probing drivers and modifying initramfs - for a pure storage partition it should be as simple as checking for, temporarily mounting, and pulling the keyfile from the flash drive and maybe prompting for a password if that fails.

    Does anyone have any advice or know of a decent guide to follow?

    Thanks.

  2. #2
    Admin Team peterb's Avatar
    Join Date
    Aug 2005
    Location
    Southampton
    Posts
    11,185
    Thanks
    1,095
    Thanked
    1,586 times in 1,261 posts
    • peterb's system
      • Motherboard:
      • Nascom 2
      • CPU:
      • Z80B
      • Memory:
      • 48K 8 bit memory on separate card
      • Storage:
      • Audio cassette tape - home built 5.25" floppy drive
      • Graphics card(s):
      • text output (composite video)
      • PSU:
      • Home built
      • Case:
      • Home built
      • Operating System:
      • Nas-sys
      • Monitor(s):
      • 12" monocrome composite video input
      • Internet:
      • No networking capability on this machine

    Re: LUKS/dm-crypt auto-mount with USB key

    Add an entry in fstab?

    If you want it to conditionally prompt for a password though you will probably need to do a bit of script writing. Otherwise follow the guides. Rebuilding intramfs isn't that difficult although a bit daunting first time round (especially at reboot time with it the first time - will it work? )
    (\__/)
    (='.'=)
    (")_(")
    Useful Information about HEXUS

  3. #3
    Only@Hexus! watercooled's Avatar
    Join Date
    Jan 2009
    Posts
    7,381
    Thanks
    1,245
    Thanked
    560 times in 495 posts

    Re: LUKS/dm-crypt auto-mount with USB key

    Yeah the bit that's worrying me is that it needs to mount the mapped drive after the system has booted and the drive has been mapped (unlocked) but before anything dependant on the data drive is started (services for instance).

    The guides I've tried so far seem to be missing quite important steps - writing a guide but assuming people reading it already know what they're doing is a bit stupid IMO. I've found a few more though so I'll have another go when I get some time, the script seems to be the bit I'm stuck with though - I can get a script to ask for a password but getting one to modprobe the correct drivers, intelligently check for a specific drive, mount it, check for specific data then feed it to the program, and then unmount the drive, is another story.

    I'm trying this out on a spare 'tinkering' system before I put it in to production. I just kind of assumed there would be a more turnkey way of doing it like Bitlocker on Windows - I mean I know it's not the best security practice but entering a password every boot isn't a viable option for a headless server; plugging a USB drive in for a while when I reboot isn't a problem.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. P5K Premium / 8GB RAM
    By rwm63 in forum Help! Quick Relief From Tech Headaches
    Replies: 17
    Last Post: 18-06-2008, 12:14 PM
  2. No auto insert with usb card readers
    By madman045 in forum Help! Quick Relief From Tech Headaches
    Replies: 1
    Last Post: 22-12-2006, 12:06 AM
  3. auto key strokes!!!
    By pintpot in forum Help! Quick Relief From Tech Headaches
    Replies: 4
    Last Post: 25-03-2006, 07:16 PM
  4. Replies: 1
    Last Post: 31-03-2005, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •