Peter's Dance Party

Recover Ubuntu encrypted private directory

One of my old machines died this past week. Nothing critical on it except for a few documents that were living in my encrypted private directory. The hard drives weren't the point though, so I wasn't too concerned about recovery.

When you first create your encrypted directory, you are given a recovery key. It is recommended that you write this down it keep somewhere safe. I didn't see any point in doing that; either the disk will die and I won't be able to recover anything, or I will be able to use the same mechanism the system uses to get that key.

That key is stored in ~/.ecryptfs/wrapped-passphrase if you only have ~/Private encrypted or /home/.ecryptfs/$USERNAME/.ecryptfs/wrapped-passphrase if you are encrypting your entire home directory. This file is encrypted using your normal login password. You can decrypt it with the command ecryptfs-unwrap-passphrase. That will give you the passphrase needed to mount your private directory: mount -t ecryptfs .Private Private.