Changes between Initial Version and Version 1 of Filesystem_encryption


Ignore:
Timestamp:
02/22/08 17:37:04 (16 years ago)
Author:
anonymous
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Filesystem_encryption

    v1 v1  
     1= Filesystem encryption =
     2Install software:
     3{{{
     4emerge device-mapper
     5emerge cryptsetup-luks
     6}}}
     7create the key:
     8{{{
     9tr -cd [:graph:] </dev/urandom |head -c128 > /root/myhm_sdb1_key
     10}}}
     11
     12Setup the partition
     13{{{
     14cryptsetup -v --cipher aes-cbc-essiv:sha256 --key-size 256 luksFormat /dev/sdb1 /root/myhm_sdb1_key
     15}}}
     16Answer YES[[BR]]
     17Opening the partition:
     18{{{
     19cryptsetup --key-file /root/myhm_sdb1_key luksOpen /dev/sdb1 crypt-sdb1
     20}}}
     21Create the filesystem:
     22{{{
     23/sbin/mkfs.ext3 -j /dev/mapper/crypt-sdb1
     24}}}
     25Mount the filesystem:
     26{{{
     27mkdir /mnt/sdb1
     28mount /dev/mapper/sdb1 /mnt/sdb1
     29}}}
     30
     31Adding the filesytem to /etc/conf.d/cryptfs add the following:
     32{{{
     33target=crypt-sdb1
     34source='/dev/sdb1'
     35key='/root/myhm_sdb1_key'
     36}}}
     37Adding the filesytem to /etc/fstab, add the following:
     38{{{
     39/dev/mapper/crypt-sdb1  /mnt/sdb1       auto            noauto,noatime  0 0
     40}}}
     41
     42Optional: [[BR]]
     43Encrypt the Keys using gpg:
     44{{{
     45cat <KEYFILE> | gpg --symmetric -a >./<KEYFILE>.gpg
     46}}}
     47Decrypt the Keys using gpg:
     48{{{
     49gpg --quiet --decrypt <KEYFILE>.gpg
     50}}}
     51
     52[wiki:KeySshfs Key on sshfs][[BR]]
     53
     54Additional Information:[[BR]]
     55Copy data using cpio (using the -xdev option to stay in local filesystem):
     56{{{
     57cd <SOURCE-DIR> && find ./ -xdev -print0 | cpio -pa0V <TARGET-DIR>
     58}}}
     59Copy data using tar (using the l option to stay in local filesystem):
     60{{{
     61(cd <SOURCE-DIR> >> /dev/null; tar clf - .)|(cd <TARGET-DIR> >> /dev/null; tar xvf -)
     62}}}
     63Copy data using rsync (using the x option to stay in local filesystem):
     64{{{
     65rsync -avH --progress -x <SOURCE-DIR> <TARGET-DIR>
     66}}}
     67
     68