You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

set permissions and privileges for new files

Hello,


how can i set permissions and privileges for new files i create?


When i create a file, by default it comes as "read and write" for me and "read only" for staff and everyone. I wish to have by default "read and write" for me and staff and "read only" for everyone.


How is this possible?


Otherwise i must repair permissions and privileges everytime i create a file...



Thanks!


João Bucho

OSX El capitan

iMac (21.5-inch, Late 2013), OS X El Capitan (10.11.1)

Posted on May 19, 2016 4:43 AM

Reply
18 replies

May 19, 2016 7:14 AM in response to Barney-15E

Hi Barney-15E,


i have a small office network (4 imacs). We all share a shared folder on my imac. Everytime i create a file, or folder on that shared folder i must go to "get info" and insert the other users and set Read-write privilege. The same happens with the other users. When they create a file on that folder they must do the same process, although i can do it too because i'm the folders owner.


I know i can get info of the shared folder and do "aply to enclosed items", setting all files with same permissions and privileges, but i wish ot would be a easier/automatic way


Thanks

May 19, 2016 7:32 AM in response to jbucho

A more elegant and "mac-like" solution is to use Folder Actions.

A Folder Action can run whenever a file is added to the corresponding folder.


The "Folder Actions Setup" application is located at /System/Library/CoreServices/Folder Action Setup.


User uploaded file

Just attach a Folder Action to that folder, and make it so that when a file is added to it the script changes permissions for the file.

May 19, 2016 9:12 AM in response to jbucho

Let's say you are “serving” your Public folder from your home directory to your team, and you want the team to have read/write capability and others not on the team will have read permissions. Here is how you configure this, without any SIP privilege changes.


On your computer, in System Preferences : Sharing, you check File Sharing. Initially, it will be off (red dot), and under options, you can select one or both of SMB and AFP sharing.


For Shared folders, you click the + symbol and add the Public folder. On the right-panel, you configure the selections to Your name : Read & Write, Staff : Read & Write, and Other: as Read-only.


Next, you visit System Preferences : Security & Privacy. Unlock this panel, and under the Firewall tab, you click Firewall Options, and uncheck Block all incoming connections. When you do, you will see File Sharing (AFP, SMB) lit as green. This means that staff and others can now access your shared Public folder. Leave the other two checkboxes selected. Lock your Security & Privacy panel again, and quit System Preferences.


Others will need the following checked in Finder Preferences:

  • General : Connected Servers
  • Sidebar : Shared : Connected Servers


Once they have clicked your host name in their Finder's Shared section, and select your shared Public folder, you can place a file in there with default Read & Write privileges for you, but Read for Staff and Others — and members of the team (Staff) will be able to Read and Write the document because of the overriding privileges that you established in the System Preferences : File Sharing panel for Staff and Others.


I tested this on a 2014 MacBook Air running OS X 10.11.4 as the file server, and saved a Pages document into the Public folder on it. On my Mac mini, running OS X 10.11.5, I opened a Finder window, located the MBA name, and double-clicked it. I selected the shared Public folder, opened and updated the shared Pages document, and saved it. Back on the MBA, I verified via Quick Look that the document had indeed, been updated.


You are on an iMac, but for someone doing this on a Mac laptop, it is crucial that they turn off file sharing on it before entering into any public wi-fi cloud. Every one will see your machine name advertised to them if they have the right Finder settings in place.

May 19, 2016 9:59 AM in response to jbucho

JB,


Please read thru these detailed instructions a few times, in order to get accustomed to the steps that you might take.


On each of your office network Mac's, you may create an office work Group in System Preferences > Users & Groups.


For this example, let's call your office work Group, "OFFICEGROUP". (No spaces; all capital alpha [A-Z] characters.)


Plus additional setup, which will very likely help solve your current dilemma.


- - -


Now, at *your* office Mac, go to System Preferences > Users & Groups.


Create a Group. Somewhere around the lower-left quadrant of the Users & Groups window, you should find a "+" (PLUS symbol) button . . . click on that . . . produces a pop-down window.


For New Account, select "Group".


Enter "OFFICEGROUP" (no quotes). Click the Create Group button.


Once you have created that new Group, "OFFICEGROUP", it will show in the list of Users & Groups.


You may then hold down your keyboard Control key and with the mouse arrow, tap on the icon for "OFFICEGROUP". (ie Right-click on "OFFICEGROUP" in the list of Groups.)


That should produce a small pop-up window, in which you may select "Advanced Options". Click on that choice, "Advanced Options".


In the resulting Advanced Options mini-dialog window, *DO NOT change anything EXCEPT,* set a value for the Group ID. Let's make that value: 1900. Click OK.


After that mini-dialog-window vanishes, you should be looking at the Users & Groups window, and in the general area that is the right-hand 2/3rds of it (I'm looking at Mac OS 10.8.5 "Mountain Lion" windows as I write this):


Name: OFFICEGROUP


and below that, a list of Users.


ENABLE any User(s) that you see at this time, whom you want to be part of OFFICEGROUP.


Quit System Preferences.


Now, go to each of your other office Mac computers and repeat the same steps, above.


Having completed those tasks at the other office Mac computers, return to this point in these instructions.


Now at your own office Mac computer, return to System Preferences > Users & Groups.


In the left-hand area of the window, select "OFFICEGROUP". In the roughly-right-hand area of the window, again, you should see a list of Users under


Name: OFFICEGROUP


Whatever users of the office Mac computers, are *not* in this Users list, add them as follows.


Click on the "+" (PLUS symbol) button again, and in the pop-down window, select for


New Account: Sharing Only


Full Name: (same as it is on the respective office Mac)


Account Name: (same as it is on the respective office Mac)


Password: (same as it is on the respective office Mac)


Verify: (same as it is on the respective office Mac)


We presume, here, that you are the Mac administrator for your office, and you know such info re the other Mac users. If you *do not know* their passwords, you'll need to ask them to assist with entering that particular info.


Let's say, that you've added 4 (Sharing Only) users, by this point.


*Try* to ENABLE them as Users for your office work Group "OFFICEGROUP". These new users *should* show under


Name: OFFICEGROUP


ENABLE them in *this list* of Users *if you can.*


You get the idea, you want these users to be members of your office work group, "OFFICEGROUP" - particularly on *your* office Mac computer.


NOTE: 'Sharing Only' users might *not* show on the left-hand side of the Users & Groups window. Don't let that bother you. Just keeping going . . .


Quit System Preferences.


Restart *your* office Mac computer.


Go to System Preferences > Sharing. Click on File Sharing (you probably have it ENABLED).


Under "Shared Folders" select the folder that you are sharing across your office network for those other Mac users.


Under the Users portion of the window, you should see (and set permissions):


Users Permissions
JB (your Mac user account name) Read & Write
OFFICEGROUP Read & Write
Everyone Read Only


FYI, the order of that list of three, is


Owner

Group

Everyone


Now, locate an Options button nearby, somewhere around the area of the same window and click on it.


That should produce a pop-down window. I'm looking at the Mountain Lion window, and it provides these settings, and you probably want (assuming that you are not sharing with Windows machines):


ENABLED "Share files and folders using AFP"


DISABLED "Share files and folders using SMB (Windows)"


Click the Done button.


While still at the System Preferences > Sharing window, you might want to police the permissions settings for any other Shared Folders. Given your info at present, there is no apparent need to share anything but the particular folder that you mentioned . . . so you might want to remove from the list of Shared Folders, any folders that you DO NOT want to share. (Same at the other Mac computers.)


In other words, share what you want, but not by accident. (Often with Mac's, the OS automatically shares the user's Public folder when File Sharing is first enabled, but you DO NOT have to share it. Be safe, secure, is the point.)


Quit System Preferences.


Restart ALL of the office Mac computers, beginning with your computer.


At the other office Mac computers, test the connection back to your computer, and the file / folder access that you have in mind.


That's it; good luck.

May 19, 2016 3:18 PM in response to ChisolmLee15

This will not work as requested since the default umask for users on OS X is such that it sets the file owner to the user that created it and sets the group to read only. Just because you created a group other than Staff won't change that fact. The new files will have OFFICEGROUP set to Read Only due to the umask. It doesn't matter that the folder has Read/Write for OFFICEGROUP.


I followed your instructions and cannot create a file in that folder that is editable by another user in the group.

In the link I posted above, I showed how to apply ACLs to the desired folder to get all users read/write access to all files and subfolders created by any user of the group.

May 20, 2016 2:50 AM in response to jbucho

You must also leave a space after the command and then drag the topmost folder you wish to share from into the Terminal window. That will automatically add the full path to the folder. Or, you can copy and paste the whole line into TextEdit, alter the group name, and add the full path to the folder you desire to share, then copy/paste it into Terminal


So, the full command will look like:

sudo chmod -R +a "long acl string" /full/path/to/sharing/folder

May 20, 2016 5:06 AM in response to jbucho

First, you shouldn't share out a folder in your home folder. It's just too messy. Use the Shared folder instead.

Second, it won't change the permissions on the individual files. The folder you shared should have Custom permissions. It is those "Custom" permissions that allow each user to edit the files created by other users.


If you haven't already, you should set up Sharing Only users on your Mac to correspond with each of the other users in the office, as ChisolmLee15 discussed.


You are trying to use a Client version of OS X to act as a File Server. It isn't, but you can make it simulate one well enough with the ACL modification. You would likely be better off running the OS X Server on that Mac, but I don't know anything about setting it up, so you'll have to get help from others here or on the OS X Server forum if you want to go that route.

May 20, 2016 5:18 AM in response to jbucho

This would be a lot easier if you just install Mac OS X Server on the computer. You would have better control over file sharing that way.


Or better yet, why not dedicate a Mac as a Server with Mac OS X Server installed. Many people buy and set up Mac minis for just this purpose.


Mac OS X Server is available in the Mac App Store for $20.00 USD


http://www.apple.com/osx/server/

set permissions and privileges for new files

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