Goal is to take a user ‘anna’ and make an exact copy into another user name ‘Bob’.
I want all settings down to desktop color, icon positions etc to be identical.
How would you do it?
This is my experiment so far. Please tell if right or wrong.
(There are some manual lines at the end. How to automate?
cd /home
sudo rsync -avzh --usermap=anna:Bob /home/anna/ /home/Bob/
cd /home/Bob
sudo chown -R Bob:users *
sudo su Bob
find . -print | xargs -n 1 sed -i -e "s/anna/Bob/g"
find . -print | grep anna
cd ./.local/share/RecentDocuments
mv anna.desktop Bob.desktop
mv anna[2].desktop Bob[2].desktop
mv anna[3].desktop Bob[3].desktop
mv anna[4].desktop Bob[4].desktop
mv anna[5].desktop Bob[5].desktop
mv anna[6].desktop Bob[6].desktop
mv anna[7].desktop Bob[7].desktop
mv anna.desktop Bob.desktop
cd
mv ./.vnc/sesman_passwd-anna@E7470:200 ./.vnc/sesman_passwd-Bob@E7470:200
mv ./.vnc/sesman_passwd-anna@E7470:201 ./.vnc/sesman_passwd-Bob@E7470:201
mv ./.vnc/sesman_passwd-anna@E7470:202 ./.vnc/sesman_passwd-Bob@E7470:202
cd
cd ./.wine/drive_c/users/
mv anna Bob
cd
cd ./Pegasus/drive_c/users/
mv anna Bob
cd
As what user do you plan to do this?
I see some commands executed as that unknown user, some commands you plan to execute as root and then again I see something you want to execute as root, but then you rethink and execute as Bob. Confusing to me.
Also please explain why you use rsync with the options -avzh.
BTW, I would simply use cp I guess, but it is not quite clear if Bob is new and “virgin”, or already has configurations and if they should be deleted when not n anna, or replaced only when anna has them, or what.
And I wonder about the first two characters in the path construct
Hi
Not sure why you just don’t setup a default profile for a user. For the likes of Firefox, you can create your own settings file by extending /usr/lib64/firefox/defaults/pref/all-openSUSE.js eg http://kb.mozillazine.org/Locking_preferences
It doesn’t change anything, just list the files containing “anna”. The stuff in /usr will be taking some time. You have already taken care of /home - I assume. The other exclusions either are apparently useless, took ages or even didn’t let root have a look. It’s still a lot.
I assume most stuff doesn’t need bothering. It may be useful for troubelshooting, though. And I’d at least take a look at some files in /etc/ depending on your setup.