Copy a User Profile/Settings for New User in Xubuntu 10.04 LTS

When setting up a PC with Linux, especially when building up from a command line installation, you may need to create new users for the final end user of the machine. The last thing you want is to have to go through all the setup again for each user.

This is what you can do to copy the main profile to other users:

1. Setup the PC as you want it with your primary user, the one you installed with (We’ll call this USER1)

2. Next, run these three commands:

 sudo rm -rf /etc/skel  (it should be empty anyway

sudo mkdir /etc/skel

rsync -av /home/USER1/ /etc/skel

3. Create a new user, let’s call it USER2. Login in as USER2. It should have all the settings from USER1 in place. If you get any popup messages about things belonging to USER1, cancel all the popups, then run the above set of commands again, but this time copying over the USER2 profile. This should prevent popups for any future new users.

 sudo rm -rf /etc/skel

sudo mkdir /etc/skel

rsync -av /home/USER2/ /etc/skel

4. If users will be using Thunderbird, or other private programs, you can exclude them from the copy:

rsync -av –exclude=’ .thunderbird’ /home/USER1/ /etc/skel

5. You may want to setup the groups for the new user (for example, they won’t be an admin )

groups USER1

should return something like this:

 USER1 : USER1 adm dialout cdrom plugdev lpadmin admin sambashare

You can then set the groups for new users like so (for example: USER2 you want to be an admin and have sudo privileges)

 sudo usermod -G USER2 : adm dialout cdrom plugdev lpadmin admin sambashare

6. If you get in a mess and need to delete a user, including their home directory (the “-r” switch):

 sudo userdel -r USER2

One thought on “Copy a User Profile/Settings for New User in Xubuntu 10.04 LTS

Leave a Reply

Your email address will not be published. Required fields are marked *