LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 09-23-2004, 03:22 PM   #1
Bd22
LQ Newbie
 
Registered: Jun 2003
Distribution: Debian, Freebsd
Posts: 15

Rep: Reputation: 0
setting up dm-crypt


How do u turn on dm-crypt and set it up to encrypt all partitons
 
Old 09-23-2004, 07:29 PM   #2
qwijibow
LQ Guru
 
Registered: Apr 2003
Location: nottingham england
Distribution: Gentoo
Posts: 2,672

Rep: Reputation: 47
first of all..... nope.... you cannot encrytp the boot partiton.... but why would you want to ?
also, encrypting the root partiton IS possible.... but again.. why would you want to ?

you only need to encrypt the Home folder...

there are 2 ways of doing this depending on wether or not the hme directory IS or IS NOT on its own partiton..

if the home directory is on its own partiton... then somthing like the following would work...

Code:
#Log in as root
#un-mount the home partiton
umount /home
#create en encrypted device map called 'ehome'
#replace /dev/hda3 with the location of your home partiton.
cryptsetup -c aes -h ripemd160 -b `blockdev --getsize /dev/hda3` create ehome /dev/hda3
#format the encrypted device map
mkreiserfs /dev/mapper/ehome
# or mkfs.ext3 /dev/mapper/ehome for ext3 filesystem
#now mount the encrypted home directory
mount /dev/mapper/ehome /home
if your home directory is NOT on its own partiton... then the following
Code:
#Log in as root
#un-mount the home partiton
umount /home
#create a pretend partiton.
#replace 1024 with the size of the required home directory in mega bytes
dd if=/dev/urandom of=/EHOME bs=1M count=1024
#create a loopback device pointing to the rpetend partiton
losetup /dev/loop1 /EHOME
#create an encrypted device map
cryptsetup -c aes -h ripemd160 -b `blockdev --getsize /dev/loop1` create ehome /dev/loop1
#format....
#format the encrypted device map
mkreiserfs /dev/mapper/ehome
# or mkfs.ext3 /dev/mapper/ehome for ext3 filesystem
#now mount the encrypted home directory
mount /dev/mapper/ehome /home
this is just to initiate the home diectory.... next time you boot.. before you login, you will need to only mount the partiton... not format it or anything else....

just the cryptsetup, losetup and mount commands.

for this to work... you must have the following kernel modules loaded...."dm-crypt" "loop" "aes"
and have the program "cryptsetup" installed.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
No Crypt AMMullan Linux - Software 4 08-08-2007 03:48 AM
dm-crypt rino.caldelli Linux - Security 1 07-28-2005 12:46 PM
Turning on dm-crypt and setting it up Bd22 Debian 1 09-25-2004 03:46 AM
Crypt help liguorir Linux - Security 2 05-11-2004 09:44 AM
crypt IBP Linux - Software 3 03-03-2003 05:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 04:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration