Sign in to follow this  
Followers 0

HPR - HPR2791: LUKS like truecrypt

1 post in this topic

Create an empty file of a predetermined size:

$ fallocate --length 512M foo.img

Create a LUKS container on it:

$ cryptsetup --verify-passphrase luksFormat foo.img

Set it up:

$ sudo cryptsetup luksOpen foo.img foo
$ ls /dev/mapper

Make a file system on it:

$ sudo mkfs.ext2 /dev/mapper/foo

If you don't need it for anything now, you can close it:

$ sudo cryptsetup luksClose foo
$ ls /dev/mapper

Mount it as a usable filesystem:

$ sudo mkdir /crypt
$ sudo mount /dev/mapper/foo /crypt

Depending on your system configuration, you may need to set up reasonable permissions:

$ sudo mkdir /crypt/mystuff
$ sudo chown klaatu:users /crypt/mystuff
$ sudo chmod 770 /crypt/mystuff
$ echo "hello world" >> /crypt/mystuff/file.txt

When you're finished using your encrypted vault, unmount and close it:

$ sudo umount /crypt
$ sudo cryptsetup luksClose foo

View the full article


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  
Followers 0