Ubuntu – can’t log in after password change (ecryptfs)

ecryptfshome-directorypassword-recovery

I am on Ubuntu 12.10 with one user using encrypted home.

A while back I have changed by user password and then forgot it.

I then made a backup of my files using Dustin's help to an external drive. I was about to delete my system and do a fresh install when I realized that there is a recovery option in which I can reset my user password.
Using How do I reset a lost administrative password? I have set a new password for my user.

After rebooting I can log-in in Unity using my new password but I am thrown back to the Unity screen immediately. (No message about false password)

Using the terminal I can log in using the new user-password.

How can I re-enable my machine to decrypt my ecrypfs encrypted home with the unwrapped passphrase I know?

Best Answer

I had the exact same problem. I changed my password using passwd. That messed things up because of the encrypted home directory. The above link contains a solution:

login to terminal

$ ecryptfs-mount-private

You need to know your old password to mount.

This will unlock and mount your /home/$USER. At this point, we can access /home/$USER. So just cd back into it and run…

$ ecryptfs-rewrap-passphrase ~/.ecryptfs/wrapped-passphrase

It’ll prompt you for your old password, and you can enter a new one afterward. You will need to change the password for your keyring as well. From your menu bar – [Applications] => [Accessories] => [Passwords and Encryption Keys] Under Passwords tab – right-click “Passwords: login” and “Change Password”

Based on grayfox May 17 at 19:28 - http://unixtitan.net/main/2010/11/16/annoyance-changing-password-with-ecryptfs/ (I don't have enough reputation to comment his answer)