Understanding UNIX permissions
Since Mac OS X is built on a UNIX core, you can set permissions by entering UNIX commands in Terminal.
Each file or directory has three types of security groups:
- Owner: The owner or creator of the file or directory
- Group: The group to which the file or directory is assigned
- All Others: Anyone who isn’t the owner or is not assigned to the group associated with the file or directory.
Each security group is assigned a code that controls that group’s permissions:
- r (read) allows the user to see the item but not make changes.
- w (write) allows the user to see and make changes to the item.
- x (execute) allows the user to run scripts or programs.
- (access) means access is turned off.
To view permissions for files and directories in Terminal, type the ls -l command. For each file or directory listed, you see the permissions, owner and group name, and file or directory name.
Examples:
The following file (-) displays read, write, and executable permissions for owner (rwx), group (rwx) and all others (rwx): -rwxrwxrwx
The following file (-) displays read, write, and executable permissions for owner (rwx), and group (rwx), but no permissions for others (---): -rwxrwx---
The following file (-) displays read, write, and executable permissions for owner (rwx), but no permissions for group (---) or others (---): -rwx------
The following file (-) displays read and write, but no executable permissions for owner (rw-), group (rw-), and others (rw-): -rw-rw-rw-
The following file (-) displays read, write, and executable permissions for owner (rwx), but only read and executable for group (r-x) and others (r-x): -rwxr-xr-x
The following file (-) displays read, write, and executable permissions for owner (rwx), but only read for group (r--) and others (r--): -rwxr--r--
For more information on permissions in UNIX, refer to the man page by entering: man ls