I already have root access since the computer is my personal property. It runs a recent version of a major Linux distribution. I want to create a new user that is an identical copy of an existing user, including all configurations and settings. The new user has already been added to the system. The step that is the focus of my question is copying all the files in the home directory. There are many files that have a string naming the username of the source user. I can programmatically edit the copies to name the new user. But, I am concerned about a big binary file ~/.config/dconf/user and any others that may be like it. One big issue is that the length of the usernames is different and that merely changing the username with a tool like sed could easily corrupt the file.

There are no issues with user contributed files as these are known to not have any absolute user references. Paths referencing home directory files were all written with ~/ or just ~ for cases just like this. But many GUI application developers were not so wise.

Is there a resource that could list any more files that I need to know about and what tools I should use to modify these files to work under a new username?

I believe this problem would be similar to renaming a user but all I find online refers to the usermod command.


correct path ~/.config/dbus/user -> ~/.config/dconf/user

  • I'm pretty sure that usermod knows nothing about any files in a user's directory. – roaima Sep 16 '19 at 7:41
  • 1
    i'm sure of that, too, which is why i am asking, to find out if anything does. even a web document would be good. – Skaperen Sep 16 '19 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.