Skip to content

Instantly share code, notes, and snippets.

@skvoz
Created June 8, 2015 14:02
Show Gist options
  • Save skvoz/2f9423ccff1b706570db to your computer and use it in GitHub Desktop.
Save skvoz/2f9423ccff1b706570db to your computer and use it in GitHub Desktop.

Revisions

  1. skvoz created this gist Jun 8, 2015.
    32 changes: 32 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    //Adds new user group "dev" using Mac directory service command line utility
    sudo dscl . -create /groups/dev


    //Assigns some group id for the newly created group
    sudo dscl . -append /groups/dev gid 2111


    //Assigns password for the group
    sudo dscl . -append /groups/dev passwd "xxxxx"


    //Adds user with "username" to group "dev"
    sudo dseditgroup -o edit -a username -t user dev


    //List all the group available, and extract the newly created group 2111
    sudo dscacheutil -q group | grep 2111


    //To check whether the above entered information are proper, scroll the long list to find the dev group
    sudo dscl . readall /groups



    //Add the directory to dev group
    sudo chown -R :dev /path/to/directory/



    //Assigns read/write permission for owner and the members of the group
    sudo chmod -R 770 /path/to/directory/