Everything is Broken

Moving your ecryptfs directory between machines

On Ubuntu there is an option to create an encrypted directory in your home directory called ~/.Private, which is mounted at ~/Private. To set this up you need to issue two commands:

 sudo apt-get install ecryptfs-utils
 ecryptfs-setup-private

It asks you for a mount password. Log out and log back in again and everything you drop in the Private directory is encrypted and stored in the .Private directory, so that no-one can access your files if, for example, they log in to the machine in Single user mode, or take the hard disk out. So far so good.

But what happens when you move your encrypted files to a different machine? The instructions on this weren’t so clear, so I’m just writing down a step-by-step approach to help others who are unsure.

You need to copy two directories from your old machine to  your new one: ~/.ecryptfs and ~/.Private. Here’s how ecryptfs works: It takes the mount password, and encrypts it with your login password. It stores this in ~/.ecryptfs/wrapped-passphrase, so now when you login wit h your password, it can automatically mount the directory.

OK so to set up your new machine you need a) your old login password, b) your new login password and c) the mount password.

If you don’t know the last of these you can find it out. Assuming you put the files in the correct place on your new machine, do this.

ecryptfs-unwrap-passphrase ~/.ecryptfs/wrapped-passphrase

Enter  your OLD login password and it will reveal the mount password. So now we need to run the setup on the new machine, using the NEW login password and the same MOUNT password. But we’ll need to empty the .Private directory first, and use the –force option. Here goes.

 mv .Private .PrivateOld
 ecryptfs-setup-private --force
       => Enter MOUNT passphrase
 mv .PrivateOld/* .Private/

OK, so now you just logout and login again, and its all good. You did keep a backup right? Yes, I thought so.



				
				

This entry was posted on Friday, January 14th, 2011 at 10:36 am and is filed under General IT, Linux, Security. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« ClamAV reporting Outdated version
Bandwidth Saving apt-get upgrade »

Leave a Reply

CAPTCHA Image
Refresh Image
*
  • Recent Posts

    • Munin, nginx, mysql on Ubuntu 11.04: Great tool. Poorly explained.
    • Ubuntu 11.10, Unity, Gnome 3 and the whole mess
    • Spreadsheet Conditional formatting to mark weekends.
    • Cleaning a virus off a Samba Share.
    • Bandwidth Saving apt-get upgrade
  • Sing for your supper

  • Static

    • About
    • Privacy Policy
  • Tags

    apathy apple calendar chkconfig collanos cross-platform eee evolution firmware google grub hotspot id card lightning Linux Mandriva notebook partitioning pclinuxos pclinuxos 2008 Philippines power management re-install sane scanner scheduleworld script Security slow sysv-rc-conf thinkpad thunderbird trust ubuntu ultraportable usb virtualisation vmware vpn wifi wireless workspace sharing xsane yahoo zombie
  • Blogroll

    • Datalude
    • Digital Life
    • Engage the World
  • Archives

    • January 2012
    • October 2011
    • August 2011
    • July 2011
    • March 2011
    • January 2011
    • May 2010
    • April 2010
    • March 2010
    • November 2009
    • October 2009
    • June 2009
    • May 2009
    • April 2009
    • February 2009
    • January 2009
    • November 2008
    • October 2008
    • September 2008
    • August 2008
    • July 2008
    • June 2008
    • April 2008
    • March 2008
    • February 2008

Everything is Broken runs on WordPress. Theme by Bob. All content Copyright © Datalude 2008+.