LinuxQuestions.org
Help answer threads with 0 replies.
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 10-25-2008, 11:42 PM   #1
prabhatsoni
Member
 
Registered: Oct 2004
Location: India
Distribution: FC 12
Posts: 233

Rep: Reputation: 30
How does go about creating encrypted files systems


Hello folks,

How does one go about creating encrypted file system, so that when it is accessed it asks for a password. I under stand this is possible to create an encrypted VFAT ( windows) file system .
I will elaborate. I have a laptop and also one portable USB hard disk. The data is sensitive, and if the laptop or the portable hard disk is lost, others may have access to all my personal information, business information etc. Therefore the encrypted hard disk.

Thanks in advance.

Prabhat Soni
 
Old 10-26-2008, 02:04 AM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,941

Rep: Reputation: 137Reputation: 137
My Linux filesystems are encrypted with LUKS - Linux Unified Key Setup
 
Old 10-27-2008, 12:55 AM   #3
prabhatsoni
Member
 
Registered: Oct 2004
Location: India
Distribution: FC 12
Posts: 233

Original Poster
Rep: Reputation: 30
Thanks a lot sir,
I created a encrypted ext3 file system on my USB flash disk, and it worked perfectly.

To help others I am listing the steps:

(1) Step -1
# dd if=/dev/urandom of=/dev/sdc
This fills up the pen drive with the random data. Not necessary. But it enables good security.
(2) Step -2
# fdisk /dev/sdc
Create file system. I created a single partition on the pen drive.
(3) Step -3
# cryptsetup -v -y luksFormat /dev/sdc1
To format a luks (encrypted) device. It will ask for the password.
(4) Step -4
# cryptset luksOpen /dev/sdc1 sdc1
This will again ask for the same luks password. It will map the physical (encrypted) partition (/dev/sdc1) to the logical (unencrypted) device sdc1. After this the mapped device ( logical device) will be available as /dev/mapper/sdc1. Now a file system is made on this logical device. In fact now it is like any ordinary partition over which file system can be made and later mounted.

(5) Step -5
# mkfs.ext3 -j -L usbdisk -m 1 -O dir_index,filetype,sparse_super /dev/mapper/sdc1
This will create a journaling file system, with volume lebel as "usbdisk".
(6) Step -6
# mount /dev/mapper/sdc1 /mnt/sdc1

In future:
for mounting:
# cryptset luksOpen /dev/sdc1 sdc1
# mount /dev/mapper/sdc1 /mnt/sdc1

and for unmounting:
# umount /mnt/sdc1
# cryptsetup luksClose sdc1

But surprisingly this explicit mounting and unmounting is not required in future. When you insert the drive it automatically asks for a password. With the correct password the drive is automatically mounted (not at /mnt/sdc1 but at /media/usbdisk). Same is the case while umnounting.


prabhat Soni
 
Old 10-27-2008, 01:05 AM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Gentoo on headless; Arch on everything that requires a GUI
Posts: 6,941

Rep: Reputation: 137Reputation: 137
prabhat Soni,

Thanks for posting your HOW-TO. I didn't mention anything
about setting it up, because I use Slackware and am not
familiar with FC.

Maybe you should write it and post in the Linux Tutorials section.
 
  


Reply


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
Encrypted file systems hamish Linux - Enterprise 2 02-15-2005 12:41 PM
Question Re Encrypted File Systems TruckStuff Linux - Security 1 01-30-2005 07:13 PM
Encrypted File Systems sovietpower Linux - Security 3 08-28-2004 03:49 AM
Encrypted file systems? jbeedham Linux - Security 4 07-06-2004 12:19 PM
creating encrypted passwords kidwired Linux - Security 3 01-12-2003 04:34 PM

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

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