LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-26-2013, 03:06 PM   #1
kristenbb
LQ Newbie
 
Registered: May 2013
Posts: 6

Rep: Reputation: Disabled
How to decrypt home folder?


hi,

how can I access my encrypted home from a live cd ? I tried mounting the system (and binding proc, sys and dev) and then chrooting into it, but when I 'su kristenbb', it says: 'open: permission denied. error locking counter'. How to avoid that ?

thx
 
Old 05-26-2013, 03:54 PM   #2
Nikosis
Member
 
Registered: Dec 2005
Location: In front of the monitor
Distribution: Slackware
Posts: 322

Rep: Reputation: 59
Welcome to LQ.
What did you do to open it, you need to be more specific.

install lvm2:

Quote:
apt-get install lvm2
Scan all disks for physical volumes:

Quote:
pvscan
Scan all disks for volume groups:

Quote:
vgscan
Activate all volume groups:

Quote:
vgchange -a y
Scan all disks for logical volumes:

Quote:
lvscan
This will give you the path to your activated lable. Something similar to this ‘/dev/VolGroup00/LogVol00′.

Mount the partition:

Quote:
mount /dev/VolGroup00/LogVol00 /mnt
Now you can access the partition at /mnt and work with the data on your hard drive.

Source
 
Old 05-26-2013, 04:04 PM   #3
annonyxxxx
Member
 
Registered: May 2013
Posts: 31

Rep: Reputation: 9
Assuming you are using cryptsetup, you can type this as root from the liveCD

cryptsetup luksOpen /dev/sdxx myhome

sdxx is the drive/partition where your home partition resides. myhome could be any name you want. it's used here as an example.

Enter your passphrase. If done successfully you should get no error messages

Next, mount the device

mount /dev/mapper/myhome /mnt

Last edited by annonyxxxx; 05-26-2013 at 04:11 PM.
 
1 members found this post helpful.
Old 05-26-2013, 04:21 PM   #4
Nikosis
Member
 
Registered: Dec 2005
Location: In front of the monitor
Distribution: Slackware
Posts: 322

Rep: Reputation: 59
Quote:
Originally Posted by annonyxxxx View Post
Assuming you are using cryptsetup, you can type this as root from the liveCD

cryptsetup luksOpen /dev/sdxx myhome

sdxx is the drive/partition where your home partition resides. myhome could be any name you want. it's used here as an example.

Enter your passphrase. If done successfully you should get no error messages

Next, mount the device

mount /dev/mapper/myhome /mnt
Yep, I missed that part, that's first thing you need to do, then if you have LVM follow the steps from my previous post.
 
Old 05-26-2013, 06:24 PM   #5
kristenbb
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
If by using cryptsetup, you mean that I have full disk encryption, then the answer is no, I just have home encryption, which I set up using ubuntu 13.04.
And I don't think I have LVM.
 
Old 05-26-2013, 07:29 PM   #6
Nikosis
Member
 
Registered: Dec 2005
Location: In front of the monitor
Distribution: Slackware
Posts: 322

Rep: Reputation: 59
Quote:
Originally Posted by kristenbb View Post
If by using cryptsetup, you mean that I have full disk encryption, then the answer is no, I just have home encryption, which I set up using ubuntu 13.04.
And I don't think I have LVM.
Then
Code:
cryptsetup luksOpen /dev/sdxx myhome
will do it.

After that just mount it, as annonyxxxx mention in his post
Code:
mount /dev/mapper/myhome /mnt/xxx
Also, you don't need to bind it with anything.

Last edited by Nikosis; 05-26-2013 at 07:38 PM.
 
Old 05-27-2013, 02:25 PM   #7
kristenbb
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
No this doesn't work, sorry. sudo "cryptsetup luksOpen /dev/sda2 myhome" (and I'm sure it's sda2, I've checked with gparted) returns Device /dev/sda2 is not a valid LUKS device.

I think cryptsetup is not what ubuntu uses to encrypt the home folder. It is rather ecryptfs. But for ecryptfs to work, I need to be able to chroot into the system from the live cd, and this doesn't seem to work, as I've said in my original post.
 
Old 05-27-2013, 02:35 PM   #8
Janus_Hyperion
Member
 
Registered: Mar 2011
Location: /
Distribution: Fedora (typically latest release or development release)
Posts: 372

Rep: Reputation: Disabled
May be this then from the Ubuntu docs -

https://help.ubuntu.com/community/En..._Data_Manually

If you see in the page, I have linked there is more information regarding data recovery from the encrypted home directory which might also be useful in your case.

Last edited by Janus_Hyperion; 05-27-2013 at 02:37 PM.
 
Old 05-27-2013, 03:04 PM   #9
Nikosis
Member
 
Registered: Dec 2005
Location: In front of the monitor
Distribution: Slackware
Posts: 322

Rep: Reputation: 59
Quote:
Originally Posted by kristenbb View Post
No this doesn't work, sorry. sudo "cryptsetup luksOpen /dev/sda2 myhome" (and I'm sure it's sda2, I've checked with gparted) returns Device /dev/sda2 is not a valid LUKS device.

I think cryptsetup is not what ubuntu uses to encrypt the home folder. It is rather ecryptfs. But for ecryptfs to work, I need to be able to chroot into the system from the live cd, and this doesn't seem to work, as I've said in my original post.
Yes you might be right, I just assumed it uses cryptsetup, since it's based on Debian.
 
Old 05-27-2013, 03:23 PM   #10
kristenbb
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
So what it is that I'm supposed to do actually ? I'm not an expert, just a regular user, and this is all a bit over my head. I'd just like to be able to access my home folder from a live cd, in case my system ever fails.
 
Old 05-27-2013, 03:28 PM   #11
Janus_Hyperion
Member
 
Registered: Mar 2011
Location: /
Distribution: Fedora (typically latest release or development release)
Posts: 372

Rep: Reputation: Disabled
From the link I posted above, try this -

Quote:
Originally Posted by Ubuntu Docs

Use ecryptfs-recover-private

boot the target system using an Ubuntu 11.04 Desktop LiveCD
make sure that your target system's hard drive is mounted
open a terminal
run 'sudo ecryptfs-recover-private'
follow the prompts
access your decrypted data and save somewhere else
 
Old 05-28-2013, 01:35 AM   #12
kristenbb
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
Yes, this works, thank you. But this makes the accessible data read only, and my need is actually to restore an old home folder. I wasn't able to do it from the running system, because some files where in use, so I'd like to do it from the live cd, but if I use the command above, I only have read access to the files. How can I get write access too ?
 
Old 05-28-2013, 01:18 PM   #13
kristenbb
LQ Newbie
 
Registered: May 2013
Posts: 6

Original Poster
Rep: Reputation: Disabled
So how to make it writable ? I'd just like to reuse my old home folder...
 
Old 05-28-2013, 01:33 PM   #14
Janus_Hyperion
Member
 
Registered: Mar 2011
Location: /
Distribution: Fedora (typically latest release or development release)
Posts: 372

Rep: Reputation: Disabled
I would suggest copying the contents to new user home directory so that there are no issues with permissions. I am not sure if this is the best way though.

See this link.

It is the same as above but I have specifically linked to topic about Live CD and might provide some help.

Hope that helps.
 
  


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
xterm does not open in home folder, instead opens in Documents folder hsiu Linux - Desktop 5 01-16-2011 08:35 AM
mixed mounting of automount and fstab in one folder? &different home folder using NIS herofmm Linux - Software 0 04-06-2009 11:00 AM
Home folder icon does not open home folder CiscoGeek Linux - Newbie 3 12-18-2006 07:00 AM
I can not open the user folder in home and write in a shared folder jorge_ivan Linux - General 8 08-02-2006 11:28 AM
Folder Max Size and Limiting SSH access to home folder. Mefistofeles Linux - General 4 11-26-2005 02:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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