My Ubuntu-encrypted home directory was lost when I changed my user password.
This was because I did it from the command line as root. So my user password is no longer linked to my encrypted user data. How do I reunite them?
My Ubuntu-encrypted home directory was lost when I changed my user password.
This was because I did it from the command line as root. So my user password is no longer linked to my encrypted user data. How do I reunite them?
If you did not change the password because you forgot it, you can change it back, make a backup without encryption, delete everything, change password again and restore everything. That's what I can guess while not knowing how the encryption works. Hopefully it will encrypt on import, if you want to feel safe, backup and just copy it somewhere and try to copy back first.
I attempted two solutions to rescue this home data for my user1 (let's call it that).
The restult is I have my data but have lost system integrity.
i.) Changed user1 password back to what it was originally
ii.) Set up another encrypted user account (user2), used Dustin Kirkland's tool to recover the data from user1, copied it into user2 home (relying on the oft-cited linux boast that all you have to do to backup is copy your /home directory).
The result was mayhem.
It was on the face of it not mayhem. It looked on the face of it like this:
i) Result: user1 account reopened and data accessible by turning password back
ii) Result: user2 account created, and turned into copy of user1 by copying /home/user1 recovery dir into it after being extracted with Kirkland's tool.
The mayhem was that my system has now confused passwords between the two accounts.
i.i.) user1 login requires old password now reinstated (as expected)
i.ii.) login as user1 root on command line requires root password (as expected - root password was changed when the other user passwords were changed in the operation that caused this bug)
i.iii.) user1 GUI authentication (e.g. when mounting disk) asks for user2 password. This is not expected and not desirable. It would normally ask for root password in this situation.
ii.) user2 account opens with expected user2 password, and begins to display last saved state of user1, but crashes instantly. Complete lockup.
Peter Nerlich's convoluted solution looking quite attractive now.
(N.B. Concrete advice on ii. seems scarce. While it seemed sensible to reinstate home/user1 into the /home directory of another user with the same name, it seemed inadvisable to create two user accounts with the same name on the same machine. And since Kirkland's tool performed its rescue by extracting /home/user1 into a temp directory, it was counter-intuitive to try and put this back in /home/user1. So this was like a conjunction of catch-22's, with snakes and spaghetti all mixed up together. Horrible. Really horrible).