I do this now and then when migrating users to different computers. It's quite simple:
1) either copy the entire /etc/passwd, /etc/shadow, /etc/group, or just copy user 'bob' from those files and put that onto the new system. Bob won't know anything has changed.
2) copy, backup, and restore bob's home directory
done
To answer your question
Quote:
does user bob on new system have to have the same UID as the user bob on old system in order to be an owner of files copied? or is the username enough?
|
Bob needs to have the same UID from the old computer for him to access his home directory on the new computer, UNLESS you chown bob's home directory. Usernames are conveniences for us humans. I could create a user named bob with a UID of 1000, and then create a username John with a UID of 1000 on another computer. To the system, "bob" and "john" are the same people.