change/clone/copy user settings.

Is there any way how to change user name, folder name after cloning computer with all settings from last session with old name. For example. All widgets, settings on shortcuts, documents etc. Opensuse 12.3 if that makes any difference.

It is not 100% clear to me what you mean. But all user data is (normaly) within her/his home directory. His documents, pictures, whatever.
And of course all personal configuration settings. E.g. KDE settings are inside ~/.kde4, Firefox settings inside ~/.mozilla, etc. There are many of them. But when you copy the complete home directory, you have them all.

But when your question is: “how do I change the username of a user on a system”, then it might probably be the fastestt o:
a. change the name of that user in the appropriate lines in /etc/passwd and /etc/shadow.
b. change the name of the user in every place where you find it in /etc/group.
c. rename the home directory of the user (in /home) to the new name.
All must of course be done as root (and the user must of course not be loged in at during the change).
This way the uid is not changed at all and thus ownership of files, etc. is kept correct.
But before doing this, please wait if somebody adds something to this.

You can also use YaST to:
a. remove the user, but keep the files!!!
b. add the new user.
c. as root remove /home/new-user, mv /home/old-user /home/newuser and chown -R newuser /home/new-user.

But maybe you ask something different. As sais II am not 100% sure I understand you.

A few months ago, I tried something like that.

Logged in as user1, I did a tar backup of “$HOME/.kde4”.
Logged in as user2, I did tar extract.

That worked - sort-of. I deleted a couple of symlinks in “.kde4” that were user specific.

When I logged into KDE, there were some errors. It turned out that there are a few references that are user specific more deeply inside that “.kde4” file hierarchy. Not a big deal - I was able to tell it to ignore the errors.

My point: there are some dependencies on the userid (login name) and on the uid (numeric id) in the user settings that might cause problems.

Rather than doing it that way round, I gave my old user a new name and new uid; then I gave my new user the original name and uid of the old user and copied the settings files that I wanted from the old user to the new user; finally I used chown to make the copied files belong to the new user. That meant that, if anything went wrong, I still had all the original files in old user.

On 2013-04-15 16:16, nrickert wrote:
> My point: there are some dependencies on the userid (login name) and
> on the uid (numeric id) in the user settings that might cause problems.

There may be some temporary files in /tmp, /var/tmp/,…

Cheers / Saludos,

Carlos E. R.
(from 12.1 x86_64 “Asparagus” at Telcontar)