14

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?

2 Answers 2

17

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)

3

if home directory is encrypted, you should not change your password using the passwd command.

If someone forgets their login password, and home directory is encrypted, you should not try to reset it with the methods listed in other sites, such as manual editing of /etc/shadow or sudo passwd user using a different account, etc etc.

Indeed if you do, then your new login password will not decrypt your home directory, and you will see that behaviour you describe : at graphical login the password is accepted, but then the user is immediatly kicked out, since the home dir cannot be decrypted and accessed.

It seems you were wise enough to have a stored copy of the unwraped ecryptfs password. In that case there are ecrypt tools to solve the problem . See http://blog.dustinkirkland.com/2011/04/introducing-ecryptfs-recover-private.html

People who did not store it, and do not remember the old login password, may have a look into this http://mennucc1.debian.net/shadow_crack/

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .