Unix access privileges
Download
1 / 16

Unix Access Privileges - PowerPoint PPT Presentation


  • 88 Views
  • Uploaded on

Unix Access Privileges. Chapter 6.15-6.17. 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. Use the ls -l command.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Unix Access Privileges' - laken


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Unix access privileges

Unix Access Privileges

Chapter 6.15-6.17


Access privileges
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
Viewing access privileges

  • Use the ls -l command

drwx------ 2 jdoe 8192 Jul 12 12:26 nsmail/

-rw-r--r-- 1 jdoe 945 Mar 15 16:01 old.cshrc

-rwxrwxrwx 1 jdoe 168 Jan 13 1998 file.exe

-rw-rw-rw- 1 nobody 382 Nov 18 1998 old.profile

-rw------- 1 jdoe 652 Jul 12 12:16 old.xsession

drwx------ 2 jdoe 8192 Jun 23 13:21 thesis/

-rw-r--r-- 1 jdoe 1186776 Jul 13 15:07 win32tutorial.ps


Types of file access
Types of file access

  • Read

    • Allows viewing at the contents of the file

    • Allows listing the contents of a directory

  • Write

    • Allows changing or deleting the file

    • Allows creation of files within a directory

  • Execute

    • Allows execution of a program

    • Allows traversal of a directory

      • You can't access files or directories inside a directory without execute permissions on that directory


Categories of access rights
Categories of access rights

  • User/owner

    • The person who owns/created the file

  • Group

    • Each file and directory belongs to a group

    • Each user is a member of 1 or more groups

  • Others

    • Everyone else that has access to the computer


To change permissions
To change permissions

  • chmod

    • changes the access mode of a file

  • Two methods exist

    • symbolic

    • absolute


Chmod symbolic
chmod - symbolic

  • chmod requires

    • which permissions to add or subtract

    • the category of user to change

    • chmod [who] [operation] [permission] [file]


Chmod symbolic1
chmod - symbolic

  • chmod [who] [operation] [permission] [file]

  • Who

    • u = user/owner

    • g = group

    • o = others/world

    • a = all

  • Note, these are all lower-case letters


Chmod symbolic2
chmod - symbolic

  • chmod [who] [operation] [permission] [file]

  • Operation

    + add permission

    - remove permission

    = set permission


Chmod symbolic3
chmod - symbolic

  • chmod [who] [operation] [permission] [file]

  • Permission

    r = read permission

    w = write permission

    x = execute permission

  • Note these are lower case letters


Chmod examples
chmod - examples

  • chmod o-w temp

  • chmod u-r bar

  • chmod g+rw home.html

  • chmod a=rw myFile

  • chmod a+x homework


Chmod absolute
chmod - absolute

  • Absolute

    • specify a numeric equivalent for a set of permissions

  • You specify all permissions at once

  • This is not for the faint of heart


Chmod absolute1
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


Chmod absolute2
chmod - absolute

  • e.g.,

chmod 644 moocow.txt

User permission

World permission

Group permission


Chmod absolute3
chmod - absolute

  • Permissions:

    • Read = 4

    • Write = 2

    • Execute = 1

  • Set permissions by adding the values of all the permissions you wish to set


Chmod examples1
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