Created
June 8, 2015 14:02
-
-
Save skvoz/2f9423ccff1b706570db to your computer and use it in GitHub Desktop.
Mac OS X : Adding user groups and assigning read/write permission for the group to specific folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //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/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment