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

umask? Setting Default File Permissions

In the standard Mac OS X Lion install, newly created files get the following permissions:


Owner -> Read & Write

Group -> Read only

Everyone -> Read only.


I'd like the permissions on newly created files to be this instead:


Owner -> Read & Write

Group -> Read & Write

Everyone -> No Access


I can change the permissions for each new file manually (using Get Info), but believe there must be an easier way. Perhaps by changing some under the hood default setting or via other programming? I've been led to believe that changing the umask might be the solution, but have no expierence with doing this or otherwise messing with umask.


Any help/guidance is greatly appreceated.

Posted on Jan 23, 2012 1:43 PM

Reply
Question marked as Best reply

Posted on Jan 28, 2012 3:39 PM

Use at your own risk...Your milage may vary...You have been warned...Don't blame me...This is a disclaimer...etc.


I believe I have the answer to my own question. Solution is to change the umask for user applications. Outline:


  1. Use a file editor in Terminal to create a file called "launchd-user.conf" in the etc folder of the root directory (i.e., file is: /etc/launchd-user.conf).
  2. add a line in that file to read: umask 007


Now files created by ALL users will have 660 or -rw-rw----- permissions (that's four dashes at the end; 1 dash for the execute on group and 3 dashes for read, write, and execute on others). That is:


Owner -> Read & Write

Group -> Read & Write

Everyone -> No access


Other permissions can be set as default by changing the umask 007 line to read umask nnn (where each n is a number between 0 and 7). See further below for helpful references on octal notation and use of umask.


Solution above is from Apple article and carries all kinds of warnings. See here:


http://support.apple.com/kb/HT2202


I had hoped that new folders would get 770 or drwxrwx--- permissions (that's three dashes at the end), but it doesn't seem to work for new folders created by the Finder. Instead they get 750 or drwxr-x--- permissions (that's three dashes at the end) if created by Finder and 755 or drwxr-xr-x permissions if created by TextEdit (and other applications?).


Other potential solutions (that I've not looked into): Get TinkerTool System Release 2 and work in what the developer calls the "Pane System."



Helpful article (not by Apple) on octal notation:


http://en.wikipedia.org/wiki/File_system_permissions#Octal_notation



Helpful article (not by Apple) on use of umask:


http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html

4 replies
Question marked as Best reply

Jan 28, 2012 3:39 PM in response to William W. Higgins Jr.

Use at your own risk...Your milage may vary...You have been warned...Don't blame me...This is a disclaimer...etc.


I believe I have the answer to my own question. Solution is to change the umask for user applications. Outline:


  1. Use a file editor in Terminal to create a file called "launchd-user.conf" in the etc folder of the root directory (i.e., file is: /etc/launchd-user.conf).
  2. add a line in that file to read: umask 007


Now files created by ALL users will have 660 or -rw-rw----- permissions (that's four dashes at the end; 1 dash for the execute on group and 3 dashes for read, write, and execute on others). That is:


Owner -> Read & Write

Group -> Read & Write

Everyone -> No access


Other permissions can be set as default by changing the umask 007 line to read umask nnn (where each n is a number between 0 and 7). See further below for helpful references on octal notation and use of umask.


Solution above is from Apple article and carries all kinds of warnings. See here:


http://support.apple.com/kb/HT2202


I had hoped that new folders would get 770 or drwxrwx--- permissions (that's three dashes at the end), but it doesn't seem to work for new folders created by the Finder. Instead they get 750 or drwxr-x--- permissions (that's three dashes at the end) if created by Finder and 755 or drwxr-xr-x permissions if created by TextEdit (and other applications?).


Other potential solutions (that I've not looked into): Get TinkerTool System Release 2 and work in what the developer calls the "Pane System."



Helpful article (not by Apple) on octal notation:


http://en.wikipedia.org/wiki/File_system_permissions#Octal_notation



Helpful article (not by Apple) on use of umask:


http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html

Jan 28, 2012 3:52 PM in response to William W. Higgins Jr.

What I really want to know now: Is there a way to set default permissions (using umask or some other "under the hood" system modification) so that EACH user could have a different permission default?


For example:

User 1 -> Read & Write

Finance Group -> Read & Write

Everyone -> No Access


User 2 -> Read & Write

Finance Group -> Read Only

Everyone -> Read Only


User1 would have umask 007

User2 would have umask 022


Again, any way to set umask for each individual user?

Apr 23, 2012 4:05 AM in response to jonesy16

I've been trying to set the correct permissions on a San with Lion clients for what seems like weeks now and this is the cause! Need to have this sorted by Friday. Any news on a 10.7.4 release date?


Below works as a workaround:


$ sudo defaults write /Library/Preferences/com.apple.finder umask -int 2


Then reboot.


Gives the following permissions:


Creator / RW

Group / RW

Everyone / R


ie 775

umask? Setting Default File Permissions

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