How to clone a user profile on the same computer?

7,786

Why not copy the entire home directory?

sudo cp -a /home/johndoe /home/local/DOMAIN/

This will create /home/local/DOMAIN/johndoe with the exact file structure, permissions, etc. as the original.

Make sure you cleanup any previous attempts before you run this, i.e. sudo rm -r /home/local/DOMAIN/johndoe.

Share:
7,786

Related videos on Youtube

00fruX
Author by

00fruX

Updated on September 18, 2022

Comments

  • 00fruX
    00fruX over 1 year

    Does anyone have a sure-fire way to make a new profile identical to another profile on the same computer? I have to put that in bold because it seems every time I search online the only thing that comes up is how to copy a profile to another computer which, for all I know could be the same only extra work.

    I just installed Powerbroker and joined a Linux computer to the domain and would like to copy my local profile /home/johndoe into the new domain profile at /home/local/DOMAIN/johndoe.

    I tried this (Can't Clone a User Profile?) but not only do I not have a "gdm" service to stop, it rendered my domain profile useless. When I try logging in as domain\johndoe it starts to log back in but then goes back to the login screen.

    After joining to the domain and logging in for the first time with a new domain account, I logged back out and then logged in locally as the original user /home/johndoe, and ran these commands:

    sudo cp -a /home/johndoe/* /home/local/DOMAIN/johndoe/
    sudo cp -a /home/johndoe/.* /home/local/DOMAIN/johndoe/
    sudo chown -R johndoe:johndoe /home/local/DOMAIN/johndoe
    

    Anyone know why it's not working or what went wrong? When I entered that second command (cp -a /home/johndoe/.* /home/local/DOMAIN/johndoe/) here is what I got -- which I didn't/don't think it's a big deal but I'm kind of a noob so I don't know if these errors even matter (even though I got the following errors I continued on with the chown command):

    cp: cannot copy a directory, ‘/home/johndoe/..’, into itself, ‘/home/local/DOMAIN/johndoe/’ 
    cp: will not create hard link ‘/home/local/DOMAIN/johndoe/.adobe’ to directory ‘/home/local/DOMAIN/johndoe/./.adobe’ 
    cp: will not create hard link ‘/home/local/DOMAIN/johndoe/.cache’ to directory ‘/home/local/DOMAIN/johndoe/./.cache’ 
    cp: will not create hard link ‘/home/local/DOMAIN/johndoe/.compiz’ to directory ‘/home/local/DOMAIN/johndoe/./.compiz’ 
    cp: will not create hard link ‘/home/local/DOMAIN/johndoe/.config’ to directory ‘/home/local/DOMAIN/johndoe/./.config’ 
    cp: will not create hard link ‘/home/local/DOMAIN/johndoe/.dbus’ to directory ‘/home/local/DOMAIN/johndoe/./.dbus’ 
    cp: will not create hard link ‘/home/local/DOMAIN/johndoe/.gconf’ to directory ‘/home/local/DOMAIN/johndoe/./.gconf’ 
    cp: will not create hard link ‘/home/local/DOMAIN/johndoe/.local’ to directory ‘/home/local/DOMAIN/johndoe/./.local’ 
    cp: will not create hard link ‘/home/local/DOMAIN/johndoe/.macromedia’ to directory ‘/home/local/DOMAIN/johndoe/./.macromedia’ 
    cp: will not create hard link ‘/home/local/DOMAIN/johndoe/.mozilla’ to directory ‘/home/local/DOMAIN/johndoe/./.mozilla’ 
    cp: will not create hard link ‘/home/local/DOMAIN/johndoe/.pki’ to directory ‘/home/local/DOMAIN/johndoe/./.pki’