1 / 12

Unix Access Privileges

Unix Access Privileges. Who can access what files and how. Access privileges. All unix files have privileges associated with them. These privileges determine who can access the file. These privileges determine how people can access the file. Viewing access privileges.

ulf
Download Presentation

Unix Access Privileges

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 Access Privileges Who can access what files and how.

  2. Access privileges • All unix files have privileges associated with them. • These privileges determine who can access the file. • These privileges determine how people can access the file.

  3. Viewing access privileges • Use the ls -l command. drwx------ 2 jimd 8192 Jul 12 12:26 nsmail/ -rw-r--r-- 1 jimd 945 Mar 15 16:01 old.cshrc -rwxrwxrwx 1 jimd 168 Jan 13 1998 file.exe -rw-rw-rw- 1 nobody 382 Nov 18 1998 old.profile -rw------- 1 jimd 652 Jul 12 12:16 old.xsession drwx------ 2 jimd 8192 Jun 23 13:21 thesis/ -rw-r--r-- 1 jimd 1186776 Jul 13 15:07 win32tutorial.ps

  4. Types of file access • Read — person can look at the contents of the file. • Write — person can change the file. • Execute — person can execute the file (applies only to directories and program).

  5. Types of users • User/owner -- the person who owns/created the file. • Group — Unix allows for the creation of groups. • Others/world -- everyone else in the world that has access to that computer.

  6. To change permissions chmod — changes the access mode of a file. Two methods exist symbolic absolute

  7. chmod - absolute • Absolute - you specify a numeric equivalent for a set of permissions. • You specify all permissions at once. • This is not for the faint of heart.

  8. chmod - absolute • chmod [xxx] [file] • Where each x is some number from 0 - 7. • Each number specifies a level of privileges for a specific group.

  9. chmod - absolute • e.g., chmod 644 moocow.txt User permission World permission Group permission

  10. chmod - absolute • Permissions: rwx • Read = 4 - 100 • Write = 2 - 010 • Execute = 1 - 001 • Set permissions by adding the values of all the permissions you wish to set.

  11. chmod - examples • To give yourself read & write permission and no permission to anyone else: • chmod 600 foobar.txt • To give yourself read & write permission and everyone else read permission only: • chmod 644 index.html • To give yourself full access to a directory, and everyone else read & execute permission only: • chmod 755 homeDirectory

  12. Reading • Appendix D.

More Related