Friday, March 11, 2016

encrypt your harddisk with cryptsetup

cryptsetup can setup dm-crypt managed device-mapper mappings include dm-crypt volumes and  LUKS (Linux Unified Key Setup).

1- installation
$ sudo apt-get install cryptsetup

2- encrypt your second disk /dev/sdb, type YES when asked to confirm and type your passphrase
$ sudo cryptsetup luksFormat /dev/sdb

3- open the luks volume, when asked for passphrase type the one you typed in the above step
$ cryptsetup luksOpen /dev/sdb encDisk

4- for the first time you have to format file system to the disk, and the second no need to repeat this step
$ sudo mkfs.ext4 /dev/mapper/encDisk

5- now you can mount the disk to any mount point and start using as normal disk
$ sudo mount /dev/mapper/encDisk /mnt

so now, no one can access your hard disk unless they have the password

No comments:

Post a Comment