I have a user profile all setup with all settings the way I want them. I want to copy the entire configured profile to a new user account.
This is what I'm doing (user is already added to system):
- Log out, switch to terminal,
service gdm stop
. mkdir /home/newuser
cp -a /home/olduser/* /home/newuser/
chown newuser:newuser /home/newuser -R
service gdm start
Then I log in as newuser. When I log in, the desktop looks like a brand new user profile and not the customized profile that I copied.
I want everything in the new profile. The theme, where the docks are located and configured, desktop icons, Firefox favorites, etc.
Any idea why this isn't working? I am using Ubuntu 10.04
You will need to do more then that.
Log into the new user account. If all is working, delete the backup
OK, I figured it out. Apparently cp /* skips dot files.
You have to explicitly copy dot files with:
And to copy everything do both:
I wanted to clone my current profile to a new user. My home directory was large, almost 100 GB. bodhi.zazen's answer worked for me, but it took half a day of false starts before I got it right. Here's an expanded annotated version of his answer (I'm on Ubuntu 14.04):
Create new user
I just used the desktop UI: System Settings > User Accounts > Unlock > + New User
Backup new user home directory
Now on to the command line:
Copy profile to new user home directory
If you have a large profile, I'd recommend using rsync and excluding some directories. Here's an example of what I ran:
A couple notes:
--exclude
directories are subdirectories of the source dir/home/klenwell/
./home/klenwell/
. Miss it and you'll end up with/home/new_user/klenwell
.I'd recommend a couple quick test runs before walking off. Use
--dry-run
and even run it once or twice cutting it short to double check everything is going where you expect. With exclusions, I cut my home directory in half but it still took an hour to copy.Make new user owner of home directory
Took 5 minutes to complete in my case.
Log in with your new user
If you try to log in with your new user and Ubuntu just keeps kicking you back to the login prompt, you probably forgot the previous step.
If you successfully log in, now you can wipe out your old backup:
References