sábado, 11 de octubre de 2014

How to recover your ecryptfs home *the ultimate guide*

Hi, it's been a while.

As I told you a few weeks ago I changed my laptop and now I'm using a Mac, but that's not the point for today's post.

What I want to explain today is how to recover your data when you have removed the hard drive from your laptop and were using Ubuntu's ecryptfs .  You should know your login password at least. 

A good idea is to have your passphrase (the one which pops up after you've installed your Ubuntu, don't you remember???)




Ok, the process is simple, but you'll need an Ubuntu machine where to hook your drive.

Got it?

When you hook your drive it should be mounted like this:


/dev/sdc4 on /media/USERNAME/dae18b51-ec77-40bd-a735-6320415e561a type ext4 (rw,nosuid,nodev,uhelper=udisks2)

Probably you had a different username in your old laptop, if not just ignore this step.

sudo mkdir OLDUSERNAME
sudo chown USERNAME:USERNAME OLDUSERNAME

Now you should run 

sudo ecryptfs-recover-private /media/USERNAME/dae18b51-ec77-40bd-a735-6320415e561a/home/.ecryptfs/OLDUSERNAME/.Private

And it should go like this:


sudo ecryptfs-recover-private /media/USERNAME/dae18b51-ec77-40bd-a735-6320415e561a/home/.ecryptfs/OLDUSERNAME/.Private
[sudo] password for andres:
INFO: Found [/media/USERNAME/dae18b51-ec77-40bd-a735-6320415e561a/home/.ecryptfs/OLDUSERNAME/.Private].
Try to recover this directory? [Y/n]:
INFO: Found your wrapped-passphrase
Do you know your LOGIN passphrase? [Y/n]
INFO: Enter your LOGIN passphrase...
Passphrase:
Inserted auth tok with sig [a97fa5251799a5c5] into the user session keyring
INFO: Success!  Private data mounted at [/tmp/ecryptfs.KB1kDsq1].

So, if you do know your old LOGIN password, there shouldn't be any trouble at all :)

BUT if you don't remember it, just answer N to the LOGIN passphrase question and be prepared to type the 32 characters that Ubuntu showed when you first install it (you kept it, don't you?)

Finally, you can check your data unencrypted at the /tmp/ecryptfs.XXXXX directory.


Best regards,

Andrés

No hay comentarios:

Publicar un comentario