Wednesday, June 22, 2011

Encrypted Filesystem using Luks

This is a simple demostration of encrypting filesystem using luks

1. cryptsetup luksFormat /dev/sdb1

2. cryptsetup luksOpen /dev/sdb1 lukstest
    this will create /dev/mapper/lukstest

3.edit /etc/crypttab
    lukstest /dev/sdb1 none luks
Note: in Michael Jang's 6th edition book, it was not mentioned in chapter 6 to create /etc/crypttab file but it was included in the Lab exam answers. Without this file, system will not ask password when rebooted.

4. mkfs.ext4 /dev/mapper/lukstest

5. add an entry in /etc/fstab
   /dev/mapper/lukstest /mnt/lukstest ext4 defaults 0 0

6. reboot the system, it should prompt for password to mount /mnt/lukstest

No comments:

Post a Comment