SlideShare a Scribd company logo
1 of 47
﷽
‫اسالم‬
‫علیکم‬
‫مطابق‬ ‫کے‬ ‫حدیث‬ ‫ایک‬ ‫کی‬ ‫شریف‬ ‫بخاری‬
’’‫گ‬ٓ‫ا‬ ‫قیامت‬ ِ‫روز‬ ‫اسے‬ ‫گا‬ ‫چھپائے‬ ‫علم‬ ‫جو‬
‫گی۔‬ ‫جائے‬ ‫ڈالی‬ ‫لگام‬ ‫کی‬‘‘
LINUX IS NOT AN OPERATING
SYSTEM. IT‘S A PHILOSPHY
Be LinuX Be Free
PRESENTED BY:YAMI GROUP
PRESENTED TO:WHOLE CLASS
Yami Group
PRESENTATION
TOPIC
Basic Review of Linux Platform
+
Controlling Access to Files with
Linux File System Permissions
WHAT IS GNU/LINUX?
A free Unix-type operating system developed under the GNU
General Public License.
● Open source
● Popular
● Support most of the platforms available
HISTORY OF BEFORE
LINUX
1969
UNIX
1973 UNICS
Converted into Unix
1984
GUN Unix
‫مقابلہ‬
1990
Working on Kernel
By
Linus Torvalds
GNO &
MINIX
‫نہیں‬ ‫کرنل‬
‫تھا‬
Memory
Manager
creator
Utility of
MINIX
and GNO
Rewrite all utility
Of MINIX and GNO
As Competition of
UNIX
‫کیا‬ ‫ہے‬ ‫میں‬ ‫اصل‬ ‫لینکس‬
‫تاریخ‬ ‫کی‬ ‫اس‬ ‫اور‬
‫ہے‬ ‫کیا‬Assembly
language Write
1st
Ken Thompson,
Dennis Ritchie
In C language
1973, Rewrite
UNIX with C
Richard Stallman
GPL
Hacker
GNU(Free Software
Foundation )
starts under
GPL
Andrew Stuart
"Andy" Tanenbaum
What is
Linux/GNU?
1991
Kernel
Announcement in
Social Media Group
Comparison of
operating systems
https://en.wikipedia.org/wiki/Compari
son_of_operating_systems
‫یعنی‬ ‫نام‬ ‫کا‬ ‫سسٹم‬ ‫اس‬ Linux ‫لینکس‬‫کے‬ ‫الفاظ‬ ‫دو‬ ‫کو‬
‫لفظ‬ ‫پہال‬ ‫ہے۔‬ ‫گیا‬ ‫بنایا‬ ‫کر‬ ‫جوڑ‬ ‫کو‬ ‫حروف‬ ‫ابتدائی‬
LINUS ‫اس‬ ‫ہے۔‬ ‫نام‬ ‫کا‬ ‫بانی‬ ‫کے‬ ‫سسٹم‬ ‫اس‬ ‫جو‬ ‫ہے‬
‫یعنی‬ ‫حروف‬ ‫ابتدائی‬ ‫تین‬ ‫سے‬ ‫میں‬ ‫لفظ‬ LIN ‫منتخب‬
‫لفظ‬ ‫دوسرا‬ ‫ہیں۔‬ ‫گئے‬ ‫کئے‬ Unix ‫یعنی‬ ‫مخفف‬ ‫کا‬ UX
‫لفظ‬ ‫طرح‬ ‫اس‬ ‫گیا۔‬ ‫لیا‬ LINUX ‫ہے۔‬ ‫پاتا‬ ‫تشکیل‬
‫لینکس‬
Linux Distribution
SunOS, Solaris, HP-UX,
AIX, SCO UNIX
‫کرنل‬ ‫پہال‬ ‫سے‬ ‫سب‬
1994‫کیا‬ ‫جاری‬ ‫میں‬ ‫ء‬
‫گیا‬
‫اس‬‫سسٹم‬ ‫آپریٹنگ‬‫کو‬
‫لینس‬ ‫کے‬ ‫لینڈ‬ ‫ن‬ِ‫ف‬
‫نے‬ ‫ٹوروالڈز‬1991‫ء‬
‫میں‬‫کیا‬ ‫شروع‬
LINUX TODAY
• Linux has been used for many computing platforms
• PC, Supercomputer
• Commercial vendors moved in Linux itself to
provide freely distributed code. They make their
money by compiling up various software and
gathering them in a distributable format
• Red Hat, Slackware, etc.
• About 29 million people use Linux worldwide
LINUX DISTRIBUTION
• Red Hat Linux : One of the original Linux
distribution.
• The commercial, non-free version is Red
Hat Enterprise Linux, which is aimed at
big companies using Linux servers and
desktops in a big way
• Debian GNU/Linux : A free software
distribution. Popular for use on servers
• Gentoo Linux : Gentoo is a specialty
distribution meant for programmers
DISTRIBUTION OF LINUX ‫کی‬ ‫لینکس‬
‫تقسیم‬
WHY LINUX ‫لینکس‬‫خوبیا‬‫کی‬‫ں‬
‫کیا‬‫ہ‬‫ی‬‫ں‬‫؟‬Linux Provide Security
Powerful
It’s “free”
Multi-user
Multiprocessing
Multitasking
Multithreading
Linux is Virus Free!!
‫ک‬ ‫لینکس‬‫ے‬‫ائد‬‫ف‬‫ے‬ ‫سس‬ ‫لینکس‬‫ٹ‬‫انت‬‫م‬‫ہ‬‫مستحکم‬ ‫ائی‬‫ہ‬‫ی‬‫ں‬
‫مفت‬ ‫لینکس‬‫ہے‬
‫خطر‬‫کوئی‬ ‫کا‬ ‫وائرس‬‫ہ‬‫ن‬‫ہ‬‫ی‬‫ں‬‫سیکوئر‬ ‫کافی‬ ‫اور‬‫ہے‬‫وائرس‬ ‫مطلب‬
‫ا‬‫ٹ‬‫ن‬ ‫یک‬‫ہ‬‫ی‬‫ں‬‫کرتا‬‫۔‬
‫ک‬ ‫لینکس‬‫ے‬‫سات‬‫ھ‬‫ک‬ ‫ضرورت‬‫ے‬‫ساف‬‫ٹ‬‫س‬ ‫سب‬ ‫کی‬ ‫ویئر‬‫ے‬‫زیاد‬‫ہ‬
‫پ‬‫ہ‬‫ل‬‫ے‬‫س‬‫ے‬‫آتا‬‫نصب‬‫ہے‬
‫ک‬ ‫وقت‬ ‫کم‬ ‫از‬‫کم‬‫ے‬‫سات‬‫ھ‬‫اپن‬‫ے‬‫ساف‬ ‫تمام‬‫ٹ‬‫اپ‬‫ویئر‬‫ڈ‬‫ی‬‫ٹ‬
‫کب‬ ‫لینکس‬‫ھ‬‫ن‬ ‫ی‬‫ہ‬‫ی‬‫ں‬‫سست‬‫ہ‬‫تا‬ ‫و‬‫۔‬
Some basic Commands in LINUX
SOME BASIC COMMANDS IN
LINUXCommand Name Description
1. su
Example: su then Pswd yami
‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫ہونے‬ ‫ن‬ِ‫گ‬‫لو‬ ‫سے‬ ‫یوزر‬ ‫پر‬ُ‫س‬
2. mkdir
Example: mkdir yami
‫لیئے‬ ‫کے‬ ‫بنانے‬ ‫اورڈائریکٹری‬ ‫فولڈر‬ ‫نیا‬‫۔۔۔۔۔‬
3. pwd
Example: pwd and press enter
‫لیئے‬ ‫کے‬ ‫کرنے‬ ‫چیک‬ ‫ڈائریکٹری‬ ‫ورکنگ‬
‫۔۔۔۔۔‬
4. ls and enter ‫کر‬ ‫ہم‬ ‫کام‬ ‫جو‬ ‫جو‬ ‫ہے‬ ‫تی‬ ‫کر‬ ‫ظاہر‬ ‫کو‬ ‫لسٹ‬
‫ہوں۔۔‬ ‫رہے‬
5. touch
Example: touch yami
‫استعمال‬ ‫لیئے‬ ‫کے‬ ‫بنانے‬ ‫فائل‬ ‫خالی‬ ‫ایک‬
‫ہے۔‬ ‫جاتی‬ ‫کی‬
6. ls –l and enter ‫۔۔۔۔۔‬ ‫ہے‬ ‫تی‬ ‫کر‬ ‫ظاہر‬ ‫کو‬ ‫لسٹ‬ ‫ڈیٹیل‬
7. “cd” or “cd ..” and press Ent. ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کرنے‬ ‫تبدیل‬ ‫کر‬ ‫پاتھ‬
SOME BASIC COMMANDS IN
LINUXCommand Name Description
8. rm file-name
Example: rm yami
‫لیئے۔۔۔۔۔‬ ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫فائل‬ ‫بھی‬ ‫کسی‬
9. rm –r folder-name
Example : rm –r yami
‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫فولڈر‬ ‫خالی‬ ‫بھی‬ ‫کسی‬
‫لیئے۔۔۔۔۔‬
10. rm –rf folder-name
Example: rm –rf yami
‫لیئے۔۔۔۔۔‬ ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫فولڈر‬ ‫بھی‬ ‫کسی‬
11.date and press Ent. ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫ٹائم‬ ‫اور‬ ‫ڈیٹ‬
12. date m/d/t/year ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫تبدیل‬ ‫ٹائم‬ ‫اور‬ ‫ڈیٹ‬
13. Clear or Reset …… ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کرنے‬ ‫کلئیر‬ ‫کو‬ ‫سکرین‬
14. cal year-name ‫سال‬ ‫آگے‬ ‫اور‬ ‫لیئے‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کلینڈر‬
‫دیں۔‬ ‫لکھ‬
SOME BASIC COMMANDS IN
LINUXCommand Name Description
15. cal m/year-name ‫لکھ‬ ‫سال‬ ‫آگے‬ ‫اور‬ ‫لیئے‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کلینڈر‬
‫دیں‬
16. cp s-file d-file
Example : cp yami df
‫لیئے۔۔۔۔‬ ‫کرنے‬ ‫کاپی‬ ‫کو‬ ‫فولڈر‬ ‫و‬ ‫فائل‬ ‫بھی‬ ‫کسی‬‫۔‬
17. cat filename
Example : cat yami
‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کانٹنٹ‬ ‫کے‬ ‫فائل‬
18. head yami
Example : head yami
‫پہلی‬ ‫کی‬ ‫فائل‬10‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫الئنز‬
19. tail yami
Example : tail yami
‫آخری‬ ‫کی‬ ‫فائل‬10‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫الئنز‬
20. head –n yami or tail b
Example : head –n yami
‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کو‬ ‫الئنز‬ ‫منتخب‬
SOME BASIC COMMANDS IN
LINUXCommand Name Description
21. wc –w file name
Example : wc –w yami
‫ہے۔۔۔۔۔۔‬ ‫رکرواتی‬ ‫و‬ُ‫ش‬ ‫الفاظ‬ ‫ٹوٹل‬ ‫کے‬ ‫فائل‬
22. wc –l file name
Example : wc –l yami
‫ہے۔۔۔۔۔۔‬ ‫رکرواتی‬ ‫و‬ُ‫ش‬ ‫الئنز‬ ‫ٹوٹل‬ ‫کی‬ ‫فائل‬
23. wc –c file name
Example : wc –c yami
‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬‫کےکریکٹر‬ ‫فائل‬
24. wc file name
Example : wc yami
‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫وکروانے‬ُ‫ش‬ ‫معلومات‬ ‫مکمل‬ ‫کی‬ ‫فائل‬
25. tail yami
Example : tail yami
‫آخری‬ ‫کی‬ ‫فائل‬10‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫الئنز‬
26. vi file name
Example : vi zubi
‫اور‬ ‫لیئے‬ ‫کے‬ ‫کروانے‬ ‫ایڈ‬ ‫ڈیٹا‬ ‫اور‬ ‫بنانے‬ ‫فائل‬
‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫محفوظس‬
‫پار‬‫ٹ‬‫کیس‬ ‫یشن‬‫ے‬‫بنات‬‫ے‬‫ہ‬‫ی‬‫ں‬‫ن‬ُ‫ا‬‫اور‬‫کا‬
‫وغیر‬ ‫سائز‬‫ہ‬‫کیس‬‫ے‬
‫دیک‬‫ھ‬‫ت‬‫ے‬‫ہ‬‫ی‬‫ں‬
SOME BASIC COMMANDS IN
LINUX
Command Name Description
27. useradd u-name
Example : useradd yami
‫کیلئے۔۔۔۔۔۔‬ ‫کرنے‬ ‫ایڈ‬ ‫یوزر‬ ‫نیا‬
28. passwd u-name
Example : passwd yami
‫کیلئے۔۔۔۔۔۔‬ ‫نے‬ ‫کر‬ ‫ایڈ‬ ‫پاسورڈ‬
29. cat , more, vi, view,
Example :vi /etc/passwd
‫واسطے‬ ‫کرنے‬ ‫ایڈٹ‬ ‫کو‬ ‫فائل‬ ‫اور‬ ‫دیکھنے‬ ‫کو‬ ‫فائل‬
‫کرے۔۔۔‬ ‫یوز‬ ‫کو‬ ‫کمانڈ‬ ‫اس‬
30. userdel –r/f u-name
Example : userdel –r /f yami
‫۔۔۔۔۔‬ ‫کیلئے‬ ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫یوزر‬ ‫اپنے‬
31. usermod –s /sbin/nologin u-
name
Example : usermod –s
/sbin/nologin zubi
‫کرنےکیلئے۔۔۔۔۔‬ ‫ایبل‬ ‫ڈس‬ ‫کو‬ ‫یوزر‬
‫طریق‬ ‫افیکل‬‫ر‬‫گ‬‫ے‬‫ی‬ ‫نال‬‫وزر‬
‫نو‬‫ں‬‫کدا‬‫ں‬‫ای‬‫ڈ‬‫دا‬ ‫کری‬
‫وا؟؟‬
SOME BASIC COMMANDS IN
LINUXCommand Name Description
32. su u name
Example : su zubi
‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫جانے‬ ‫پر‬ ‫یوزر‬ ‫لوکل‬ ‫سے‬ ‫یوزر‬ ‫سوئچ‬
33. usermod –s /bin/bash uname
Example : usermod –s /bin/bash zubi
and check by cat
‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫ایبل‬ ‫ان‬ ‫کو‬ ‫زر‬ ‫یو‬
34. cat , more, vi, view,
Example :vi /etc/passwd
‫اس‬ ‫واسطے‬ ‫کرنے‬ ‫ایڈٹ‬ ‫کو‬ ‫فائل‬ ‫اور‬ ‫دیکھنے‬ ‫کو‬ ‫فائل‬
‫کرے۔۔۔‬ ‫یوز‬ ‫کو‬ ‫کمانڈ‬
35. userdel –r/f u-name
Example : userdel –r /f yami
‫۔۔۔۔۔‬ ‫کیلئے‬ ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫یوزر‬ ‫اپنے‬
36. usermod –s /sbin/nologin u-name
Example : usermod –s /sbin/nologin
zubi
‫کرنےکیلئے۔۔۔۔۔‬ ‫ایبل‬ ‫ڈس‬ ‫کو‬ ‫یوزر‬
SOME BASIC COMMANDS IN
LINUXCommand Name Description
37. info
Example : info +Enter
‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫انفارمیشن‬
38. Exit or logout or halt
Example : halt and press enter
‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫ختم‬ ‫اور‬ ‫ن‬ َ‫ڈاو‬ ‫شٹ‬
39. cat , more, vi, view,
Example :vi /etc/passwd
‫اس‬ ‫واسطے‬ ‫کرنے‬ ‫ایڈٹ‬ ‫کو‬ ‫فائل‬ ‫اور‬ ‫دیکھنے‬ ‫کو‬ ‫فائل‬
‫کرے۔۔۔‬ ‫یوز‬ ‫کو‬ ‫کمانڈ‬
40. userdel –r/f u-name
Example : userdel –r /f yami
‫۔۔۔۔۔‬ ‫کیلئے‬ ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫یوزر‬ ‫اپنے‬
41. usermod –s /sbin/nologin u-name
Example : usermod –s /sbin/nologin
zubi
‫کرنےکیلئے۔۔۔۔۔‬ ‫ایبل‬ ‫ڈس‬ ‫کو‬ ‫یوزر‬
SOME BASIC COMMANDS IN
LINUX
Command Name Description
42. df [options]
Example : df yami
‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫جگہ‬ ‫بقیہ‬ ‫اور‬ ‫سپیس‬ ‫شدہ‬ ‫استعمال‬
‫لیئے۔۔۔۔۔۔‬
43. du [options]
Example : du yami
‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫دیکھنے‬ ‫اسکو‬ ‫ہے‬ ‫لیتی‬ ‫فائل‬ ‫ہر‬ ‫جگہ‬ ‫کتنی‬.
44. less [options] [filename]
Example :less yami
‫کو‬ ‫مواد‬ ‫کے‬ ‫صفحے‬ ‫ایک‬ ‫فائل‬ ‫ایک‬ ‫میں‬ ‫وقت‬ ‫ایک‬
‫۔۔۔۔۔۔‬ ‫لیئے‬ ‫کے‬ ‫دیکھنے‬.
45. echo
Example : echo + enter
‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کو‬ ‫آرگومنٹ‬
46. Man ls
Example : man ls + enter
‫۔۔۔۔۔‬ ‫لیئے‬ ‫کے‬ ‫جاننے‬ ‫کو‬ ‫کمانڈز‬ ‫کی‬ ‫قسم‬ ‫خاص‬
SOME BASIC COMMANDS IN
LINUXCommand Name Description
47. Ps –e
Example : ps –e
‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫پروسیس‬ ‫تمام‬
48. pstree
Example : pstree + enter
‫لے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کو‬ ‫پروسس‬ ‫میں‬ ‫شکل‬ ‫کی‬ ‫ٹری‬ ‫ایک‬
‫لیئے۔۔۔۔۔۔‬
49. top
Example :top + enter
‫۔۔۔‬ ‫لیئے‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫پروسس‬ ‫انٹریکٹیو‬
50. vi mycron
Example : vi mycron + Enter
‫۔۔۔۔۔۔۔۔۔‬ ‫بیسٹ‬ ‫مائی‬ ‫ایڈیٹر‬
51. History
Example : history + enter
‫۔۔۔۔۔‬ ‫لیے‬ ‫کے‬ ‫کرنے‬ ‫چیک‬ ‫ہسٹری‬
SOME BASIC COMMANDS IN
LINUXCommand Name Description
52. whoami
Example : whoami + enter
‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫یوزر‬ ‫کرنٹ‬
53. cat /etc/shells
Example : cat /etc/shells
‫کو‬ ‫شلز‬‫لیئے۔۔۔۔۔۔‬ ‫لے‬ ‫کروانے‬ ‫و‬ُ‫ش‬
54. top
Example :top + enter
‫۔۔۔‬ ‫لیئے‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫پروسس‬ ‫انٹریکٹیو‬
55. vi mycron
Example : vi mycron + Enter
‫۔۔۔۔۔۔۔۔۔‬ ‫بیسٹ‬ ‫مائی‬ ‫ایڈیٹر‬
56. History
Example : history + enter
‫۔۔۔۔۔‬ ‫لیے‬ ‫کے‬ ‫کرنے‬ ‫چیک‬ ‫ہسٹری‬
HOW TO CONFIGURE INTERNET IN RHEL
‫س‬ ‫سب‬‫ے‬‫پ‬‫ہ‬‫ل‬‫ے‬‫اپنا‬‫ٹ‬‫کری‬ ‫اوپن‬‫رمینل‬‫ں‬
‫اپن‬‫ے‬‫نی‬‫ٹ‬‫کرن‬ ‫چیک‬‫کو‬ ‫ورک‬‫ے‬‫ک‬‫ے‬‫لیئ‬‫ے‬‫ی‬‫ہ‬‫کمان‬‫ڈ‬‫لگائی‬‫ں‬
#service network restart
‫می‬ ‫بعد‬ ‫اور‬‫ں‬‫اسکا‬
IP
‫کری‬ ‫چیک‬‫ں‬‫کمان‬ ‫اس‬‫ڈ‬‫س‬‫ے‬
# ifconfih
MAIN TOPIC
Controlling Access to Files with
Linux File System Permissions
Types of Permissions:-
There are two types of permissions
• Local Permissions
• Network Permissions
• Local Permissions:-
Within a system or standalone system, permissions
applied are called local permissions.
• Network Permissions:-
Over the network, permissions applied on a system are called
network permissions, i.e., shared device permissions.
Local Permissions
Types of Permissions in Linux:-
Read ( r )
Write ( w )
Execute ( x )
Sequence of permissions is important. We can check the file
properties to see the permissions.
TO SEE THE PROPERTIES:-
# ls -l
First column of properties is the permissions of the file or directory. There are 10 slots of the
permission column. We divide these ten slots into 4 segments.
- - - - - - - - - -
1 slot 3 slots 3 slots 3 slots
• First segment contains only the one slot (first slot only).
• Second segment contains three slots (next three slots).
• Third segment contains three slots (next three slots of remaining).
• Forth segment contains also three slots (last three slots).
1st Segment 2nd Segment:-
If the slot is “–“, then it is a file.
If the slot is “d”, then it is a directory.
If the slot is “l”, then it is a link file
(shortcut).
2nd segment shows the owner’s (file creator)
permissions.
rwx means read, write and execute (all
permissions) permissions.
_wx means only write and execute
permissions.
_ _ x means only execute permission.
r _ x means only read and execute
permissions.
rw_ means only read and write permissions.
_ _ _ means no permissions.
3rd Segment:- 4th Segment:-
3rd segment shows the owner’s primary group
permissions.
rwx means read, write and execute (all
permissions) permissions.
_wx means only write and execute permissions.
_ _ x means only execute permission.
r _ x means only read and execute permissions.
rw_ means only read and write permissions.
_ _ _ means no permissions.
4th Segment:-
4th segment shows the others permissions, other
than owner’s primary group permissions. Others
are also called world users.
rwx means read, write and execute (all
permissions) permissions.
_wx means only write and execute permissions.
_ _ x means only execute permission.
r _ x means only read and execute permissions.
rw_ means only read and write permissions.
_ _ _ means no permissions.
‫ڈ‬‫اریک‬‫ٹ‬‫کرنا‬ ‫چیک‬‫کو‬ ‫پرمیشن‬ ‫کی‬ ‫ری‬
To Check the Permissions of a File/Directory:-
# ls -l file-name
# ls -l Yami
To Change the Permissions:-
chmod command is used to change any file or directory permissions.
METHODS OF CHANGE PERMISSIONS
Identifier Method
Number System Method
IDENTIFIER METHOD:-
Identifiers which are used are shown below:
• ‘u’ for Owner
• ‘g’ for group
• ‘o’ for others
• ‘a’ for all
THERE ARE THREE PERMISSIONS READ, WRITE
AND EXECUTE ARE AVAILABLE IN LINUX.
There are three permissions
read, write and execute are
available in Linux.
Actions:-
Add permissions ‘+’
Remove permissions ‘-‘
Syntax:
# chmod
identifier action permission
file/dir-name
Example:-
# chmod g+x Yami
This will add a owner’s primary
group permission execute on abc file.
Example To Add & Remove the
Permissions:-
# chmod u-x, g-x, o+w Yami
Problem:-
Give the read, write and execute
permissions to the owner, give read and
write to primary group and give read
permissions to the others.
Owner = rwx
Group = rw_
Others = r_ _
Solution:-
# chmod u+rwx, g+rw, o+r
Yami
#chmod a+r, u+wx, g+w Yami
output:-
_rwxrw_r_ _
NUMBER SYSTEM METHOD:-
In number system following
numbers are assigned to each
permission.
• r = 4
• w = 2
• x = 1
Full Access or Full
Permission:-
4+2+1 = 7
7 means full access (rwx) as
4+2+1=7
• rw_ is equivalent to 6, as 4+2=6
• r_ _ is equivalent to 4
• r_x is equivalent to 5, as 4+1
• _wx is equivalent to 3, as 2+1=3
• _ _ x is equivalent to 1
• 0 means no permissions (access)
Example:-
Required Result: _rwx rw_ r_ _
# chmod 764 yami
Example:-
Present Permissions Status:
_ rwx rw_ r_ _
Required Result:
_ rw_ r_ _ r_x
#chmod 645 yami
SPECIAL PERMISSION:- (STICKY BIT)
• It is used on that directory or file on which everyone has full control. i.e. , tmp
directory.
•
• Delete permission is not given. One user cannot delete other user’s files.
• 1 is used for numeric value of sticky bit.
• Its symbol is “t”. For example, -rwxrwxrwt.
ADD A STICKY BIT:-
If we want to add a sticky bit on the data directory, then we will execute the following
command.
# chmod 1777 data
where “1” is to add a sticky bit.
Remove a Sticky Bit:-
# chmod 777 data
Or # chmod 0777 data
Sticky bit is not applicable on owner of the file or directory.
DEFAULT PERMISSIONS
• In windows OS everyone has by default full control on a file or directory.
• In Linux by default permission on a file is 644 (- rw- r- - r- -).
• And by default permission on a directory is 755 (d rwx r-x r-x).
• Default permissions depend upon umask (user mask) value.
• Default umask is 022
• In the case of directory 777 – 022 = 755
• And in case of file 666 – 022 = 644
• Full access umask is 000.
• By default root has a umask 022
• And regular account’s umask is 002.
• 027,022,002 have some common umask used in Linux.
• In case of directory we subtract the umask value from 777.
• And in the case of a file we subtract the umask value from 666.
• If the resultant value is less than 0, then this will be considered to 0
DEFAULT PERMISSIONS
DEFAULT PERMISSIONS
To see the Umask value:-
# umask
To Change the umask:-
# umask 002
Thank You
For
Listening
Linux File Permissions

More Related Content

What's hot

User administration concepts and mechanisms
User administration concepts and mechanismsUser administration concepts and mechanisms
User administration concepts and mechanismsDuressa Teshome
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory StructureKevin OBrien
 
Power Point Presentation on Open Source Software
Power Point Presentation on Open Source Software Power Point Presentation on Open Source Software
Power Point Presentation on Open Source Software opensourceacademy
 
Linux red hat overview and installation
Linux red hat overview and installationLinux red hat overview and installation
Linux red hat overview and installationdevenderbhati
 
Linux command ppt
Linux command pptLinux command ppt
Linux command pptkalyanineve
 
Operating systems linux
Operating systems linuxOperating systems linux
Operating systems linuxwilliam_morg
 
RedHat Linux
RedHat LinuxRedHat Linux
RedHat LinuxApo
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentalsRaghu nath
 
Linux Administration
Linux AdministrationLinux Administration
Linux AdministrationHarish1983
 
Linux ppt
Linux pptLinux ppt
Linux pptlincy21
 
package mangement
package mangementpackage mangement
package mangementARYA TM
 
Linux directory structure by jitu mistry
Linux directory structure by jitu mistryLinux directory structure by jitu mistry
Linux directory structure by jitu mistryJITU MISTRY
 
Windows operating system
Windows operating systemWindows operating system
Windows operating systemDhairya Joshi
 

What's hot (20)

User administration concepts and mechanisms
User administration concepts and mechanismsUser administration concepts and mechanisms
User administration concepts and mechanisms
 
Intro to linux
Intro to linuxIntro to linux
Intro to linux
 
Linux
Linux Linux
Linux
 
Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Power Point Presentation on Open Source Software
Power Point Presentation on Open Source Software Power Point Presentation on Open Source Software
Power Point Presentation on Open Source Software
 
Linux red hat overview and installation
Linux red hat overview and installationLinux red hat overview and installation
Linux red hat overview and installation
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Linux command ppt
Linux command pptLinux command ppt
Linux command ppt
 
Operating systems linux
Operating systems linuxOperating systems linux
Operating systems linux
 
Linux os and its features
Linux os and its featuresLinux os and its features
Linux os and its features
 
RedHat Linux
RedHat LinuxRedHat Linux
RedHat Linux
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
 
Windows registry forensics
Windows registry forensicsWindows registry forensics
Windows registry forensics
 
Linux Administration
Linux AdministrationLinux Administration
Linux Administration
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Linux OS presentation
Linux OS presentationLinux OS presentation
Linux OS presentation
 
package mangement
package mangementpackage mangement
package mangement
 
Linux directory structure by jitu mistry
Linux directory structure by jitu mistryLinux directory structure by jitu mistry
Linux directory structure by jitu mistry
 
Windows operating system
Windows operating systemWindows operating system
Windows operating system
 

Viewers also liked

Javascript in urdu - Muhammad Danish Irshad
Javascript in urdu - Muhammad Danish IrshadJavascript in urdu - Muhammad Danish Irshad
Javascript in urdu - Muhammad Danish IrshadMuhammad Danish
 
C and c++ in 5 days
C and c++ in 5 daysC and c++ in 5 days
C and c++ in 5 daysMohamedsohel
 
Html and css in urdu by muhammad danish irshad
Html and css in urdu by muhammad danish irshadHtml and css in urdu by muhammad danish irshad
Html and css in urdu by muhammad danish irshadMuhammad Danish
 
Tib e nabwai urdu A Presentation By Mr Allah Dad Khan Former Director Genera...
Tib e nabwai urdu  A Presentation By Mr Allah Dad Khan Former Director Genera...Tib e nabwai urdu  A Presentation By Mr Allah Dad Khan Former Director Genera...
Tib e nabwai urdu A Presentation By Mr Allah Dad Khan Former Director Genera...Mr.Allah Dad Khan
 
Learn html in urdu
Learn html in urduLearn html in urdu
Learn html in urduSyed Javeed
 
Php urdu final book
Php urdu final bookPhp urdu final book
Php urdu final bookSyed Javeed
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)anandvaidya
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linuxanandvaidya
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux pptOmi Vichare
 
Human sexual intercourse
Human sexual intercourseHuman sexual intercourse
Human sexual intercourseDinDin Horneja
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt onu9
 

Viewers also liked (15)

Javascript in urdu - Muhammad Danish Irshad
Javascript in urdu - Muhammad Danish IrshadJavascript in urdu - Muhammad Danish Irshad
Javascript in urdu - Muhammad Danish Irshad
 
C and c++ in 5 days
C and c++ in 5 daysC and c++ in 5 days
C and c++ in 5 days
 
Html and css in urdu by muhammad danish irshad
Html and css in urdu by muhammad danish irshadHtml and css in urdu by muhammad danish irshad
Html and css in urdu by muhammad danish irshad
 
Tib e nabwai urdu A Presentation By Mr Allah Dad Khan Former Director Genera...
Tib e nabwai urdu  A Presentation By Mr Allah Dad Khan Former Director Genera...Tib e nabwai urdu  A Presentation By Mr Allah Dad Khan Former Director Genera...
Tib e nabwai urdu A Presentation By Mr Allah Dad Khan Former Director Genera...
 
Learn html in urdu
Learn html in urduLearn html in urdu
Learn html in urdu
 
Php urdu final book
Php urdu final bookPhp urdu final book
Php urdu final book
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Linux commands
Linux commandsLinux commands
Linux commands
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Linux Introduction (Commands)
Linux Introduction (Commands)Linux Introduction (Commands)
Linux Introduction (Commands)
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux ppt
 
Human sexual intercourse
Human sexual intercourseHuman sexual intercourse
Human sexual intercourse
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 

Similar to Linux File Permissions

INTRODUCTION TO LINUX
INTRODUCTION TO LINUXINTRODUCTION TO LINUX
INTRODUCTION TO LINUXhafees4
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.pptKiranMantri
 
Intro To Linux
Intro To LinuxIntro To Linux
Intro To Linuxtechlug
 
LINUX
LINUXLINUX
LINUXARJUN
 
Linux: An Unbeaten Empire
Linux: An Unbeaten EmpireLinux: An Unbeaten Empire
Linux: An Unbeaten EmpireYogesh Sharma
 
Linux: A Getting Started Presentation
Linux: A Getting Started PresentationLinux: A Getting Started Presentation
Linux: A Getting Started PresentationNap Ramirez
 
A beginners introduction to unix
A beginners introduction to unixA beginners introduction to unix
A beginners introduction to unixzafarali1981
 
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
 
Introduction to Linux for bioinformatics
Introduction to Linux for bioinformaticsIntroduction to Linux for bioinformatics
Introduction to Linux for bioinformaticsBITS
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.pptLuigysToro
 

Similar to Linux File Permissions (20)

Unix environment [autosaved]
Unix environment [autosaved]Unix environment [autosaved]
Unix environment [autosaved]
 
Introduce to linux
Introduce to linuxIntroduce to linux
Introduce to linux
 
INTRODUCTION TO LINUX
INTRODUCTION TO LINUXINTRODUCTION TO LINUX
INTRODUCTION TO LINUX
 
Unix environment
Unix environmentUnix environment
Unix environment
 
Shell_Scripting.ppt
Shell_Scripting.pptShell_Scripting.ppt
Shell_Scripting.ppt
 
Solaris basics
Solaris basicsSolaris basics
Solaris basics
 
Unix environment [autosaved]
Unix environment [autosaved]Unix environment [autosaved]
Unix environment [autosaved]
 
Intro To Linux
Intro To LinuxIntro To Linux
Intro To Linux
 
LINUX
LINUXLINUX
LINUX
 
Linux: An Unbeaten Empire
Linux: An Unbeaten EmpireLinux: An Unbeaten Empire
Linux: An Unbeaten Empire
 
Linux fundamentals
Linux fundamentalsLinux fundamentals
Linux fundamentals
 
Unix - An Introduction
Unix - An IntroductionUnix - An Introduction
Unix - An Introduction
 
Linux: A Getting Started Presentation
Linux: A Getting Started PresentationLinux: A Getting Started Presentation
Linux: A Getting Started Presentation
 
A beginners introduction to unix
A beginners introduction to unixA beginners introduction to unix
A beginners introduction to unix
 
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
 
Linux
LinuxLinux
Linux
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 
Introduction to Linux for bioinformatics
Introduction to Linux for bioinformaticsIntroduction to Linux for bioinformatics
Introduction to Linux for bioinformatics
 
linux-lecture4.ppt
linux-lecture4.pptlinux-lecture4.ppt
linux-lecture4.ppt
 

Recently uploaded

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsManeerUddin
 
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
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
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
 
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
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxVanesaIglesias10
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 

Recently uploaded (20)

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Food processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture honsFood processing presentation for bsc agriculture hons
Food processing presentation for bsc agriculture hons
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.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
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
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
 
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)
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptxROLES IN A STAGE PRODUCTION in arts.pptx
ROLES IN A STAGE PRODUCTION in arts.pptx
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 

Linux File Permissions

  • 1. ﷽ ‫اسالم‬ ‫علیکم‬ ‫مطابق‬ ‫کے‬ ‫حدیث‬ ‫ایک‬ ‫کی‬ ‫شریف‬ ‫بخاری‬ ’’‫گ‬ٓ‫ا‬ ‫قیامت‬ ِ‫روز‬ ‫اسے‬ ‫گا‬ ‫چھپائے‬ ‫علم‬ ‫جو‬ ‫گی۔‬ ‫جائے‬ ‫ڈالی‬ ‫لگام‬ ‫کی‬‘‘
  • 2. LINUX IS NOT AN OPERATING SYSTEM. IT‘S A PHILOSPHY Be LinuX Be Free
  • 3. PRESENTED BY:YAMI GROUP PRESENTED TO:WHOLE CLASS Yami Group
  • 4. PRESENTATION TOPIC Basic Review of Linux Platform + Controlling Access to Files with Linux File System Permissions
  • 5. WHAT IS GNU/LINUX? A free Unix-type operating system developed under the GNU General Public License. ● Open source ● Popular ● Support most of the platforms available
  • 6. HISTORY OF BEFORE LINUX 1969 UNIX 1973 UNICS Converted into Unix 1984 GUN Unix ‫مقابلہ‬ 1990 Working on Kernel By Linus Torvalds GNO & MINIX ‫نہیں‬ ‫کرنل‬ ‫تھا‬ Memory Manager creator Utility of MINIX and GNO Rewrite all utility Of MINIX and GNO As Competition of UNIX ‫کیا‬ ‫ہے‬ ‫میں‬ ‫اصل‬ ‫لینکس‬ ‫تاریخ‬ ‫کی‬ ‫اس‬ ‫اور‬ ‫ہے‬ ‫کیا‬Assembly language Write 1st Ken Thompson, Dennis Ritchie In C language 1973, Rewrite UNIX with C Richard Stallman GPL Hacker GNU(Free Software Foundation ) starts under GPL Andrew Stuart "Andy" Tanenbaum
  • 7. What is Linux/GNU? 1991 Kernel Announcement in Social Media Group Comparison of operating systems https://en.wikipedia.org/wiki/Compari son_of_operating_systems ‫یعنی‬ ‫نام‬ ‫کا‬ ‫سسٹم‬ ‫اس‬ Linux ‫لینکس‬‫کے‬ ‫الفاظ‬ ‫دو‬ ‫کو‬ ‫لفظ‬ ‫پہال‬ ‫ہے۔‬ ‫گیا‬ ‫بنایا‬ ‫کر‬ ‫جوڑ‬ ‫کو‬ ‫حروف‬ ‫ابتدائی‬ LINUS ‫اس‬ ‫ہے۔‬ ‫نام‬ ‫کا‬ ‫بانی‬ ‫کے‬ ‫سسٹم‬ ‫اس‬ ‫جو‬ ‫ہے‬ ‫یعنی‬ ‫حروف‬ ‫ابتدائی‬ ‫تین‬ ‫سے‬ ‫میں‬ ‫لفظ‬ LIN ‫منتخب‬ ‫لفظ‬ ‫دوسرا‬ ‫ہیں۔‬ ‫گئے‬ ‫کئے‬ Unix ‫یعنی‬ ‫مخفف‬ ‫کا‬ UX ‫لفظ‬ ‫طرح‬ ‫اس‬ ‫گیا۔‬ ‫لیا‬ LINUX ‫ہے۔‬ ‫پاتا‬ ‫تشکیل‬ ‫لینکس‬ Linux Distribution SunOS, Solaris, HP-UX, AIX, SCO UNIX ‫کرنل‬ ‫پہال‬ ‫سے‬ ‫سب‬ 1994‫کیا‬ ‫جاری‬ ‫میں‬ ‫ء‬ ‫گیا‬ ‫اس‬‫سسٹم‬ ‫آپریٹنگ‬‫کو‬ ‫لینس‬ ‫کے‬ ‫لینڈ‬ ‫ن‬ِ‫ف‬ ‫نے‬ ‫ٹوروالڈز‬1991‫ء‬ ‫میں‬‫کیا‬ ‫شروع‬
  • 8. LINUX TODAY • Linux has been used for many computing platforms • PC, Supercomputer • Commercial vendors moved in Linux itself to provide freely distributed code. They make their money by compiling up various software and gathering them in a distributable format • Red Hat, Slackware, etc. • About 29 million people use Linux worldwide
  • 9. LINUX DISTRIBUTION • Red Hat Linux : One of the original Linux distribution. • The commercial, non-free version is Red Hat Enterprise Linux, which is aimed at big companies using Linux servers and desktops in a big way • Debian GNU/Linux : A free software distribution. Popular for use on servers • Gentoo Linux : Gentoo is a specialty distribution meant for programmers
  • 10. DISTRIBUTION OF LINUX ‫کی‬ ‫لینکس‬ ‫تقسیم‬
  • 11. WHY LINUX ‫لینکس‬‫خوبیا‬‫کی‬‫ں‬ ‫کیا‬‫ہ‬‫ی‬‫ں‬‫؟‬Linux Provide Security Powerful It’s “free” Multi-user Multiprocessing Multitasking Multithreading Linux is Virus Free!!
  • 12. ‫ک‬ ‫لینکس‬‫ے‬‫ائد‬‫ف‬‫ے‬ ‫سس‬ ‫لینکس‬‫ٹ‬‫انت‬‫م‬‫ہ‬‫مستحکم‬ ‫ائی‬‫ہ‬‫ی‬‫ں‬ ‫مفت‬ ‫لینکس‬‫ہے‬ ‫خطر‬‫کوئی‬ ‫کا‬ ‫وائرس‬‫ہ‬‫ن‬‫ہ‬‫ی‬‫ں‬‫سیکوئر‬ ‫کافی‬ ‫اور‬‫ہے‬‫وائرس‬ ‫مطلب‬ ‫ا‬‫ٹ‬‫ن‬ ‫یک‬‫ہ‬‫ی‬‫ں‬‫کرتا‬‫۔‬ ‫ک‬ ‫لینکس‬‫ے‬‫سات‬‫ھ‬‫ک‬ ‫ضرورت‬‫ے‬‫ساف‬‫ٹ‬‫س‬ ‫سب‬ ‫کی‬ ‫ویئر‬‫ے‬‫زیاد‬‫ہ‬ ‫پ‬‫ہ‬‫ل‬‫ے‬‫س‬‫ے‬‫آتا‬‫نصب‬‫ہے‬ ‫ک‬ ‫وقت‬ ‫کم‬ ‫از‬‫کم‬‫ے‬‫سات‬‫ھ‬‫اپن‬‫ے‬‫ساف‬ ‫تمام‬‫ٹ‬‫اپ‬‫ویئر‬‫ڈ‬‫ی‬‫ٹ‬ ‫کب‬ ‫لینکس‬‫ھ‬‫ن‬ ‫ی‬‫ہ‬‫ی‬‫ں‬‫سست‬‫ہ‬‫تا‬ ‫و‬‫۔‬
  • 14.
  • 15. SOME BASIC COMMANDS IN LINUXCommand Name Description 1. su Example: su then Pswd yami ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫ہونے‬ ‫ن‬ِ‫گ‬‫لو‬ ‫سے‬ ‫یوزر‬ ‫پر‬ُ‫س‬ 2. mkdir Example: mkdir yami ‫لیئے‬ ‫کے‬ ‫بنانے‬ ‫اورڈائریکٹری‬ ‫فولڈر‬ ‫نیا‬‫۔۔۔۔۔‬ 3. pwd Example: pwd and press enter ‫لیئے‬ ‫کے‬ ‫کرنے‬ ‫چیک‬ ‫ڈائریکٹری‬ ‫ورکنگ‬ ‫۔۔۔۔۔‬ 4. ls and enter ‫کر‬ ‫ہم‬ ‫کام‬ ‫جو‬ ‫جو‬ ‫ہے‬ ‫تی‬ ‫کر‬ ‫ظاہر‬ ‫کو‬ ‫لسٹ‬ ‫ہوں۔۔‬ ‫رہے‬ 5. touch Example: touch yami ‫استعمال‬ ‫لیئے‬ ‫کے‬ ‫بنانے‬ ‫فائل‬ ‫خالی‬ ‫ایک‬ ‫ہے۔‬ ‫جاتی‬ ‫کی‬ 6. ls –l and enter ‫۔۔۔۔۔‬ ‫ہے‬ ‫تی‬ ‫کر‬ ‫ظاہر‬ ‫کو‬ ‫لسٹ‬ ‫ڈیٹیل‬ 7. “cd” or “cd ..” and press Ent. ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کرنے‬ ‫تبدیل‬ ‫کر‬ ‫پاتھ‬
  • 16. SOME BASIC COMMANDS IN LINUXCommand Name Description 8. rm file-name Example: rm yami ‫لیئے۔۔۔۔۔‬ ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫فائل‬ ‫بھی‬ ‫کسی‬ 9. rm –r folder-name Example : rm –r yami ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫فولڈر‬ ‫خالی‬ ‫بھی‬ ‫کسی‬ ‫لیئے۔۔۔۔۔‬ 10. rm –rf folder-name Example: rm –rf yami ‫لیئے۔۔۔۔۔‬ ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫فولڈر‬ ‫بھی‬ ‫کسی‬ 11.date and press Ent. ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫ٹائم‬ ‫اور‬ ‫ڈیٹ‬ 12. date m/d/t/year ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫تبدیل‬ ‫ٹائم‬ ‫اور‬ ‫ڈیٹ‬ 13. Clear or Reset …… ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کرنے‬ ‫کلئیر‬ ‫کو‬ ‫سکرین‬ 14. cal year-name ‫سال‬ ‫آگے‬ ‫اور‬ ‫لیئے‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کلینڈر‬ ‫دیں۔‬ ‫لکھ‬
  • 17. SOME BASIC COMMANDS IN LINUXCommand Name Description 15. cal m/year-name ‫لکھ‬ ‫سال‬ ‫آگے‬ ‫اور‬ ‫لیئے‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کلینڈر‬ ‫دیں‬ 16. cp s-file d-file Example : cp yami df ‫لیئے۔۔۔۔‬ ‫کرنے‬ ‫کاپی‬ ‫کو‬ ‫فولڈر‬ ‫و‬ ‫فائل‬ ‫بھی‬ ‫کسی‬‫۔‬ 17. cat filename Example : cat yami ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کانٹنٹ‬ ‫کے‬ ‫فائل‬ 18. head yami Example : head yami ‫پہلی‬ ‫کی‬ ‫فائل‬10‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫الئنز‬ 19. tail yami Example : tail yami ‫آخری‬ ‫کی‬ ‫فائل‬10‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫الئنز‬ 20. head –n yami or tail b Example : head –n yami ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کو‬ ‫الئنز‬ ‫منتخب‬
  • 18. SOME BASIC COMMANDS IN LINUXCommand Name Description 21. wc –w file name Example : wc –w yami ‫ہے۔۔۔۔۔۔‬ ‫رکرواتی‬ ‫و‬ُ‫ش‬ ‫الفاظ‬ ‫ٹوٹل‬ ‫کے‬ ‫فائل‬ 22. wc –l file name Example : wc –l yami ‫ہے۔۔۔۔۔۔‬ ‫رکرواتی‬ ‫و‬ُ‫ش‬ ‫الئنز‬ ‫ٹوٹل‬ ‫کی‬ ‫فائل‬ 23. wc –c file name Example : wc –c yami ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬‫کےکریکٹر‬ ‫فائل‬ 24. wc file name Example : wc yami ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫وکروانے‬ُ‫ش‬ ‫معلومات‬ ‫مکمل‬ ‫کی‬ ‫فائل‬ 25. tail yami Example : tail yami ‫آخری‬ ‫کی‬ ‫فائل‬10‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫الئنز‬ 26. vi file name Example : vi zubi ‫اور‬ ‫لیئے‬ ‫کے‬ ‫کروانے‬ ‫ایڈ‬ ‫ڈیٹا‬ ‫اور‬ ‫بنانے‬ ‫فائل‬ ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫محفوظس‬
  • 20. SOME BASIC COMMANDS IN LINUX Command Name Description 27. useradd u-name Example : useradd yami ‫کیلئے۔۔۔۔۔۔‬ ‫کرنے‬ ‫ایڈ‬ ‫یوزر‬ ‫نیا‬ 28. passwd u-name Example : passwd yami ‫کیلئے۔۔۔۔۔۔‬ ‫نے‬ ‫کر‬ ‫ایڈ‬ ‫پاسورڈ‬ 29. cat , more, vi, view, Example :vi /etc/passwd ‫واسطے‬ ‫کرنے‬ ‫ایڈٹ‬ ‫کو‬ ‫فائل‬ ‫اور‬ ‫دیکھنے‬ ‫کو‬ ‫فائل‬ ‫کرے۔۔۔‬ ‫یوز‬ ‫کو‬ ‫کمانڈ‬ ‫اس‬ 30. userdel –r/f u-name Example : userdel –r /f yami ‫۔۔۔۔۔‬ ‫کیلئے‬ ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫یوزر‬ ‫اپنے‬ 31. usermod –s /sbin/nologin u- name Example : usermod –s /sbin/nologin zubi ‫کرنےکیلئے۔۔۔۔۔‬ ‫ایبل‬ ‫ڈس‬ ‫کو‬ ‫یوزر‬
  • 22. SOME BASIC COMMANDS IN LINUXCommand Name Description 32. su u name Example : su zubi ‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫جانے‬ ‫پر‬ ‫یوزر‬ ‫لوکل‬ ‫سے‬ ‫یوزر‬ ‫سوئچ‬ 33. usermod –s /bin/bash uname Example : usermod –s /bin/bash zubi and check by cat ‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫ایبل‬ ‫ان‬ ‫کو‬ ‫زر‬ ‫یو‬ 34. cat , more, vi, view, Example :vi /etc/passwd ‫اس‬ ‫واسطے‬ ‫کرنے‬ ‫ایڈٹ‬ ‫کو‬ ‫فائل‬ ‫اور‬ ‫دیکھنے‬ ‫کو‬ ‫فائل‬ ‫کرے۔۔۔‬ ‫یوز‬ ‫کو‬ ‫کمانڈ‬ 35. userdel –r/f u-name Example : userdel –r /f yami ‫۔۔۔۔۔‬ ‫کیلئے‬ ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫یوزر‬ ‫اپنے‬ 36. usermod –s /sbin/nologin u-name Example : usermod –s /sbin/nologin zubi ‫کرنےکیلئے۔۔۔۔۔‬ ‫ایبل‬ ‫ڈس‬ ‫کو‬ ‫یوزر‬
  • 23. SOME BASIC COMMANDS IN LINUXCommand Name Description 37. info Example : info +Enter ‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫انفارمیشن‬ 38. Exit or logout or halt Example : halt and press enter ‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫ختم‬ ‫اور‬ ‫ن‬ َ‫ڈاو‬ ‫شٹ‬ 39. cat , more, vi, view, Example :vi /etc/passwd ‫اس‬ ‫واسطے‬ ‫کرنے‬ ‫ایڈٹ‬ ‫کو‬ ‫فائل‬ ‫اور‬ ‫دیکھنے‬ ‫کو‬ ‫فائل‬ ‫کرے۔۔۔‬ ‫یوز‬ ‫کو‬ ‫کمانڈ‬ 40. userdel –r/f u-name Example : userdel –r /f yami ‫۔۔۔۔۔‬ ‫کیلئے‬ ‫کرنے‬ ‫ڈیلیٹ‬ ‫کو‬ ‫یوزر‬ ‫اپنے‬ 41. usermod –s /sbin/nologin u-name Example : usermod –s /sbin/nologin zubi ‫کرنےکیلئے۔۔۔۔۔‬ ‫ایبل‬ ‫ڈس‬ ‫کو‬ ‫یوزر‬
  • 24. SOME BASIC COMMANDS IN LINUX Command Name Description 42. df [options] Example : df yami ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫جگہ‬ ‫بقیہ‬ ‫اور‬ ‫سپیس‬ ‫شدہ‬ ‫استعمال‬ ‫لیئے۔۔۔۔۔۔‬ 43. du [options] Example : du yami ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫دیکھنے‬ ‫اسکو‬ ‫ہے‬ ‫لیتی‬ ‫فائل‬ ‫ہر‬ ‫جگہ‬ ‫کتنی‬. 44. less [options] [filename] Example :less yami ‫کو‬ ‫مواد‬ ‫کے‬ ‫صفحے‬ ‫ایک‬ ‫فائل‬ ‫ایک‬ ‫میں‬ ‫وقت‬ ‫ایک‬ ‫۔۔۔۔۔۔‬ ‫لیئے‬ ‫کے‬ ‫دیکھنے‬. 45. echo Example : echo + enter ‫لیئے۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کو‬ ‫آرگومنٹ‬ 46. Man ls Example : man ls + enter ‫۔۔۔۔۔‬ ‫لیئے‬ ‫کے‬ ‫جاننے‬ ‫کو‬ ‫کمانڈز‬ ‫کی‬ ‫قسم‬ ‫خاص‬
  • 25. SOME BASIC COMMANDS IN LINUXCommand Name Description 47. Ps –e Example : ps –e ‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫پروسیس‬ ‫تمام‬ 48. pstree Example : pstree + enter ‫لے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫کو‬ ‫پروسس‬ ‫میں‬ ‫شکل‬ ‫کی‬ ‫ٹری‬ ‫ایک‬ ‫لیئے۔۔۔۔۔۔‬ 49. top Example :top + enter ‫۔۔۔‬ ‫لیئے‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫پروسس‬ ‫انٹریکٹیو‬ 50. vi mycron Example : vi mycron + Enter ‫۔۔۔۔۔۔۔۔۔‬ ‫بیسٹ‬ ‫مائی‬ ‫ایڈیٹر‬ 51. History Example : history + enter ‫۔۔۔۔۔‬ ‫لیے‬ ‫کے‬ ‫کرنے‬ ‫چیک‬ ‫ہسٹری‬
  • 26. SOME BASIC COMMANDS IN LINUXCommand Name Description 52. whoami Example : whoami + enter ‫لیئے۔۔۔۔۔۔‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫یوزر‬ ‫کرنٹ‬ 53. cat /etc/shells Example : cat /etc/shells ‫کو‬ ‫شلز‬‫لیئے۔۔۔۔۔۔‬ ‫لے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ 54. top Example :top + enter ‫۔۔۔‬ ‫لیئے‬ ‫کے‬ ‫کروانے‬ ‫و‬ُ‫ش‬ ‫پروسس‬ ‫انٹریکٹیو‬ 55. vi mycron Example : vi mycron + Enter ‫۔۔۔۔۔۔۔۔۔‬ ‫بیسٹ‬ ‫مائی‬ ‫ایڈیٹر‬ 56. History Example : history + enter ‫۔۔۔۔۔‬ ‫لیے‬ ‫کے‬ ‫کرنے‬ ‫چیک‬ ‫ہسٹری‬
  • 27. HOW TO CONFIGURE INTERNET IN RHEL ‫س‬ ‫سب‬‫ے‬‫پ‬‫ہ‬‫ل‬‫ے‬‫اپنا‬‫ٹ‬‫کری‬ ‫اوپن‬‫رمینل‬‫ں‬ ‫اپن‬‫ے‬‫نی‬‫ٹ‬‫کرن‬ ‫چیک‬‫کو‬ ‫ورک‬‫ے‬‫ک‬‫ے‬‫لیئ‬‫ے‬‫ی‬‫ہ‬‫کمان‬‫ڈ‬‫لگائی‬‫ں‬ #service network restart ‫می‬ ‫بعد‬ ‫اور‬‫ں‬‫اسکا‬ IP ‫کری‬ ‫چیک‬‫ں‬‫کمان‬ ‫اس‬‫ڈ‬‫س‬‫ے‬ # ifconfih
  • 28.
  • 29. MAIN TOPIC Controlling Access to Files with Linux File System Permissions
  • 30. Types of Permissions:- There are two types of permissions • Local Permissions • Network Permissions
  • 31. • Local Permissions:- Within a system or standalone system, permissions applied are called local permissions. • Network Permissions:- Over the network, permissions applied on a system are called network permissions, i.e., shared device permissions.
  • 32. Local Permissions Types of Permissions in Linux:- Read ( r ) Write ( w ) Execute ( x ) Sequence of permissions is important. We can check the file properties to see the permissions.
  • 33. TO SEE THE PROPERTIES:- # ls -l First column of properties is the permissions of the file or directory. There are 10 slots of the permission column. We divide these ten slots into 4 segments. - - - - - - - - - - 1 slot 3 slots 3 slots 3 slots • First segment contains only the one slot (first slot only). • Second segment contains three slots (next three slots). • Third segment contains three slots (next three slots of remaining). • Forth segment contains also three slots (last three slots).
  • 34. 1st Segment 2nd Segment:- If the slot is “–“, then it is a file. If the slot is “d”, then it is a directory. If the slot is “l”, then it is a link file (shortcut). 2nd segment shows the owner’s (file creator) permissions. rwx means read, write and execute (all permissions) permissions. _wx means only write and execute permissions. _ _ x means only execute permission. r _ x means only read and execute permissions. rw_ means only read and write permissions. _ _ _ means no permissions.
  • 35. 3rd Segment:- 4th Segment:- 3rd segment shows the owner’s primary group permissions. rwx means read, write and execute (all permissions) permissions. _wx means only write and execute permissions. _ _ x means only execute permission. r _ x means only read and execute permissions. rw_ means only read and write permissions. _ _ _ means no permissions. 4th Segment:- 4th segment shows the others permissions, other than owner’s primary group permissions. Others are also called world users. rwx means read, write and execute (all permissions) permissions. _wx means only write and execute permissions. _ _ x means only execute permission. r _ x means only read and execute permissions. rw_ means only read and write permissions. _ _ _ means no permissions.
  • 36. ‫ڈ‬‫اریک‬‫ٹ‬‫کرنا‬ ‫چیک‬‫کو‬ ‫پرمیشن‬ ‫کی‬ ‫ری‬ To Check the Permissions of a File/Directory:- # ls -l file-name # ls -l Yami To Change the Permissions:- chmod command is used to change any file or directory permissions.
  • 37. METHODS OF CHANGE PERMISSIONS Identifier Method Number System Method
  • 38. IDENTIFIER METHOD:- Identifiers which are used are shown below: • ‘u’ for Owner • ‘g’ for group • ‘o’ for others • ‘a’ for all
  • 39. THERE ARE THREE PERMISSIONS READ, WRITE AND EXECUTE ARE AVAILABLE IN LINUX. There are three permissions read, write and execute are available in Linux. Actions:- Add permissions ‘+’ Remove permissions ‘-‘ Syntax: # chmod identifier action permission file/dir-name Example:- # chmod g+x Yami This will add a owner’s primary group permission execute on abc file. Example To Add & Remove the Permissions:- # chmod u-x, g-x, o+w Yami Problem:- Give the read, write and execute permissions to the owner, give read and write to primary group and give read permissions to the others. Owner = rwx Group = rw_ Others = r_ _ Solution:- # chmod u+rwx, g+rw, o+r Yami #chmod a+r, u+wx, g+w Yami output:- _rwxrw_r_ _
  • 40. NUMBER SYSTEM METHOD:- In number system following numbers are assigned to each permission. • r = 4 • w = 2 • x = 1 Full Access or Full Permission:- 4+2+1 = 7 7 means full access (rwx) as 4+2+1=7 • rw_ is equivalent to 6, as 4+2=6 • r_ _ is equivalent to 4 • r_x is equivalent to 5, as 4+1 • _wx is equivalent to 3, as 2+1=3 • _ _ x is equivalent to 1 • 0 means no permissions (access) Example:- Required Result: _rwx rw_ r_ _ # chmod 764 yami Example:- Present Permissions Status: _ rwx rw_ r_ _ Required Result: _ rw_ r_ _ r_x #chmod 645 yami
  • 41. SPECIAL PERMISSION:- (STICKY BIT) • It is used on that directory or file on which everyone has full control. i.e. , tmp directory. • • Delete permission is not given. One user cannot delete other user’s files. • 1 is used for numeric value of sticky bit. • Its symbol is “t”. For example, -rwxrwxrwt.
  • 42. ADD A STICKY BIT:- If we want to add a sticky bit on the data directory, then we will execute the following command. # chmod 1777 data where “1” is to add a sticky bit. Remove a Sticky Bit:- # chmod 777 data Or # chmod 0777 data Sticky bit is not applicable on owner of the file or directory.
  • 43. DEFAULT PERMISSIONS • In windows OS everyone has by default full control on a file or directory. • In Linux by default permission on a file is 644 (- rw- r- - r- -). • And by default permission on a directory is 755 (d rwx r-x r-x). • Default permissions depend upon umask (user mask) value. • Default umask is 022 • In the case of directory 777 – 022 = 755 • And in case of file 666 – 022 = 644 • Full access umask is 000.
  • 44. • By default root has a umask 022 • And regular account’s umask is 002. • 027,022,002 have some common umask used in Linux. • In case of directory we subtract the umask value from 777. • And in the case of a file we subtract the umask value from 666. • If the resultant value is less than 0, then this will be considered to 0 DEFAULT PERMISSIONS
  • 45. DEFAULT PERMISSIONS To see the Umask value:- # umask To Change the umask:- # umask 002