SlideShare una empresa de Scribd logo
1 de 13
Linux Tips: Files, Users & Permissions

Fabio Emilio Costa

http://plus.google.com/+FabioEmilioCosta
http://twitter.com/HufflepuffBR
http://www.facebook.com/fabiocosta0305
http://www.reddit.com/u/HufflepuffBR
Some History
●

Linux == Unix-Like

●

Quacks like duck, walks like duck, but no duck

●

Unix was created on 1960s

●

Multi-user

●

How avoid users to access forbidden files

●

Permissions

●

Groups

●

Everything is treated as a file on Unix (directories, devices)
Permissions
●

Read (4) – cat, cp ...

●

Write (2) – gedit, vi, emacs, rm..

●

eXecute (1) – run as programs (scripts)

●

Numbers were normally used

●

On directories:
–

Read: ls...

–

Write: touch, rm...

–

Execute: cd...
Users
●

Permissions are given on a file based on:
–
–

Group: people who are from the same group the owner;

–
●

User: who created the file (normally);
Others: nuff said...

ls -l shows all the normal permissions
Reading permissions on ls -l
File type
● - – common file
● d – directory
●
b – block device (disks)
●
c – character devices (terms)
● l – symbolic link
Owner's permissions
Group's permissions
Other's permissions
● read
● write
● execute
● - – unset permission

-rw-------
Users & Groups
●

All permissions are based on users

●

Normally indicated by either a name and/or a number

●

On appliance, jharvard is user 1000

●

Can be seen on /etc/passwd file

●

Users normally are parts of groups

●

Groups can be used for accounting, security, administration;

●

A user can be part of one or more groups;

●

jharvard is part of wheel group (can use sudo)

●

Can be seen on /etc/group file
Manipulating permissions
●

Changing Permissions: chmod (Change Mode);

●

Changing the Owner of a file: chown (Change Owner);

●

Changing the Group of a file: chgrp (Change Group);

●

Just root can chown and chgrp;
–

●

On older Linux and Unix, owner could chown and
chgrp, but that was a security risk (SetUID);

Only root and owner can chmod;
Changing permissions with chmod
●

By numbers: sum the permissions numbers. Each number
represents one into User, Group, Others (UGO)
–

●

Character indication: placing the needed permissions for a kind
after a = symbol;
–

●

chmod u=rw,go=w bar

Set/Unset: using the + symbol to set a permission and a –
symbol to unset a permission (easier method);
–

●

chmod 644 foo

chmod a+r,u+w baz

Special group: All
The root
●

Special user

●

Can do ANYTHING with a system...

●

… including break it

●

Has a special ID of 0

●

Many commands can be done just by root...

●

… or users that can use sudo, from wheel group …

●

… and jharvard is from wheel group
"With great power comes great
responsibility"
(PARKER, Ben)
Want to see Linux being broken?

Running rm -rf / on Linux

http://www.youtube.com/watch?v=D4fzInly
Don't try this at home!!!!!
Scripts
●

On Windows, files are opened based on extension;

●

.exe, .com, .bat – programs/scripts;

●

On Unix, needs eXecution permission to run as a script;

●

Any file with eXecution permission will be executed (if
possible);
THIS IS CS50

Más contenido relacionado

La actualidad más candente

Ubuntu Cheat Sheet
Ubuntu Cheat SheetUbuntu Cheat Sheet
Ubuntu Cheat SheetServerless
 
[ETHCon Korea 2019] Kim jiyun 김지윤
[ETHCon Korea 2019] Kim jiyun 김지윤[ETHCon Korea 2019] Kim jiyun 김지윤
[ETHCon Korea 2019] Kim jiyun 김지윤ethconkr
 
System administration
System administrationSystem administration
System administrationpuspa joshi
 
Git&GitHub 를 이용한 버전관리와 협업 - 2.비교하기와 되돌리기
Git&GitHub 를 이용한 버전관리와 협업 - 2.비교하기와 되돌리기Git&GitHub 를 이용한 버전관리와 협업 - 2.비교하기와 되돌리기
Git&GitHub 를 이용한 버전관리와 협업 - 2.비교하기와 되돌리기Youngbin Han
 
Programming OpenRISC on Altera De0_nano
Programming OpenRISC on Altera De0_nanoProgramming OpenRISC on Altera De0_nano
Programming OpenRISC on Altera De0_nanoYi-Chiao
 
Overview of linux kernel development
Overview of linux kernel developmentOverview of linux kernel development
Overview of linux kernel developmentPushkar Pashupat
 
Why Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your ShellWhy Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your Shelljaguardesignstudio
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootKenny (netman)
 
Writing file system in CPython
Writing file system in CPythonWriting file system in CPython
Writing file system in CPythondelimitry
 
Character_device_driver_bbb
Character_device_driver_bbbCharacter_device_driver_bbb
Character_device_driver_bbbRashila Rr
 
Open Source Public Workstations In Libraries
Open Source Public Workstations In LibrariesOpen Source Public Workstations In Libraries
Open Source Public Workstations In LibrariesLeonsagara
 
How to install Odoo 13 in Ubuntu ?
How to install Odoo 13 in Ubuntu ?How to install Odoo 13 in Ubuntu ?
How to install Odoo 13 in Ubuntu ?Varsha Technaureus
 

La actualidad más candente (20)

How to build and load linux to embedded system
How to build and load linux to embedded systemHow to build and load linux to embedded system
How to build and load linux to embedded system
 
Ubuntu Cheat Sheet
Ubuntu Cheat SheetUbuntu Cheat Sheet
Ubuntu Cheat Sheet
 
FUSE Filesystems
FUSE FilesystemsFUSE Filesystems
FUSE Filesystems
 
Can I write to a read only file ?
Can I write to a read only file ?Can I write to a read only file ?
Can I write to a read only file ?
 
[ETHCon Korea 2019] Kim jiyun 김지윤
[ETHCon Korea 2019] Kim jiyun 김지윤[ETHCon Korea 2019] Kim jiyun 김지윤
[ETHCon Korea 2019] Kim jiyun 김지윤
 
System administration
System administrationSystem administration
System administration
 
File then system
File then systemFile then system
File then system
 
Git&GitHub 를 이용한 버전관리와 협업 - 2.비교하기와 되돌리기
Git&GitHub 를 이용한 버전관리와 협업 - 2.비교하기와 되돌리기Git&GitHub 를 이용한 버전관리와 협업 - 2.비교하기와 되돌리기
Git&GitHub 를 이용한 버전관리와 협업 - 2.비교하기와 되돌리기
 
Dockerの準備
Dockerの準備Dockerの準備
Dockerの準備
 
Git installation
Git installationGit installation
Git installation
 
Cli2 Bibalex
Cli2 BibalexCli2 Bibalex
Cli2 Bibalex
 
Programming OpenRISC on Altera De0_nano
Programming OpenRISC on Altera De0_nanoProgramming OpenRISC on Altera De0_nano
Programming OpenRISC on Altera De0_nano
 
Overview of linux kernel development
Overview of linux kernel developmentOverview of linux kernel development
Overview of linux kernel development
 
Why Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your ShellWhy Zsh is Cooler than Your Shell
Why Zsh is Cooler than Your Shell
 
Windows XP Professional Installation
Windows XP Professional  InstallationWindows XP Professional  Installation
Windows XP Professional Installation
 
Linux fundamental - Chap 11 boot
Linux fundamental - Chap 11 bootLinux fundamental - Chap 11 boot
Linux fundamental - Chap 11 boot
 
Writing file system in CPython
Writing file system in CPythonWriting file system in CPython
Writing file system in CPython
 
Character_device_driver_bbb
Character_device_driver_bbbCharacter_device_driver_bbb
Character_device_driver_bbb
 
Open Source Public Workstations In Libraries
Open Source Public Workstations In LibrariesOpen Source Public Workstations In Libraries
Open Source Public Workstations In Libraries
 
How to install Odoo 13 in Ubuntu ?
How to install Odoo 13 in Ubuntu ?How to install Odoo 13 in Ubuntu ?
How to install Odoo 13 in Ubuntu ?
 

Destacado

Portada Matematicas
Portada MatematicasPortada Matematicas
Portada Matematicasguestbb360f
 
GNU/Linux - uma alternativa (nova versão)
GNU/Linux - uma alternativa (nova versão)GNU/Linux - uma alternativa (nova versão)
GNU/Linux - uma alternativa (nova versão)Fábio Emilio Costa
 
Entendendo as regras do Jogo - Go e Software Livre
Entendendo as regras do Jogo - Go e Software LivreEntendendo as regras do Jogo - Go e Software Livre
Entendendo as regras do Jogo - Go e Software LivreFábio Emilio Costa
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsLinkedIn
 

Destacado (8)

Creative Commons
Creative CommonsCreative Commons
Creative Commons
 
Palestra BrOffice.org
Palestra BrOffice.orgPalestra BrOffice.org
Palestra BrOffice.org
 
Portada Matematicas
Portada MatematicasPortada Matematicas
Portada Matematicas
 
Software livre mitos e verdades
Software livre   mitos e verdadesSoftware livre   mitos e verdades
Software livre mitos e verdades
 
GNU/Linux - uma alternativa (nova versão)
GNU/Linux - uma alternativa (nova versão)GNU/Linux - uma alternativa (nova versão)
GNU/Linux - uma alternativa (nova versão)
 
GNU/Linux - uma alternativa
GNU/Linux - uma alternativaGNU/Linux - uma alternativa
GNU/Linux - uma alternativa
 
Entendendo as regras do Jogo - Go e Software Livre
Entendendo as regras do Jogo - Go e Software LivreEntendendo as regras do Jogo - Go e Software Livre
Entendendo as regras do Jogo - Go e Software Livre
 
Study: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving CarsStudy: The Future of VR, AR and Self-Driving Cars
Study: The Future of VR, AR and Self-Driving Cars
 

Similar a CS50x Permissions, Files, Users

Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012
Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012
Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012Jose L. Quiñones-Borrero
 
Get Started with Linux Management Command line Basic Knowledge
Get Started with Linux Management Command line Basic KnowledgeGet Started with Linux Management Command line Basic Knowledge
Get Started with Linux Management Command line Basic KnowledgeDavid Clark
 
Linux Getting Started
Linux Getting StartedLinux Getting Started
Linux Getting StartedAngus Li
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebookYash Gulati
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebookYash Gulati
 
Security coding c and c++ ch8 (1)
Security coding c and c++   ch8 (1)Security coding c and c++   ch8 (1)
Security coding c and c++ ch8 (1)Chia-Hao Tsai
 
Users and groups in Linux
Users and groups in LinuxUsers and groups in Linux
Users and groups in LinuxKnoldus Inc.
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsAhmed El-Arabawy
 
Linux: A Getting Started Presentation
Linux: A Getting Started PresentationLinux: A Getting Started Presentation
Linux: A Getting Started PresentationNap Ramirez
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadRavikumar Nandigam
 

Similar a CS50x Permissions, Files, Users (20)

Solaris basics
Solaris basicsSolaris basics
Solaris basics
 
Linux
LinuxLinux
Linux
 
Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012
Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012
Linux for Security Professionals (Tips and Tricks) - Init 6 10/2012
 
Linux
Linux Linux
Linux
 
Get Started with Linux Management Command line Basic Knowledge
Get Started with Linux Management Command line Basic KnowledgeGet Started with Linux Management Command line Basic Knowledge
Get Started with Linux Management Command line Basic Knowledge
 
Linux Getting Started
Linux Getting StartedLinux Getting Started
Linux Getting Started
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebook
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebook
 
Security coding c and c++ ch8 (1)
Security coding c and c++   ch8 (1)Security coding c and c++   ch8 (1)
Security coding c and c++ ch8 (1)
 
Adhocr T-dose 2012
Adhocr T-dose 2012Adhocr T-dose 2012
Adhocr T-dose 2012
 
Users and groups in Linux
Users and groups in LinuxUsers and groups in Linux
Users and groups in Linux
 
Course 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and PermissionsCourse 102: Lecture 14: Users and Permissions
Course 102: Lecture 14: Users and Permissions
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
beginner.en.print
beginner.en.printbeginner.en.print
beginner.en.print
 
Linux: A Getting Started Presentation
Linux: A Getting Started PresentationLinux: A Getting Started Presentation
Linux: A Getting Started Presentation
 
Host security
Host securityHost security
Host security
 
Host security
Host securityHost security
Host security
 
Online Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in HyderabadOnline Training in Unix Linux Shell Scripting in Hyderabad
Online Training in Unix Linux Shell Scripting in Hyderabad
 

Último

AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinojohnmickonozaleda
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 

Último (20)

AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
FILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipinoFILIPINO PSYCHology sikolohiyang pilipino
FILIPINO PSYCHology sikolohiyang pilipino
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 

CS50x Permissions, Files, Users

  • 1. Linux Tips: Files, Users & Permissions Fabio Emilio Costa http://plus.google.com/+FabioEmilioCosta http://twitter.com/HufflepuffBR http://www.facebook.com/fabiocosta0305 http://www.reddit.com/u/HufflepuffBR
  • 2. Some History ● Linux == Unix-Like ● Quacks like duck, walks like duck, but no duck ● Unix was created on 1960s ● Multi-user ● How avoid users to access forbidden files ● Permissions ● Groups ● Everything is treated as a file on Unix (directories, devices)
  • 3. Permissions ● Read (4) – cat, cp ... ● Write (2) – gedit, vi, emacs, rm.. ● eXecute (1) – run as programs (scripts) ● Numbers were normally used ● On directories: – Read: ls... – Write: touch, rm... – Execute: cd...
  • 4. Users ● Permissions are given on a file based on: – – Group: people who are from the same group the owner; – ● User: who created the file (normally); Others: nuff said... ls -l shows all the normal permissions
  • 5. Reading permissions on ls -l File type ● - – common file ● d – directory ● b – block device (disks) ● c – character devices (terms) ● l – symbolic link Owner's permissions Group's permissions Other's permissions ● read ● write ● execute ● - – unset permission -rw-------
  • 6. Users & Groups ● All permissions are based on users ● Normally indicated by either a name and/or a number ● On appliance, jharvard is user 1000 ● Can be seen on /etc/passwd file ● Users normally are parts of groups ● Groups can be used for accounting, security, administration; ● A user can be part of one or more groups; ● jharvard is part of wheel group (can use sudo) ● Can be seen on /etc/group file
  • 7. Manipulating permissions ● Changing Permissions: chmod (Change Mode); ● Changing the Owner of a file: chown (Change Owner); ● Changing the Group of a file: chgrp (Change Group); ● Just root can chown and chgrp; – ● On older Linux and Unix, owner could chown and chgrp, but that was a security risk (SetUID); Only root and owner can chmod;
  • 8. Changing permissions with chmod ● By numbers: sum the permissions numbers. Each number represents one into User, Group, Others (UGO) – ● Character indication: placing the needed permissions for a kind after a = symbol; – ● chmod u=rw,go=w bar Set/Unset: using the + symbol to set a permission and a – symbol to unset a permission (easier method); – ● chmod 644 foo chmod a+r,u+w baz Special group: All
  • 9. The root ● Special user ● Can do ANYTHING with a system... ● … including break it ● Has a special ID of 0 ● Many commands can be done just by root... ● … or users that can use sudo, from wheel group … ● … and jharvard is from wheel group
  • 10. "With great power comes great responsibility" (PARKER, Ben)
  • 11. Want to see Linux being broken? Running rm -rf / on Linux http://www.youtube.com/watch?v=D4fzInly Don't try this at home!!!!!
  • 12. Scripts ● On Windows, files are opened based on extension; ● .exe, .com, .bat – programs/scripts; ● On Unix, needs eXecution permission to run as a script; ● Any file with eXecution permission will be executed (if possible);