I recently migrated a server to another machine in our rack. They ownership/permissions didn't transfer when I moved /home from machine1 to /home on machine2 (both Ubuntu machines)
The user accounts successfully transfered and are all there.
I was wondering if there is a way to dynamically change all of /home to be owned by their username as currently everything is owned by root:root
I tried sudo chown -R $USERNAME: /home/$USERNAME
to no avail
Any ideas?
Edit 1:
I can successfully change permissions through the use of chown -R someUser:someUser /home/someUser
My question is there a simple way to do this in bulk through the whole /home directory
Apologies for the confusion