LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 02-03-2007, 05:20 PM   #1
NordiC
LQ Newbie
 
Registered: Oct 2006
Posts: 6

Rep: Reputation: 0
mount multiple dm-crypt disks


I have encrypted all my 'archive' disks with dm-crypt. But i got a small 'problem'. Every time i reboot the server, i need to write the password for every single drive i mount. And.. it's 12 disks. Anyone now if there's any nice script/application, that i can config, so i only need to execute it when im logged in and write the password ONCE.

have googled and searched the forum, but havent found anything useful.
and no, i dont want to use a usb stick and have a key file on it.

thx in advance!

Last edited by NordiC; 02-03-2007 at 05:22 PM.
 
Old 02-07-2007, 03:42 AM   #2
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,629

Rep: Reputation: Disabled
I don't understand. You always need all 12 partitions / drives? Why don't you comment them out in /etc/fstab and just mount what you need when you need it?
 
Old 02-07-2007, 06:16 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Well... its one key for each disks. In your case you put the same for each disks so its not the default behaviour.
A method would be to:
Early-mount an encrypted disk => you have to give its key.
In this partition (usbkey, whatever) lies the key for the 12 (or 11 disks if you don't have anyother. It can be kept as a file.
Then the second phase would decrypt the remaining partitions using this file as a key.

cryptsetup works in 2 phases for this purpose, which is pretty standard.
Try to have a look at manpages for cryptsetup, /etc/crypttab.
Also /etc/init.d/cryptdisks and /etc/init.d/cryptdisks-early.
These files are from a package called cryptsetup which is a higher application to handle this easier.

Ah what I say probably only works for LUKS encryption.

An other example
# Encrypted luks disk with a openssl-encrypted keyfile, replace with USB Stick
#cdisk4 /dev/hda2 /mnt/hda3/keyfile luks,ssl

cdisk4 will be decrypted using /mnt/hda3/keyfile.
/mnt/hda3/keyfile is the encrypted key file. You provide the password for decoding the key file only. /mnt/hda3 can be your /root or whatever, it just has to be mounted before dm-crypt tries to mount the 12 partitions.

Hope its more or less clear

Last edited by nx5000; 02-07-2007 at 06:19 AM.
 
Old 02-08-2007, 09:54 AM   #4
NordiC
LQ Newbie
 
Registered: Oct 2006
Posts: 6

Original Poster
Rep: Reputation: 0
thanks nx5000! that was a really good idea
only one 'problem'. if we say i do like you said, the decrypt key will be unprotected when that drive is mounted. I thought about a simple script kinda (im not good enough to write one myself), i execute it, write the password and then it unlocks and mount all disks. Like saving the password temporary under the process in cache while unlocking disks. Anyways ill use your proposal, if nobody got an better idea. Thanks again

Quote:
Originally Posted by JZL240I-U
I don't understand. You always need all 12 partitions / drives? Why don't you comment them out in /etc/fstab and just mount what you need when you need it?

cause other people than me browse files from it, and i dont wanna give em ssh access and decrypt password

Last edited by NordiC; 02-08-2007 at 09:56 AM.
 
Old 02-08-2007, 11:19 AM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
You're welcome !
For your question, re-read again

#Encrypted luks disk with a openssl-encrypted keyfile, replace with USB Stick

The key is encrypted (and put on an un-encrypted partition eg /root otherwise its a pain and redundant)
/root/keyfile

To decrypt it, you will have to give the open-ssl password.

When this key is decoded, it will be used for decrypting the 12 partitions.

This "method" is used in some companies that need a high level of security:
They have an encrypted key (with a _very_ strong algorithm) on a usb stick (the stick is only used for this).
They are prompted for a password for decrypting the key and this key is used to reach the company by VPN-DSL.

Have fun but don't loose the password

edit:
actually you would need to also have an encrypted swap otherwise it may leak. Depends on your level of paranoia and if the swap is already mounted (probably check in cryptsetup). Then put the machine in a bunker, 300 feets under the ground

Last edited by nx5000; 02-08-2007 at 11:21 AM.
 
Old 02-09-2007, 05:50 AM   #6
NordiC
LQ Newbie
 
Registered: Oct 2006
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nx5000
You're welcome !
For your question, re-read again

#Encrypted luks disk with a openssl-encrypted keyfile, replace with USB Stick

The key is encrypted (and put on an un-encrypted partition eg /root otherwise its a pain and redundant)
/root/keyfile

To decrypt it, you will have to give the open-ssl password.

When this key is decoded, it will be used for decrypting the 12 partitions.

This "method" is used in some companies that need a high level of security:
They have an encrypted key (with a _very_ strong algorithm) on a usb stick (the stick is only used for this).
They are prompted for a password for decrypting the key and this key is used to reach the company by VPN-DSL.

Have fun but don't loose the password

edit:
actually you would need to also have an encrypted swap otherwise it may leak. Depends on your level of paranoia and if the swap is already mounted (probably check in cryptsetup). Then put the machine in a bunker, 300 feets under the ground

thanks again
 
  


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
dm-crypt, USB and umount/mount carcassonne Linux - Security 3 07-24-2006 10:35 PM
Hald-subfs-mount Unmounts Usb Disks Directly After Mount dop SUSE / openSUSE 0 03-16-2006 10:58 AM
Cannot detect multiple firewire disks kev66 Linux - Hardware 0 02-08-2006 12:54 AM
Need an advice for: Multiple Disks&Multiple Penguins and a XP :) thesappho Linux - Newbie 1 12-15-2003 03:13 PM
Dealing with multiple disks - 8.1 ashw Slackware 1 01-28-2003 06:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:22 PM.

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