Hello and welcome to LQ, hope you like it here.
To preserve DAC rights see "man cp", under "--preserve". Since you have already copied over all files it would be easier to use a wee script to change ownership
provided the users have the same UID and GID in the new system (/etc/passwd and /etc/group). On the old system run:
Code:
find /home -type d -maxdepth 1 | while read dir; do
[ "${dir}" != "/home" ] && stat -c "chmod %a %n; chown -R %u:%g %n" "${dir}"
done | tee /tmp/chownhome.sh
This will produce a script with lines looking like this:
Code:
chmod 700 /home/lost+found; chown -R 0:0 /home/lost+found
chmod 700 /home/user0; chown -R 501:501 /home/user0
chmod 700 /home/user1; chown -R 502:502 /home/user1
# ad nauseam
Inspect to verify contents are OK.
Copy "/tmp/chownhome.sh" to the new system.
Run as root account user:
Code:
sh /tmp/chownhome.sh
YMMV(VM) as usual.