1 / 15

Unix Permissions

Unix Permissions. File & Directory Permissions. ls –l command will show full details, including file name, owner name, modification date, size and permission sequence. Unix Permissions. Permission sequence found at the beginning of a directory listing (first 10 characters): d rwx r-x r-x.

Download Presentation

Unix Permissions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unix Permissions

  2. File & Directory Permissions • ls –l command will show full details, including file name, owner name, modification date, size and permission sequence.

  3. Unix Permissions • Permission sequence found at the beginning of a directory listing (first 10 characters): d rwx r-x r-x Owner’s Permissions Group’s Permissions World’s Permissions Directory

  4. Unix Permissions • The first character represents whether the listing is a directory. If it is a directory, a “d” will appear in the first character; otherwise, you should normally see a dash (-). d rwx r-x r-x

  5. Unix Permissions • The remaining nine characters are divided into three triplets. • The first triplet represents the owner’s permissions. • The second is the group’s permissions. • The third triplet represents the World’s permissions.

  6. Read Permission • 1st position in a triplet: r stands for Read; grants permission to view the contents of a file or directory (Value is ‘r’ or ‘-’).

  7. Write Permission • 2nd position in a triplet: w stands for Write; grants permission to modify a file or the contents of a directory (Value is ‘w’ or ‘-’).

  8. Execute Permission • 3rd position in a triplet: x stands for eXecute; grants permission to run an application or open a directory (Value is ‘x’ or ‘-’).

  9. Unix Permissions • When changing permissions, we must first decide what number will represent the permissions for a triplet. • We can do this by determining whether or not a permission is turned on or off. • If turned on, a permission gets a value of 1; if turned off, it gets a value of 0.

  10. Unix Permissions • After deciding whether the three permissions in a triplet are on or off, we will have a binary number • We can convert the binary number to its octal equivalent

  11. Unix Permissions

  12. Unix Permissions

  13. The chmod Command • Once you’ve established the octal number representing the permission for each triplet, you can then use the change mode (chmod) command to give a directory or file proper permissions

  14. chmod Syntax & Example • Syntax:chmod permissionMask file/dir • Example:chmod 755 public_html • Typically, directories and executable files are given “755” permissions, while other files are given “644” permissions

  15. Questions?

More Related