How do I prevent Mac search from searching files in other user accounts?

When I perform a search in User Account #1, it also searches files and data in User Account #2. How do I make it stop? I want to have a search in Account #1 only return results from Account #1, not Account #2 — and vice versa.


More specifically, I don't want Account #2 to be able to see the names of the files in Account #1, which it currently can in search.


All the solutions I've found relating to hiding files from search involve hiding them from all searches, from any user account. That's too much. I still need to be able to search my files — just only from within the account they're associated with.

Posted on Sep 11, 2021 4:24 PM

Reply

Similar questions

2 replies

Sep 11, 2021 5:00 PM in response to questionbedtime

The macOS default file permissions should prevent access if the files are in any other folder except Public. But if the files are in the root of Account #2 home folder then the files are visible to other users. Although they are read only. Since Spotlight can see them and read the contents it will index them.


You can change the permissions on the Account Users home folders and that will prevent Spotlight from even reading the files.


The default permissions on Account #1 and Account #2 is an octal value of 0755 for each of the home folders.

/Users/Account #1

/Users/Account #2


Although Apple documents some of the permissions abilities here:

https://support.apple.com/guide/mac-help/change-permissions-for-files-folders-or-disks-mchlp1203/mac


There is more you can do from the command line. In fact, this change is one we apply at work to better secure the company Mac's. We change the octal permission from 0755 to 0700. This will remove the Read permission from the home folder and you can't even list the contents of that user unless you are that user or if you are an admin on the Mac and you use sudo to get there on the command line.


The command to change the home folder permissions:


sudo chmod 0700 /Users/<Account #1>

sudo chmod 0700 /Users/<Account #2>


To reverse it just


sudo chmod 0755 /Users/<Account #1>

sudo chmod 0755 /Users/<Account #2>


Sep 11, 2021 6:20 PM in response to questionbedtime

You can change the permissions on the Account Users home folders and that will prevent Spotlight from even reading the files.

That's a bad idea. You should not alter the permissions set for the home folder.

Just create subfolders in the home and set them to match the others.

Delete the Group and set everyone to no access.


Move the files out of the root level of the home folder into the new folders or the built-in folders.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How do I prevent Mac search from searching files in other user accounts?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.