Jump to content

Setting up scheduled task for user permission on mac using server admin


Recommended Posts

Posted

when a user copies from a windows directory to the mac directory this is causing permission issues, i was to know how to generate a shceduled task to run that will re-apply permission each morning, i know you use Automator to run scheduled task but how would i set this up so it propagates the permissions ??

 

 

Thank you

 

:cool:

Posted

I've created an automator workflow to propagate permissions on a directory however i'm having some trouble over writing existing permissions.

 

This is the script;

 

 

chmod -R +a " allow read,write,delete" "/Users/xxxx/Documents/Permissions Test"

 

If I check the permissions in finder before I run the above script I see the following;

 

Name Privilege

Read

 

Once i've run the script I see;

 

Name Privilege

Custom

Read

 

I don't want to add another entry I just want to update the permissions to Read & Write

 

Any help would be appreciated.

Posted (edited)

Hi

 

You could try:

 

chmod -R +ai "user:jsmith allow readattr,readextattr,readsecurity,read,execute,list,search,writeattr,writeextattr,delete,write,append,delete_child,add_file,add_subdirectory,file_inherit,directory_inherit" /Users/xxxx/Documents/Permissions Test

 

The above is all on one line and must be run as root.

 

I know you know this but I hope the following might help others?

 

Firstly it’s important to understand that Macs are first and foremost a ‘nix’ box and secondly I’m hoping the brief explanation that follows of the permission models available on the platform might help you find the correct combination?

 

There is the standard POSIX (because it’s fundamentally a ‘nix’ OS as explained earlier) permissions and ACLs or Access Control Lists. ACLs are similar but not exactly the same as what you see on the Windows platform. ACLs propagate wheras POSIX don’t. Both work in conjunction with each other although ACLs do supercede/override POSIX. The order in which the permissions models are applied is also important. For example an ACL deny will override a POSIX allow as it will always be listed first (as you view it) using the Finder.

 

It’s best to see what permissions are applied using the command line (rather than the Finder) and the basic command that will allow you do this is ls. For example:

 

ls -lae /Users/whatevertheusernameis

 

you can compare the output of:

 

ls -lae /Users

 

to the one above and you should see the @ symbol beside username. In Terminal standard POSIX will always look like this:

 

drwxr-xr-x 7 username staff 12292 4 Dec 13:24 .

 

Whereas the same thing with an ACL applied will look like this:

 

drwxr-xr-x+ 47 username staff 1598 4 Dec 13:24 .

0: group:everyone deny delete

 

You can’t eliminate POSIX permissions as all the config files and directories in /etc and /var rely on them. Both of these (and others) are hidden from the GUI. Without these files/directories and associated permissions the platform simply won’t work. Furthermore few of these files/directories are involved in presenting the shiny GUI the platform is known for.

 

It’s OK practice to apply permissions using the Finder (on the client OS only) which accesses the POSIX model only. To apply ACLs you need to use the command line. Once you use ‘chown’ and/or ‘chmod’ in the appropriate format you’ll see another username is applied with the ‘custom’ flag alongside. This is by design and is normal behaviour.

 

HTH?

 

Antonio Rocco (Apple Consultants Network)

Edited by AntonioRocco

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...