Solaris Permission

File Permissions

File permissions are apply to regular files and to special files, such as devices and sockets. When a file is a symbolic link, the permissions that apply are those of the file that the link points to.

• Read (r)    – Can open and read the contents of a file.
• Write (w)    – Can write to the file (modify its contents), add to it, or delete it.
• Execute (x)    – Can execute the file (if it is a program or shell script).
• Denied (-)    – Cannot read, write, or execute the file.

Directory Permissions

Directory permissions are apply to directories. You can protect the files in a directory and its subdirectories by denying access to that directory.

• Read (r)    – List the files in the directory.
• Write (w)    – Add or remove files or links in the directory.
• Execute (x)    – Open or execute files in the directory.
• Denied (-)    – Cannot list, write, or open the files in the directory.

Octal Values for Permissions

Instead of using the letter symbol, you can use a numeric argument for file and directory permissions.  You can use these numbers in sets of three to set permissions for owner, group, and other. For example, the value 644 sets permissions to rw-r—r—: read/write permissions for owner, and read-only permissions for group and other.

• 0 (—)    – No permissions
• 1 (—x)     – Execute-only
• 2 (-w-) – Write-only
• 3 (-wx) – Write, execute
• 4 (r—)     – Read-only
• 5 (r-x) – Read, execute
• 6 (rw-) – Read, write
• 7 (rwx) – Read, write, execute

Umask

The command is used to change permission of new file/directory when created
Default value is 022, so new file/directory created will have below permission

File        666 – 022  =   644   =  rw-r–r–
Directory 777 – 022    =   755     =  rxwr-xr-x

Additional note:
Default permission for newly created file/directory:
• File        -rw-r–r–    644
• Directory    drwxr-xr-x    755

You May Also Like

Leave a Reply?