0

I'm trying to deny my user access to a certain folder. I can't.

I set an admin account to be the owner of that folder, but i can't set "No Access" for any user on that folder. But i can do it for "everyone".

What i really want to do is cut myself off from a certain folder (the old xcode apps) without having to delete them and empty trash, i want to keep them, but make sure my user can't access any files in that location anyway, unless i override it again.

So these are two questions, but i expect my first question to be answered. Maybe there is a way i can do that through command line, which i'm still not sure, but is there a way using the OSx interfaces?

Thank you

  • For files/folders I want to "hide" I usualy just use the Finder's "File" -> "Compress" and then trash the original. Command line ju-jistsu can probably answer the initial question or one could pay a few bucks for Apple's Server.app and it has some finer grained controls for individual and group access with a graphical interface. – j-beda Jan 17 '17 at 13:28
0

You could set the folder to have the following permissions to deny access from yourself, do this with your admin user:

  • Everyone: No Access
  • admin user: Read & Write

After this delete the line with your own user, so that you fall under the group "Everyone". This way only the admin user has an exception to the "no access" rule.

  • yes that's what i did from my user, i added some other admin user, made him the owner,put everyone no access, and removed my user. it worked (although i was still able to copy->move folder lol, but at least i can't access or list its content) noob os thanks – LolaRun Jan 17 '17 at 14:04
0

Though anyone can access the folder with the POSIX permissions 777 you still can restrict access for a single or several users (or group(s)) by adding ACLs. ACLs are an additional more fine-grained layer of permissions for files and folders.

This is done in Terminal.app by entering

chmod +a "user/group add/deny permission"

So if you have a folder with the following permissions:

ls -laed /Users/Shared/OldXcode-projects
drwxrwxrwx 2 adminuser  wheel  68 Jan 17 14:32 /Users/Shared/OldXcode-projects

you can add the following ACL:

chmod +a "user1 deny list,add_file,delete,add_subdirectory" /Users/Shared/OldXcode-projects
ls -laed /Users/Shared/OldXcode-projects
drwxrwxrwx+ 2 adminuser  wheel  - 68 17 Jan 14:32 /Users/Shared/OldXcode-projects
 0: user:user1 deny list,add_file,delete,add_subdirectory

Though everyone (e.g. adminuser, user2 and user3) has full access, user1 can't access the folder nor add files or folders.

-1

Just put a dot first in the folder name. Volla folder gone. :giggling:

But as onik said just set the access for everyone to no access and allow for admin user:

sudo -u adminuser chmod /dir/to/folder 700

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .