SlideShare a Scribd company logo
1 of 27
Download to read offline
Dr. D. P.
Mishra
Digitally signed by Dr. D. P.
Mishra
DN: cn=Dr. D. P. Mishra, o=durg,
ou=BIT,
email=dpmishra@bitdurg.ac.in,
c=IN
Date: 2023.03.20 13:20:44 +05'30'
File access permission
• In Unix-like operating systems such as Linux, file access permissions
are used to determine who can access a file and what actions they can
perform on it.
• There are three types of access permissions:
• read (r),
• write (w), and
• execute (x).
• These permissions can be set for three groups of users:
• the file owner,
• the group owner, and
• others.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
FAP
• The access permissions for a file can be viewed using the ls -l
command,
• It displays the file permissions as a string of ten characters.
• The first character indicates the type of file (e.g., "-" for a regular file,
"d" for a directory),
• and the next three characters indicate the owner's permissions,
• the following three indicate the group's permissions, and the
• final three indicate the permissions for others.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Let’s see file permissions in Linux with examples:
Type ls – l on terminal gives
$ ls - l
Here, we have highlighted ‘-rw-rw-r–‘and this is permissions given to the owner, user group and the world.
Here, the first ‘–‘ implies that we have selected a file
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
if it is a directory, d would have been shown.
The characters are pretty easy to remember.
• r = read permission
• w = write permission
• x = execute permission
• – = no permission
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
The first part of the code is ‘rw-‘.
This suggests that the owner ‘Home’ can:
• Read the file
• Write or edit the file
• He cannot execute the file since the execute bit is set to ‘-‘.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
The second part is ‘rw-‘.
It for the user group ‘Home’ and group-members can:
• Read the file
• Write or edit the file
The third part is for the world which means any user.
It says ‘r–‘. This means the user can only:
• Read the file
Changing FAP with chmod
• Say you do not want your colleague to see your personal images.
• This can be achieved by changing file permissions.
• We can use the ‘chmod’ command which stands for ‘change mode’.
• Using the command, we can set permissions (read, write, execute) on
a file/directory for the owner, group and the world.
Syntax: chmod permissions filename
There are 2 ways to use the command
1. Absolute mode
2. Symbolic mode
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Absolute(Numeric) Mode in Linux
• In this mode, file permissions
are not represented as
characters but a three-digit octal
number.
• The table below gives numbers
for all for permissions types.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Number Permission Type Symbol
0 No Permission —
1 Execute –x
2 Write -w-
3 Execute + Write -wx
4 Read r–
5 Read + Execute r-x
6 Read +Write rw-
7
Read + Write
+Execute
rwx
Permission in numeric mode
• The above way of changing permissions will work fine but you may
also need to know how to change permissions in numeric mode.
• chmod is used in much the same way
• instead of r, w, or x you will use numbers.
• What are the numbers?
• 0 = No Permission
• 1 = Execute
• 2 = Write
• 4 = Read
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
The various owners are represented as –
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
User Denotations
u user/owner
g group
o other
a all
Permissions in binary
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Octal Table
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
binary octal permissions
000 0 ---
001 1 --x
010 2 -w-
011 3 -wx
100 4 r--
101 5 r-x
110 6 rw-
111 7 rwx
777 = rwx rwx rwx
765 = rwx rw- r-x
654 = rw- r-x r--
Examples
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
In the above-given terminal window, we have changed the
permissions of the file ‘sample to ‘764’.
• ‘764’ absolute code says the following:
• Owner can read, write and execute
• Usergroup can read and write
• World can only read
This is shown as ‘-rwxrw-r–
Symbolic Mode in Linux
• In the Absolute mode, you
change permissions for all 3
owners.
• In the symbolic mode, you can
modify permissions of a
specific owner.
• It makes use of mathematical
symbols to modify the Unix file
permissions.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Operator Description
+
Adds a permission to a file
or directory
– Removes the permission
=
Sets the permission and
overrides the permissions
set earlier.
Examples
• chmod 777 workfolder
• Will give read, write, and execute permissions for everyone.
• chmod 700 workfolder Will give read, write, and execute permission
for the user, but nothing to everyone else.
• chmod 327 workfolder Will give write and execute (3) permission for
the user, w (2) for the group, and (7) read, write, and execute for other
users.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Task
1. create 3 files with touch command: files1, files2, files3.
2. Write the command line by using letters with chmod to set the
following permissions:
- rwxrwxr-x for file1
- r-x—x—x for file2
- ——xrwx for file3
3. Write the command line by using numbers with chmod to set the
following permissions:
- rwxrwxrwx for file4 (you have to prepare this file)
- -w------- for file5 (you have to prepare this file)
- rwx--x—x for folder1 (you have to prepare this folder)
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
We will not be using permissions in numbers like 755 but
characters like rwx. Let’s look into an example
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
FAP ..
• For changing the ownership of a file/directory, you can use the
following command:
$ chown user filename
In case you want to change the user as well as group for a file or
directory use the command
$ chown user:group filename
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
chgrp group_name filename ‘chgrp’ stands for change group.
Examples.
1. Change the file permissions to read, write, and execute for the owner, and
only read for others:
chmod 755 myfile.txt
2. Change the file permissions to read and write for the owner, and read
only for others:
chmod 644 myfile.txt
3. Add execute permission for the owner of the file:
chmod +x myfile.txt
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Examples..
4. Remove write permission for others from a file:
chmod o-w myfile.txt
5. Change the ownership of a file to a specific user:
chown username myfile.txt
6. Change the ownership of a file to a specific user and group:
chown username:groupname myfile.txt
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
Examples…
4. Remove write permission for others from a file:
chmod o-w myfile.txt
5. Change the ownership of a file to a specific user:
chown username myfile.txt
6. Change the ownership of a file to a specific user and group:
chown username:groupname myfile.txt
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
FAP Summary
• Linux being a multi-user system uses permissions and ownership for
security.
• There are three user types on a Linux system viz. User, Group and Other
• Linux divides the file permissions into read, write and execute denoted by
r,w, and x
• The permissions on a file can be changed by ‘chmod’ command which can
be further divided into Absolute and Symbolic mode
• The ‘chown’ command can change the ownership of a file/directory. Use the
following commands: chown user file or chown user:group file
• The ‘chgrp’ command can change the group ownership chrgrp group
filename
• What does x – eXecuting a directory mean? A: Being allowed to “enter” a dir
and gain possible access to sub-dirs.
Linux
Laboratory
-
B.Tech.
6th
CSE
-
Dr.
D.
P.
Mishra,
BIT
Durg
File Access Permission

More Related Content

What's hot

Chapter03 Creating And Managing User Accounts
Chapter03      Creating And  Managing  User  AccountsChapter03      Creating And  Managing  User  Accounts
Chapter03 Creating And Managing User AccountsRaja Waseem Akhtar
 
User, roles and privileges
User, roles and privilegesUser, roles and privileges
User, roles and privilegesYogiji Creations
 
Chapter10 Server Administration
Chapter10     Server  AdministrationChapter10     Server  Administration
Chapter10 Server AdministrationRaja Waseem Akhtar
 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemAnamika Singh
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating systemtittuajay
 
Introduction to Data Structure and Algorithm
Introduction to Data Structure and AlgorithmIntroduction to Data Structure and Algorithm
Introduction to Data Structure and AlgorithmSagacious IT Solution
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMSMegha Patel
 
Network servers
Network serversNetwork servers
Network serversOnline
 
Management file and directory in linux
Management file and directory in linuxManagement file and directory in linux
Management file and directory in linuxZkre Saleh
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithmsPiyush Rochwani
 
Database , 5 Semantic
Database , 5 SemanticDatabase , 5 Semantic
Database , 5 SemanticAli Usman
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linuxPrakash Poudel
 
Visibility control in java
Visibility control in javaVisibility control in java
Visibility control in javaTech_MX
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in LinuxHenry Osborne
 

What's hot (20)

Chapter03 Creating And Managing User Accounts
Chapter03      Creating And  Managing  User  AccountsChapter03      Creating And  Managing  User  Accounts
Chapter03 Creating And Managing User Accounts
 
User, roles and privileges
User, roles and privilegesUser, roles and privileges
User, roles and privileges
 
Chapter10 Server Administration
Chapter10     Server  AdministrationChapter10     Server  Administration
Chapter10 Server Administration
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Active directory slides
Active directory slidesActive directory slides
Active directory slides
 
Backup
BackupBackup
Backup
 
Functional dependency
Functional dependencyFunctional dependency
Functional dependency
 
file system in operating system
file system in operating systemfile system in operating system
file system in operating system
 
Introduction to Data Structure and Algorithm
Introduction to Data Structure and AlgorithmIntroduction to Data Structure and Algorithm
Introduction to Data Structure and Algorithm
 
5. protocol layering
5. protocol layering5. protocol layering
5. protocol layering
 
Transaction management DBMS
Transaction  management DBMSTransaction  management DBMS
Transaction management DBMS
 
Network servers
Network serversNetwork servers
Network servers
 
Management file and directory in linux
Management file and directory in linuxManagement file and directory in linux
Management file and directory in linux
 
Page replacement algorithms
Page replacement algorithmsPage replacement algorithms
Page replacement algorithms
 
Database , 5 Semantic
Database , 5 SemanticDatabase , 5 Semantic
Database , 5 Semantic
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
 
Visibility control in java
Visibility control in javaVisibility control in java
Visibility control in java
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Public key algorithm
Public key algorithmPublic key algorithm
Public key algorithm
 
Program Threats
Program ThreatsProgram Threats
Program Threats
 

Similar to File Access Permission

Linux files and file permission
Linux files and file permissionLinux files and file permission
Linux files and file permissionU.P Police
 
Lession1 Linux Preview
Lession1 Linux PreviewLession1 Linux Preview
Lession1 Linux Previewleminhvuong
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissionsShay Cohen
 
FILE PERMISSION OR ACCESS MODE
 FILE PERMISSION OR ACCESS MODE FILE PERMISSION OR ACCESS MODE
FILE PERMISSION OR ACCESS MODEVpmv
 
Introduction to linux day3
Introduction to linux day3Introduction to linux day3
Introduction to linux day3Gourav Varma
 
4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_CommandsGautam Raja
 
04-1-Linux.ppt
04-1-Linux.ppt04-1-Linux.ppt
04-1-Linux.pptEidTahir
 
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
 
intro unix/linux 09
intro unix/linux 09intro unix/linux 09
intro unix/linux 09duquoi
 
Unit 4 user and group
Unit 4 user and groupUnit 4 user and group
Unit 4 user and grouproot_fibo
 
Learning Linux v2.1
Learning Linux v2.1Learning Linux v2.1
Learning Linux v2.1sdiviney
 
File handling and permisions.pptx
File handling and permisions.pptxFile handling and permisions.pptx
File handling and permisions.pptxAkampaPhilomena
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentalsDima Gomaa
 
Linux day 2.ppt
Linux day  2.pptLinux day  2.ppt
Linux day 2.pptKalkey
 
101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3Acácio Oliveira
 

Similar to File Access Permission (20)

Linux files and file permission
Linux files and file permissionLinux files and file permission
Linux files and file permission
 
Basic Linux
Basic LinuxBasic Linux
Basic Linux
 
Lession1 Linux Preview
Lession1 Linux PreviewLession1 Linux Preview
Lession1 Linux Preview
 
06 users groups_and_permissions
06 users groups_and_permissions06 users groups_and_permissions
06 users groups_and_permissions
 
FILE PERMISSION OR ACCESS MODE
 FILE PERMISSION OR ACCESS MODE FILE PERMISSION OR ACCESS MODE
FILE PERMISSION OR ACCESS MODE
 
Ai module
Ai module Ai module
Ai module
 
Introduction to linux day3
Introduction to linux day3Introduction to linux day3
Introduction to linux day3
 
4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands4_Users_and_File_Permission_and_Directory_Commands
4_Users_and_File_Permission_and_Directory_Commands
 
OS Unit IV.ppt
OS Unit IV.pptOS Unit IV.ppt
OS Unit IV.ppt
 
Basic Linux day 2
Basic Linux day 2Basic Linux day 2
Basic Linux day 2
 
04-1-Linux.ppt
04-1-Linux.ppt04-1-Linux.ppt
04-1-Linux.ppt
 
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
 
intro unix/linux 09
intro unix/linux 09intro unix/linux 09
intro unix/linux 09
 
Unit 4 user and group
Unit 4 user and groupUnit 4 user and group
Unit 4 user and group
 
Learning Linux v2.1
Learning Linux v2.1Learning Linux v2.1
Learning Linux v2.1
 
Linux Security
Linux SecurityLinux Security
Linux Security
 
File handling and permisions.pptx
File handling and permisions.pptxFile handling and permisions.pptx
File handling and permisions.pptx
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
 
Linux day 2.ppt
Linux day  2.pptLinux day  2.ppt
Linux day 2.ppt
 
101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3
 

More from BIT DURG

JavaScript
JavaScriptJavaScript
JavaScriptBIT DURG
 
Understanding WWW
Understanding WWWUnderstanding WWW
Understanding WWWBIT DURG
 
Computer Networks
Computer NetworksComputer Networks
Computer NetworksBIT DURG
 
Computer Basics
Computer Basics Computer Basics
Computer Basics BIT DURG
 
ISDN & ATM
ISDN & ATMISDN & ATM
ISDN & ATMBIT DURG
 
Transport Control Protocol
Transport Control ProtocolTransport Control Protocol
Transport Control ProtocolBIT DURG
 
Routing Protocols
Routing ProtocolsRouting Protocols
Routing ProtocolsBIT DURG
 
Internet Protocol.pdf
Internet Protocol.pdfInternet Protocol.pdf
Internet Protocol.pdfBIT DURG
 
Intternetworking With TCP/IP
Intternetworking With TCP/IPIntternetworking With TCP/IP
Intternetworking With TCP/IPBIT DURG
 
Computer Network Basics
Computer Network BasicsComputer Network Basics
Computer Network BasicsBIT DURG
 
Types of Linux Shells
Types of Linux Shells Types of Linux Shells
Types of Linux Shells BIT DURG
 
Control flow and related shell cripts
Control flow and related shell criptsControl flow and related shell cripts
Control flow and related shell criptsBIT DURG
 
Basic Shell Programs
Basic Shell ProgramsBasic Shell Programs
Basic Shell ProgramsBIT DURG
 
Filters & Vi Editor
Filters & Vi EditorFilters & Vi Editor
Filters & Vi EditorBIT DURG
 
Basic Linux Commands
Basic Linux CommandsBasic Linux Commands
Basic Linux CommandsBIT DURG
 
Linux Installation
Linux InstallationLinux Installation
Linux InstallationBIT DURG
 
Basics of GNU & Linux
Basics of GNU & LinuxBasics of GNU & Linux
Basics of GNU & LinuxBIT DURG
 
National youth day
National youth dayNational youth day
National youth dayBIT DURG
 

More from BIT DURG (20)

HTML_DOM
HTML_DOMHTML_DOM
HTML_DOM
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Understanding WWW
Understanding WWWUnderstanding WWW
Understanding WWW
 
Computer Networks
Computer NetworksComputer Networks
Computer Networks
 
Computer Basics
Computer Basics Computer Basics
Computer Basics
 
ISDN & ATM
ISDN & ATMISDN & ATM
ISDN & ATM
 
Transport Control Protocol
Transport Control ProtocolTransport Control Protocol
Transport Control Protocol
 
Routing Protocols
Routing ProtocolsRouting Protocols
Routing Protocols
 
Internet Protocol.pdf
Internet Protocol.pdfInternet Protocol.pdf
Internet Protocol.pdf
 
Intternetworking With TCP/IP
Intternetworking With TCP/IPIntternetworking With TCP/IP
Intternetworking With TCP/IP
 
Computer Network Basics
Computer Network BasicsComputer Network Basics
Computer Network Basics
 
MySQL
MySQL MySQL
MySQL
 
Types of Linux Shells
Types of Linux Shells Types of Linux Shells
Types of Linux Shells
 
Control flow and related shell cripts
Control flow and related shell criptsControl flow and related shell cripts
Control flow and related shell cripts
 
Basic Shell Programs
Basic Shell ProgramsBasic Shell Programs
Basic Shell Programs
 
Filters & Vi Editor
Filters & Vi EditorFilters & Vi Editor
Filters & Vi Editor
 
Basic Linux Commands
Basic Linux CommandsBasic Linux Commands
Basic Linux Commands
 
Linux Installation
Linux InstallationLinux Installation
Linux Installation
 
Basics of GNU & Linux
Basics of GNU & LinuxBasics of GNU & Linux
Basics of GNU & Linux
 
National youth day
National youth dayNational youth day
National youth day
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 

File Access Permission

  • 1. Dr. D. P. Mishra Digitally signed by Dr. D. P. Mishra DN: cn=Dr. D. P. Mishra, o=durg, ou=BIT, email=dpmishra@bitdurg.ac.in, c=IN Date: 2023.03.20 13:20:44 +05'30'
  • 2. File access permission • In Unix-like operating systems such as Linux, file access permissions are used to determine who can access a file and what actions they can perform on it. • There are three types of access permissions: • read (r), • write (w), and • execute (x). • These permissions can be set for three groups of users: • the file owner, • the group owner, and • others. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 3. FAP • The access permissions for a file can be viewed using the ls -l command, • It displays the file permissions as a string of ten characters. • The first character indicates the type of file (e.g., "-" for a regular file, "d" for a directory), • and the next three characters indicate the owner's permissions, • the following three indicate the group's permissions, and the • final three indicate the permissions for others. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 5. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg Let’s see file permissions in Linux with examples: Type ls – l on terminal gives $ ls - l Here, we have highlighted ‘-rw-rw-r–‘and this is permissions given to the owner, user group and the world. Here, the first ‘–‘ implies that we have selected a file
  • 6. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg if it is a directory, d would have been shown. The characters are pretty easy to remember. • r = read permission • w = write permission • x = execute permission • – = no permission
  • 7. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg The first part of the code is ‘rw-‘. This suggests that the owner ‘Home’ can: • Read the file • Write or edit the file • He cannot execute the file since the execute bit is set to ‘-‘.
  • 8. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg The second part is ‘rw-‘. It for the user group ‘Home’ and group-members can: • Read the file • Write or edit the file The third part is for the world which means any user. It says ‘r–‘. This means the user can only: • Read the file
  • 9. Changing FAP with chmod • Say you do not want your colleague to see your personal images. • This can be achieved by changing file permissions. • We can use the ‘chmod’ command which stands for ‘change mode’. • Using the command, we can set permissions (read, write, execute) on a file/directory for the owner, group and the world. Syntax: chmod permissions filename There are 2 ways to use the command 1. Absolute mode 2. Symbolic mode Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 10. Absolute(Numeric) Mode in Linux • In this mode, file permissions are not represented as characters but a three-digit octal number. • The table below gives numbers for all for permissions types. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg Number Permission Type Symbol 0 No Permission — 1 Execute –x 2 Write -w- 3 Execute + Write -wx 4 Read r– 5 Read + Execute r-x 6 Read +Write rw- 7 Read + Write +Execute rwx
  • 11. Permission in numeric mode • The above way of changing permissions will work fine but you may also need to know how to change permissions in numeric mode. • chmod is used in much the same way • instead of r, w, or x you will use numbers. • What are the numbers? • 0 = No Permission • 1 = Execute • 2 = Write • 4 = Read Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 12. The various owners are represented as – Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg User Denotations u user/owner g group o other a all
  • 14. Octal Table Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg binary octal permissions 000 0 --- 001 1 --x 010 2 -w- 011 3 -wx 100 4 r-- 101 5 r-x 110 6 rw- 111 7 rwx 777 = rwx rwx rwx 765 = rwx rw- r-x 654 = rw- r-x r--
  • 15. Examples Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg In the above-given terminal window, we have changed the permissions of the file ‘sample to ‘764’. • ‘764’ absolute code says the following: • Owner can read, write and execute • Usergroup can read and write • World can only read This is shown as ‘-rwxrw-r–
  • 16. Symbolic Mode in Linux • In the Absolute mode, you change permissions for all 3 owners. • In the symbolic mode, you can modify permissions of a specific owner. • It makes use of mathematical symbols to modify the Unix file permissions. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg Operator Description + Adds a permission to a file or directory – Removes the permission = Sets the permission and overrides the permissions set earlier.
  • 17. Examples • chmod 777 workfolder • Will give read, write, and execute permissions for everyone. • chmod 700 workfolder Will give read, write, and execute permission for the user, but nothing to everyone else. • chmod 327 workfolder Will give write and execute (3) permission for the user, w (2) for the group, and (7) read, write, and execute for other users. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 18. Task 1. create 3 files with touch command: files1, files2, files3. 2. Write the command line by using letters with chmod to set the following permissions: - rwxrwxr-x for file1 - r-x—x—x for file2 - ——xrwx for file3 3. Write the command line by using numbers with chmod to set the following permissions: - rwxrwxrwx for file4 (you have to prepare this file) - -w------- for file5 (you have to prepare this file) - rwx--x—x for folder1 (you have to prepare this folder) Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 19. We will not be using permissions in numbers like 755 but characters like rwx. Let’s look into an example Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 20. FAP .. • For changing the ownership of a file/directory, you can use the following command: $ chown user filename In case you want to change the user as well as group for a file or directory use the command $ chown user:group filename Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 23. Examples. 1. Change the file permissions to read, write, and execute for the owner, and only read for others: chmod 755 myfile.txt 2. Change the file permissions to read and write for the owner, and read only for others: chmod 644 myfile.txt 3. Add execute permission for the owner of the file: chmod +x myfile.txt Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 24. Examples.. 4. Remove write permission for others from a file: chmod o-w myfile.txt 5. Change the ownership of a file to a specific user: chown username myfile.txt 6. Change the ownership of a file to a specific user and group: chown username:groupname myfile.txt Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 25. Examples… 4. Remove write permission for others from a file: chmod o-w myfile.txt 5. Change the ownership of a file to a specific user: chown username myfile.txt 6. Change the ownership of a file to a specific user and group: chown username:groupname myfile.txt Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg
  • 26. FAP Summary • Linux being a multi-user system uses permissions and ownership for security. • There are three user types on a Linux system viz. User, Group and Other • Linux divides the file permissions into read, write and execute denoted by r,w, and x • The permissions on a file can be changed by ‘chmod’ command which can be further divided into Absolute and Symbolic mode • The ‘chown’ command can change the ownership of a file/directory. Use the following commands: chown user file or chown user:group file • The ‘chgrp’ command can change the group ownership chrgrp group filename • What does x – eXecuting a directory mean? A: Being allowed to “enter” a dir and gain possible access to sub-dirs. Linux Laboratory - B.Tech. 6th CSE - Dr. D. P. Mishra, BIT Durg