I have a small problem with my permissions. I use rsync frequently on a certain target directory, but one day I by accident I used "sudo rsync", and now all my permissions for the files in the directory have been changed to user 502. Can anyone provide me with a clue as to why this happened, and why user 502? thanks.
migrated from stackoverflow.com Sep 28 '11 at 2:23
This question came from our site for professional and enthusiast programmers.
When you create an account on a Mac, it is 501.
The 2nd account you create is 502. And so on.
When you use rsync, it copies the files as your User ID because that's all a non-root user can do.
When you ran rsync as 'sudo' it thought you wanted to copy the user as well as the file.
You should be able to fix it with
ps - you can see your user number using the
It's much easier to just delete and recreate your users.
You can see which user has 501 (if any) with the
Then delete your 502 user (you'll need to make a third admin account to do all this deleting). Again keep the home folder.
Go into terminal and use
Much easier in the long run - as long as you don't delete the home folders, you won't loose any files and the UID will match again with your primary users on both machines being 501.