LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to decrypt home folder? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-decrypt-home-folder-4175463514/)

kristenbb 05-26-2013 03:06 PM

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

Nikosis 05-26-2013 03:54 PM

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

annonyxxxx 05-26-2013 04:04 PM

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

Nikosis 05-26-2013 04:21 PM

Quote:

Originally Posted by annonyxxxx (Post 4959416)
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.

kristenbb 05-26-2013 06:24 PM

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.

Nikosis 05-26-2013 07:29 PM

Quote:

Originally Posted by kristenbb (Post 4959477)
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.

kristenbb 05-27-2013 02:25 PM

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.

Janus_Hyperion 05-27-2013 02:35 PM

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.

Nikosis 05-27-2013 03:04 PM

Quote:

Originally Posted by kristenbb (Post 4960046)
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.

kristenbb 05-27-2013 03:23 PM

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.

Janus_Hyperion 05-27-2013 03:28 PM

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


kristenbb 05-28-2013 01:35 AM

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 ?

kristenbb 05-28-2013 01:18 PM

So how to make it writable ? I'd just like to reuse my old home folder...

Janus_Hyperion 05-28-2013 01:33 PM

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.


All times are GMT -5. The time now is 12:08 AM.