Friday, June 24, 2011

Make Duplicate Copy of a User Account in Ubuntu

Sometimes we share our PC between our family members/friends etc. We spent quite some time in setting up Compiz, Web Browser, appearance and all that stuff and then we feel the need to make duplicate copies of that account for other family members/friends etc. We'll show you how to achieve that.

First of all, we need to create a new user account. Go to System > Administration > Users and Groups in classic GNOME or in Unity, press the <Super> key and search for 'Users and Groups' and open it.

Click the 'Add' button and fill the 'Name' and 'Short Name' fields. Short Name will be the username for the new account. Click 'Ok' when done.

In the next window that appears, you need to type in the password you want to assign to the new user. Enter the intended password and close the 'Users and Groups' window.

Now press Alt + F2 and enter:

gksudo nautilus

Caution: Be careful while using Nautilus with root privileges. Make sure you don't delete or rename any files accidentally or it might render your system unusable.

Navigate to Filesystem > home. You'll now see a new directory for the newly created user. Follow the steps below to copy the user files.
  • Open up the source user's home directory.
  • Press Ctrl + H to see the hidden files.
  • Press Ctrl + A to select all files.
  • Press Ctrl + C to copy selected files.
  • Go back to the 'home' directory and open up the newly created user's home directory.
  • Paste the copied files by pressing Ctrl + V.
  • Close Nautilus.
Now go to a Terminal and follow the commands below:

sudo chown -R newuser:newuser /home/newuser
sudo chmod -R 755 /home/newuser

Replace 'newuser' with the username of the newly created account in both of the above commands.

The first command would set the ownership of those files for the newly created user and the second one would set the default Linux permissions on all those files.

Now, you can logout and try logging in to the newly created user account.

Related Posts: