Saturday, October 1, 2011

Access your encrypted data from a live CD (ecryptfs)

     From: bodhizazen.net
     You can access the data in your encrypted home directory with a live CD using chroot if you know your login password.
     Start by booting a live CD and, assuming they were automatically mounted, unmount your partitions.
Next mount your partitions in /mnt. I assume your root partition is /dev/sda1 and if you have a separate /home partition it is /dev/sda2 , you will need to adjust your partitions accordingly.
 ubuntu@ubuntu:~$ sudo mount /dev/sda1 /mnt

#################
# Separate home #
#################

# SKIP THIS STEP IF YOU DO NOT HAVE A SEPARATE HOME DIRECTORY
ubuntu@ubuntu:~$ sudo mount /dev/sda2 /mnt/home
 Set up the chroot:
ubuntu@ubuntu:~$ sudo mount -o bind /dev /mnt/dev
ubuntu@ubuntu:~$ sudo mount -o bind /dev/shm/ /mnt/dev/shm
ubuntu@ubuntu:~$ sudo mount -o bind /proc /mnt/proc
ubuntu@ubuntu:~$ sudo mount -o bind /sys /mnt/sys
 Enter the chroot and su switch user to your login user, I use bodhi here as an example:
ubuntu@ubuntu:~$ sudo chroot /mnt
ubuntu@ubuntu:~$ su - bodhi
keyctl_search: Required key not available
Perhaps try the interactive 'ecryptfs-mount-private'
To run a command as administrator (user "root"), use "sudo >command<".
See "man sudo_root" for details.

# Notice the user name change from 'ubuntu' to 'bodhi'
bodhi@ubuntu:~$
Decrypt your home directory:
bodhi@ubuntu:~$ ecryptfs-mount-private
Enter your login passphrase:
Inserted auth tok with sig [b0d08471978769db] into the user session keyring

INFO: Your private directory has been mounted.
INFO: To see this change in your current shell:
cd /home/bodhi

bodhi@ubuntu:~$ cd
bodhi@ubuntu:~$ ls
bin Desktop Downloads Music Public Videos
bzr Documents examples.desktop Pictures Templates zen

Labels: , ,

comments powered by Disqus