I just want to change the username of a user with an encrypted home directory. Is there a simple way instead of the suggested restoring and so forth?
Asked
Active
Viewed 581 times
1 Answers
5
- It's best to unmount your home directory and execute the commands from another administrator account on the computer. You could use
ecryptfs-umount-private
or just reboot to unmount the directory. Change the login name and directory name from
old_user
tonew_user
:sudo usermod -l new_user -m -d /home/new_user old_user
Here comes the important part for the proper configuration:
- There exists a file named
/home/.ecryptfs/$USER/.ecryptfs/Private.mnt
it usually contains the following:/home/$USER
The following symlinks exist in your home directory when eCryptfs is not mounted:
.ecryptfs -> /home/.ecryptfs/$USER/.ecryptfs .Private -> /home/.ecryptfs/$USER/.Private
Make sure that
$USER
in all these instances reflects the changes you intended to make, e.g.new_user
. You can usenano
to edit text files andln -s
to create new symlinks.
- There exists a file named
You should be able to login again. I just tried it on my own. If you cannot log in through the GUI try from the terminal and check again that everything is in place.

LiveWireBT
- 28,763
.ssh/authorized_keys
file for remote login, so I'd say once you understood where your data and configuration is and how the individual parts come together it's pretty basic and solid. – LiveWireBT Jan 01 '19 at 00:42/home/.ecryptfs/$USER
directory. If I rename it, I can no longer access the directory, regardless if I change the reference in the files in my home directory. No biggie though, I don't mind if that directory has a different name, it's hidden inside.ecryptfs
directory anyway. – Alex Burdusel Dec 10 '22 at 10:32