How to copy / clone user account in Linux


Diambil dari http://www.ambience.sk/user-account-copy-linux

Copy / clone user account, so that both users have the very same settings in their user home directory.

Copying a user’s home directory (e.g. olduser) to new user (e.g. newuser) is easy:

  1. Create new user:
    adduser newuser
  2. Copy all special hidden (dot) files to new user’s home directory:
    cp –recursive /home/olduser/.[a-zA-Z0-9]* /home/newuser
  3. Copy other standard files to new user directory:
    cp –recursive /home/olduser/* /home/newuser
  4. Set new user’s directory and files owner to new user for hidden dot files:
    chown –recursive newuser:users /home/newuser/.*
  5. Set new user’s directory and files owner to new user for normal files:
    chown –recursive newuser:users /home/newuser/*

You are done. In some cases you may need to change user group (users in this case).

Now logout and try to login as the new user. All the settings for the programs should be the very same as for the old user. You can for example compare the settings by running KDE and checking the wallpaper and other settings of the new user. If the copying of the user folder was successful, everything will look the same.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: