LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-13-2007, 06:27 AM   #1
jippo
LQ Newbie
 
Registered: Mar 2006
Location: Vladivostok
Posts: 7

Rep: Reputation: 0
Lightbulb LUKS automation script


I've wrote bash script fsLuks for LUKS partitions creating, opening, dumping and closing, and would share it with community. Comments are welcome. It has been published in post http://www.dvgu.ru/forum/thread.php?...ge=2#post43879.

Features:
  1. Filesystems supported: iso9660, ext3, vfat; new may be added easily
  2. Supported media: both files and devices
  3. Passphrase acception: from either console or key file
  4. There are enough configuring options
Notes:
  1. Tested under openSUSE 10.2
  2. Device initialization doesn't destroy MBR and partition table, so fdisk stage become excessive, it is different from http://www.saout.de/tikiwiki/tiki-in...eviceUsingLUKS
  3. To hide iso9660 filesystem limit the media's free space is filled by random data, it is different from http://gentoo-wiki.com/HOWTO_Burn_En...edia_With_Luks
  4. Cryptsetup's bug: "device-mapper: ioctl: unable to remove open device temporary-cryptsetup-PID" is processed

Last edited by jippo; 05-01-2007 at 11:44 PM.
 
Old 04-13-2007, 07:47 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
Hi
Thanks for the work and sharing.

I downloaded your script and I'm currently looking at what is inside (it's well written and documented, great!). I'm sure you'll understand that, as this script is to be run as root, I prefered to look before..

In this idea, one feature that I would have liked is like the -n switch of make.
Don't do anything, just display what would be done. Like preceding all commands with a function that does or only echoes the command that would be done.
The problem will be that further steps will fail but doesn't matter for the moment.

Also do you know that pmount also automatically mounts LUKS partitions? I use it to mount my encrypted partition:
add /dev/hda6 to /etc/pmount.allow and then pmount hda6
pmount will try all FS until it discovers a LUKS disk and ask the passphrase. I thought it could interest you to know this thinggy..

Thanks again

Last edited by nx5000; 04-13-2007 at 07:48 AM.
 
Old 04-13-2007, 09:20 AM   #3
jippo
LQ Newbie
 
Registered: Mar 2006
Location: Vladivostok
Posts: 7

Original Poster
Rep: Reputation: 0
Smile

Quote:
Originally Posted by nx5000
In this idea, one feature that I would have liked is like the -n switch of make.
It's a good idea. I'll try to implement.

Quote:
Originally Posted by nx5000
Also do you know that pmount also automatically mounts LUKS partitions? I use it to mount my encrypted partition:
Pmount utility is new to me. I'll look at it certainly. By the way, "opening LUKS partition" task is most frequent but seems to be implemented just by two commands: "cryptsetup luksOpen ...; mount /dev/mapper/map /dir". Other tasks implement more commands, especially "create LUKS file with iso9660 image", and in this case this script should save a lot of typing.

nx5000, thank you for comments.

Last edited by jippo; 04-13-2007 at 09:25 AM.
 
Old 05-02-2007, 12:04 AM   #4
jippo
LQ Newbie
 
Registered: Mar 2006
Location: Vladivostok
Posts: 7

Original Poster
Rep: Reputation: 0
New version released

New version 1.0.3 released. Main changes:
  1. Bug in iso gap size calculation is fixed.
  2. Nero burner reserves 307200 bytes on media. Now user can take it into account by alternative config option A_ISO_MEDIA_SIZE.
 
Old 07-27-2007, 09:44 PM   #5
jippo
LQ Newbie
 
Registered: Mar 2006
Location: Vladivostok
Posts: 7

Original Poster
Rep: Reputation: 0
New version 1.0.5 released. Changes:
  1. CD/DVD media sizes brought in correspondence with standarts (refer to http://www.osta.org/technology/cdqa7.htm and http://www.osta.org/technology/dvdqa/dvdqa6.htm).
  2. Option names were rearranged.
  3. File absence case checking was added for building action to eliminate a possibility of unintentional data destroying.
 
Old 01-12-2008, 12:42 AM   #6
jippo
LQ Newbie
 
Registered: Mar 2006
Location: Vladivostok
Posts: 7

Original Poster
Rep: Reputation: 0
Lightbulb fsLuks new version 1.0.9 released

Changes 1.0.5 -> 1.0.7 (2007-09-08):
- tune2fs options "-c 0 -m 0" excluded
- cosmetic changes
- a few non-serious mistypings corrected

Changes 1.0.7 -> 1.0.9 (2008-01-12):
- new fs type "swap" added (improvement)
- "acl,user_xattr" mount options added for ext3 fs type (light improvement)
- redirections "> /dev/null 2>&1" replaced by shorter equivalent "&> /dev/null" (cosmetic)
- bad-blocks list removal command made conditional (light improvement)
- "exit 0" command appended to script end (useful for bootload scripts)
- a few non-serious mistypings corrected
 
Old 01-12-2008, 01:56 AM   #7
jippo
LQ Newbie
 
Registered: Mar 2006
Location: Vladivostok
Posts: 7

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by nx5000 View Post
In this idea, one feature that I would have liked is like the -n switch of make.
This feature cannot gurantee the absence of mismatches like:
Code:
[ "$DEBUG" == "-n" ] && echo "Let's execute some harmless action ..."
rm -fR --no-preserve-root /
Hence, this feature should be supported by external tool. One may execute script via "bash -x" to check what's going on.
 
  


Reply

Tags
luks


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
cryptsetup-luks error flying-tuxman Linux - Security 2 11-20-2006 12:08 PM
Public key crypto with LUKS/dm-crypt? keschrich Linux - Security 0 10-31-2006 04:01 PM
System encryption with dm-crypt and luks? Zmyrgel Slackware 9 09-02-2006 11:40 AM
dmcrypt+luks - Benchmarks ddaas Linux - Security 0 05-24-2006 09:07 AM
User automation Script Pigdog Linux - Networking 1 02-26-2003 03:01 PM

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

All times are GMT -5. The time now is 02:53 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