On very rare occasions I get this very strange problem. I will login to a random Mac as the local admin account and I notice that the login takes a very long time. When I get to the desktop I notice that the wallpaper is back to the default wallpaper for that OS version, the hard drive icon is missing, and the Dock is back to the default layout. When I launch Terminal I get various errors - usually saying that I don't have a home directory. When I try to go to /Users in the Finder, I am denied access. If I try to open my Home Folder (by clicking on the Finder icon) I get an empty window and no path. Upon further inspection I discover that the permissions on /Users has changed from 755 to something like 700. I can't remember the exact permissions, but basically I had no rights even as the admin user. AND I discover that the home folder for the local admin and the Shared Items folder are gone. What I end up doing is to reset the permissions on /Users to 755 and then reboot to login as the Admin user to let it recreate the home folder again. Luckily this hasn't happened on any Macs that are actively being used by users. This has only been on spares that I use for loaners or testing. I've been seeing this happen since probably Yosemite, but definitely El Capitan and Sierra. It is very random and very infrequent, but the fact that it happens at all is a great mystery. I certainly don't have any policies in place that would do anything even remotely destructive like this. And definitely no Composer-built packages set to change permissions on /Users.
I can't seem to find anything in the system logs to indicate what's happening. I certainly can't find anything that jumps out and says "now deleting your home folder and changing permissions on /Users" Has anyone else seen anything like this?