SlideShare a Scribd company logo
Users and Groups
Linux understands Users and Groups
A user can belong to several groups
A file can belong to only one user and one
group at a time
A particular user, the superuser “root” has extra
privileges (uid = “0” in /etc/passwd)
Only root can change the ownership of a file
Users and Groups cont.
User information in /etc/passwd
Password info is in /etc/shadow
Group information is in /etc/group
/etc/passwd and /etc/group divide data
fields using “:”
/etc/passwd:
joeuser:x:1000:1000:Joe User,,,:/home/joeuser:/bin/bash
/etc/group:
joeuser:x:1000:
A program runs...
A program may be run by a user, when the
system starts or by another process.
Before the program can execute the kernel
inspects several things:
• Is the file containing the program accessible to the user
or group of the process that wants to run it?
• Does the file containing the program permit execution
by that user or group (or anybody)?
• In most cases, while executing, a program inherits the
privileges of the user/process who started it.
A program in detail
When we type:
ls -l /usr/bin/top
We'll see:
-rwxr-xr-x 1 root root 68524 2011-12-19 07:18 /usr/bin/top
What does all this mean?
-r-xr-xr-x 1 root root 68524 2011-12-19 07:18 /usr/bin/top
---------- --- ------- ------- -------- ------------ -------------
| | | | | | |
| | | | | | File Name
| | | | | |
| | | | | +--- Modification Time/Date
| | | | |
| | | | +------------- Size (in bytes
| | | |
| | | +----------------------- Group
| | |
| | +-------------------------------- Owner
| |
| +-------------------------------------- “link count”
|
+---------------------------------------------- File Permissions
Group
The name of the group that has permissions in addition to the file's owner.
Owner
The name of the user who owns the file.
File Permissions
The first character is the type of file. A "-" indicates a regular (ordinary) file. A
"d” indicate a directory. Second set of 3 characters represent the read, write, and
execution rights of the file's owner. Next 3 represent the rights of the file's group, and
the final 3 represent the rights granted to everybody else.
(Example modified from http://www.linuxcommand.org/lts0030.php)
Access rights
Files are owned by a user and a group
(ownership)
Files have permissions for the user, the group,
and other
“other” permission is often referred to as “world”
The permissions are Read, Write and Execute
(R, W, X)
The user who owns a file is always allowed to
change its permissions
Some special cases
When looking at the output from “ls -l” in the
first column you might see:
d = directory
- = regular file
l = symbolic link
s = Unix domain socket
p = named pipe
c = character device file
b = block device file
Some special cases cont
In the Owner, Group and other columns you
might see:
s = setuid [when in Owner column]
s = setgid [when in Group column]
t = sticky bit [when at end]
Some References
http://www.tuxfiles.org/linuxhelp/filepermissions.html
http://www.cs.uregina.ca/Links/class-info/330/Linux/linux.html
http://www.onlamp.com/pub/a/bsd/2000/09/06/FreeBSD_Basics.html
There are two ways to set permissions when
using the chmod command:
Symbolic mode:
testfile has permissions of -r--r--r--
U G O*
$ chmod g+x testfile ==> -r--r-xr--
$ chmod u+wx testfile ==> -rwxr-xr--
$ chmod ug-x testfile ==> -rw--r--r--
U=user, G=group, O=other (world)
File permissions
Absolute mode:
We use octal (base eight) values represented like this:
Letter Permission Value
R read 4
W write 2
X execute 1
- none 0
For each column, User, Group or Other you can set
values from 0 to 7. Here is what each means:
0= --- 1= --x 2= -w- 3= -wx
4= r-- 5= r-x 6= rw- 7= rwx
File permissions cont.
Numeric mode cont:
Example index.html file with typical permission values:
$ chmod 755 index.html
$ ls -l index.html
-rwxr-xr-x 1 root wheel 0 May 24 06:20 index.html
$ chmod 644 index.html
$ ls -l index.html
-rw-r--r-- 1 root wheel 0 May 24 06:20 index.html
File permissions cont.
Two critical points:
1.The permissions of a directory affect whether
someone can see its contents or add or
remove files in it.
2.The permissions on a file determine what a
user can do to the data in the file.
Example:
If you don't have write permission for a directory, then
you can't delete a file in the directory. If you have write
access to the file you can update the data in the file.
Inherited permissions

More Related Content

Similar to permissions.pptx computer science and tec (20)

PPT
Unix/Linux Basic Commands and Shell Script
sbmguys
 
PPT
Host security
Nguyen Tam
 
PPT
Host security
Nguyen Tam
 
PDF
Linux Fundamentals and how to use linux.pdf
xikel86509
 
PDF
Unit 4 user and group
root_fibo
 
PPTX
Introduction to linux day3
Gourav Varma
 
PPT
UNIX -File attributes and permissions; The Security Implications
RAVIRAJ P
 
PPTX
FILE PERMISSION OR ACCESS MODE
Vpmv
 
PDF
Devops for beginners
Vivek Parihar
 
PPT
Unix fundamentals
Dima Gomaa
 
PPT
06 users groups_and_permissions
Shay Cohen
 
PDF
Linux command line cheatsheet
We Ihaveapc
 
PPT
101 4.5 manage file permissions and ownership v3
Acácio Oliveira
 
PDF
Linux Security
Mahdi Cherif
 
PDF
UNIX Drive Storage
adil raja
 
PPT
4.5 manage file permissions and ownership v3
Acácio Oliveira
 
PPT
PowerPoint Presentation Microsoft notes .ppt
okwalingajoe
 
DOC
Most frequently used unix commands for database administrator
Dinesh jaisankar
 
Unix/Linux Basic Commands and Shell Script
sbmguys
 
Host security
Nguyen Tam
 
Host security
Nguyen Tam
 
Linux Fundamentals and how to use linux.pdf
xikel86509
 
Unit 4 user and group
root_fibo
 
Introduction to linux day3
Gourav Varma
 
UNIX -File attributes and permissions; The Security Implications
RAVIRAJ P
 
FILE PERMISSION OR ACCESS MODE
Vpmv
 
Devops for beginners
Vivek Parihar
 
Unix fundamentals
Dima Gomaa
 
06 users groups_and_permissions
Shay Cohen
 
Linux command line cheatsheet
We Ihaveapc
 
101 4.5 manage file permissions and ownership v3
Acácio Oliveira
 
Linux Security
Mahdi Cherif
 
UNIX Drive Storage
adil raja
 
4.5 manage file permissions and ownership v3
Acácio Oliveira
 
PowerPoint Presentation Microsoft notes .ppt
okwalingajoe
 
Most frequently used unix commands for database administrator
Dinesh jaisankar
 

More from IqraHanif27 (18)

PPT
personalitymaslow.ppt important notes and
IqraHanif27
 
PDF
Lecture-02.pdf computer relationship easy
IqraHanif27
 
PDF
Lecture-01.pdf good lecture important notes
IqraHanif27
 
PPT
Quality Management.ppt in detail with notes
IqraHanif27
 
PPT
SPM.ppt details of spm project management
IqraHanif27
 
PPT
1588095888-intro.pptWeb Technologies and Tools (such as scripting tools) for ...
IqraHanif27
 
PPTX
link list.pptx complete notes detailed ans
IqraHanif27
 
PPTX
Lec10-Binary-Heaps-19122022-113509am.pptx
IqraHanif27
 
PPTX
Lec5-Doubly-Linked-List-24102022-110112am.pptx
IqraHanif27
 
PPTX
Lec12-Hash-Tables-27122022-125641pm.pptx
IqraHanif27
 
PPTX
NevigationMenu.pptx complete notes and types
IqraHanif27
 
PPTX
Chapter 3.pptx multimedia and conquer the same thing
IqraHanif27
 
PPTX
Chapter 2.pptx multimedia and the uses inlife
IqraHanif27
 
PPTX
Chapter 1.pptx multimedia and its uses in
IqraHanif27
 
PPTX
economics.pptx gross domastic product uses
IqraHanif27
 
PPT
Week 10-11 Managing Tablespaces and Data Files.ppt
IqraHanif27
 
PDF
Intro_Chapter_03B.pdf types of printers with example
IqraHanif27
 
PPT
ch1.ppt operating system from computer science for BSCs
IqraHanif27
 
personalitymaslow.ppt important notes and
IqraHanif27
 
Lecture-02.pdf computer relationship easy
IqraHanif27
 
Lecture-01.pdf good lecture important notes
IqraHanif27
 
Quality Management.ppt in detail with notes
IqraHanif27
 
SPM.ppt details of spm project management
IqraHanif27
 
1588095888-intro.pptWeb Technologies and Tools (such as scripting tools) for ...
IqraHanif27
 
link list.pptx complete notes detailed ans
IqraHanif27
 
Lec10-Binary-Heaps-19122022-113509am.pptx
IqraHanif27
 
Lec5-Doubly-Linked-List-24102022-110112am.pptx
IqraHanif27
 
Lec12-Hash-Tables-27122022-125641pm.pptx
IqraHanif27
 
NevigationMenu.pptx complete notes and types
IqraHanif27
 
Chapter 3.pptx multimedia and conquer the same thing
IqraHanif27
 
Chapter 2.pptx multimedia and the uses inlife
IqraHanif27
 
Chapter 1.pptx multimedia and its uses in
IqraHanif27
 
economics.pptx gross domastic product uses
IqraHanif27
 
Week 10-11 Managing Tablespaces and Data Files.ppt
IqraHanif27
 
Intro_Chapter_03B.pdf types of printers with example
IqraHanif27
 
ch1.ppt operating system from computer science for BSCs
IqraHanif27
 
Ad

Recently uploaded (20)

PDF
Case Study on good and bad acoustics in auditorium
Disha Agrawal
 
PDF
ARC-101-B-4.pdfxxxxxxxxxxxxxxxxxxxxxxxxx
IzzyBaniquedBusto
 
PPTX
the very teaching plan extra ordinary.pptx
PamelaOdibeli1
 
PPTX
Great_Discoverers_Nohzyxyxyzyzyzyzzyz_Imagptx
kevadiyahem07
 
PDF
EY-emeia-fso-assurance-viewpoint-technology (1).pdf
INKPPT
 
PPTX
Graphic_Design_Pjjjjjjjjjjjjjjjresentation.pptx
kumarsahil80682
 
PPTX
sistem teknologi yang di desain untuk mahasiswa dan dosen agar memudahkan mer...
gamesonlya2rj
 
PPTX
DSA_Algorithms_Prtestttttttttttttesentation.pptx
Kanchalkumar1
 
PDF
CS6801-MULTI-CORE-ARCHITECTURE-AND-PROGRAMMING_watermark.pdf
SriRanjani60
 
PDF
Uber Driver Hackday Sprint Solving Ride Cancellations
YellowSlice1
 
PDF
AI Intervention in Design & Content Creation
YellowSlice1
 
PDF
cs603 ppts .pdf 222222222222222222222222
RabiaNazneen1
 
DOCX
presente continuo luis (1).docx riklavoz
olivaresricardo141
 
PPT
1744066yaar kya hai ye bolo not nice 4.ppt
preethikavarsha
 
PPTX
unit 6 mgt.pptx on researchtoics can find
Arpit953319
 
PPTX
Drjjdhdhhdjsjsjshshshhshshslecture 28.pptxfg
noorqaq25
 
PDF
Ecowood.pdf | Tranquil Global Acoustics India
tranquil01
 
PPTX
Chapter 2-3.pptxnsnsnsnsnsjsjsjsjejeusuejsjsj
hibaaqabdirisaaq331
 
PPTX
EDC_UNIT _I FINAL (1).pptx dhud and w ah yes
TEAKADAITROLLS
 
PDF
ARChitec-BUILDING-UTILITIES-2-PART-5.pdf
IzzyBaniquedBusto
 
Case Study on good and bad acoustics in auditorium
Disha Agrawal
 
ARC-101-B-4.pdfxxxxxxxxxxxxxxxxxxxxxxxxx
IzzyBaniquedBusto
 
the very teaching plan extra ordinary.pptx
PamelaOdibeli1
 
Great_Discoverers_Nohzyxyxyzyzyzyzzyz_Imagptx
kevadiyahem07
 
EY-emeia-fso-assurance-viewpoint-technology (1).pdf
INKPPT
 
Graphic_Design_Pjjjjjjjjjjjjjjjresentation.pptx
kumarsahil80682
 
sistem teknologi yang di desain untuk mahasiswa dan dosen agar memudahkan mer...
gamesonlya2rj
 
DSA_Algorithms_Prtestttttttttttttesentation.pptx
Kanchalkumar1
 
CS6801-MULTI-CORE-ARCHITECTURE-AND-PROGRAMMING_watermark.pdf
SriRanjani60
 
Uber Driver Hackday Sprint Solving Ride Cancellations
YellowSlice1
 
AI Intervention in Design & Content Creation
YellowSlice1
 
cs603 ppts .pdf 222222222222222222222222
RabiaNazneen1
 
presente continuo luis (1).docx riklavoz
olivaresricardo141
 
1744066yaar kya hai ye bolo not nice 4.ppt
preethikavarsha
 
unit 6 mgt.pptx on researchtoics can find
Arpit953319
 
Drjjdhdhhdjsjsjshshshhshshslecture 28.pptxfg
noorqaq25
 
Ecowood.pdf | Tranquil Global Acoustics India
tranquil01
 
Chapter 2-3.pptxnsnsnsnsnsjsjsjsjejeusuejsjsj
hibaaqabdirisaaq331
 
EDC_UNIT _I FINAL (1).pptx dhud and w ah yes
TEAKADAITROLLS
 
ARChitec-BUILDING-UTILITIES-2-PART-5.pdf
IzzyBaniquedBusto
 
Ad

permissions.pptx computer science and tec

  • 1. Users and Groups Linux understands Users and Groups A user can belong to several groups A file can belong to only one user and one group at a time A particular user, the superuser “root” has extra privileges (uid = “0” in /etc/passwd) Only root can change the ownership of a file
  • 2. Users and Groups cont. User information in /etc/passwd Password info is in /etc/shadow Group information is in /etc/group /etc/passwd and /etc/group divide data fields using “:” /etc/passwd: joeuser:x:1000:1000:Joe User,,,:/home/joeuser:/bin/bash /etc/group: joeuser:x:1000:
  • 3. A program runs... A program may be run by a user, when the system starts or by another process. Before the program can execute the kernel inspects several things: • Is the file containing the program accessible to the user or group of the process that wants to run it? • Does the file containing the program permit execution by that user or group (or anybody)? • In most cases, while executing, a program inherits the privileges of the user/process who started it.
  • 4. A program in detail When we type: ls -l /usr/bin/top We'll see: -rwxr-xr-x 1 root root 68524 2011-12-19 07:18 /usr/bin/top What does all this mean?
  • 5. -r-xr-xr-x 1 root root 68524 2011-12-19 07:18 /usr/bin/top ---------- --- ------- ------- -------- ------------ ------------- | | | | | | | | | | | | | File Name | | | | | | | | | | | +--- Modification Time/Date | | | | | | | | | +------------- Size (in bytes | | | | | | | +----------------------- Group | | | | | +-------------------------------- Owner | | | +-------------------------------------- “link count” | +---------------------------------------------- File Permissions Group The name of the group that has permissions in addition to the file's owner. Owner The name of the user who owns the file. File Permissions The first character is the type of file. A "-" indicates a regular (ordinary) file. A "d” indicate a directory. Second set of 3 characters represent the read, write, and execution rights of the file's owner. Next 3 represent the rights of the file's group, and the final 3 represent the rights granted to everybody else. (Example modified from http://www.linuxcommand.org/lts0030.php)
  • 6. Access rights Files are owned by a user and a group (ownership) Files have permissions for the user, the group, and other “other” permission is often referred to as “world” The permissions are Read, Write and Execute (R, W, X) The user who owns a file is always allowed to change its permissions
  • 7. Some special cases When looking at the output from “ls -l” in the first column you might see: d = directory - = regular file l = symbolic link s = Unix domain socket p = named pipe c = character device file b = block device file
  • 8. Some special cases cont In the Owner, Group and other columns you might see: s = setuid [when in Owner column] s = setgid [when in Group column] t = sticky bit [when at end] Some References http://www.tuxfiles.org/linuxhelp/filepermissions.html http://www.cs.uregina.ca/Links/class-info/330/Linux/linux.html http://www.onlamp.com/pub/a/bsd/2000/09/06/FreeBSD_Basics.html
  • 9. There are two ways to set permissions when using the chmod command: Symbolic mode: testfile has permissions of -r--r--r-- U G O* $ chmod g+x testfile ==> -r--r-xr-- $ chmod u+wx testfile ==> -rwxr-xr-- $ chmod ug-x testfile ==> -rw--r--r-- U=user, G=group, O=other (world) File permissions
  • 10. Absolute mode: We use octal (base eight) values represented like this: Letter Permission Value R read 4 W write 2 X execute 1 - none 0 For each column, User, Group or Other you can set values from 0 to 7. Here is what each means: 0= --- 1= --x 2= -w- 3= -wx 4= r-- 5= r-x 6= rw- 7= rwx File permissions cont.
  • 11. Numeric mode cont: Example index.html file with typical permission values: $ chmod 755 index.html $ ls -l index.html -rwxr-xr-x 1 root wheel 0 May 24 06:20 index.html $ chmod 644 index.html $ ls -l index.html -rw-r--r-- 1 root wheel 0 May 24 06:20 index.html File permissions cont.
  • 12. Two critical points: 1.The permissions of a directory affect whether someone can see its contents or add or remove files in it. 2.The permissions on a file determine what a user can do to the data in the file. Example: If you don't have write permission for a directory, then you can't delete a file in the directory. If you have write access to the file you can update the data in the file. Inherited permissions