can't log in after password change (ecryptfs)

Solution 1:

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)

Solution 2:

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/