Upload
muhammad-yameen-shakir
View
639
Download
203
Embed Size (px)
Citation preview
﷽
اسلام علیکمبخاری شریف کی ایک حدیث
ےک مطابق�ےجو علم چھپائ گا اس روز ’’ ے
ےقیامت اگ کی لگام ڈالی جائ ۔گی ‘‘
صحیح الجامع حدیث نمبر )6517)
LINUX IS NOT AN OPERATING SYSTEM. IT‘S A PHILOSPHY
BSIT-Evening-7th 2016
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
1969UNIX
1973 UNICSConverted into
Unix
1984GUN Unix
مقابلہ
1990Working on Kernel
By Linus Torvalds
GNO & MINIX
کرنل نہیں تھا
MemoryManager creator
Utility of MINIX
and GNORewrite all utility
Of MINIX and GNOAs Competition of
UNIX
لینکس اصل میں ہے کیا اور اس کی تاریخ
Assembly language کیا ہےWrite 1st
Ken Thompson, Dennis RitchieIn C language
1973, Rewrite UNIX with C
Richard StallmanGPL
HackerGNU(Free Software
Foundation ) starts under GPL
Andrew Stuart "Andy"
Tanenbaum
What is Linux/GNU?
1991Kernel
Announcement in Social Media
Group
Comparison of operating systems
https://en.wikipedia.org/wiki/Comparison_of_operating_systems
کو دو لینکس Linux اس سسٹم کا نام یعنیےالفاظ ک ابتدائی حروف کو جوڑ کر بنایا ال لفظ ہگیا پ ہے۔ LINUS ہے جو اس سسٹم
ےک بانی کا نام اس لفظ میں س تین ہے۔ ےےمنتخب کئ گئ LIN ابتدائی حروف یعنی ے۔یں دوسرا لفظ کا مخفف یعنی Unix ہ
UX ۔لیا گیا اس طرح لفظ LINUX تشکیلہے۔پاتا
لینکس
Linux DistributionSunOS, 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 SecurityPowerful It’s “free”Multi-user Multiprocessing Multitasking Multithreading Linux is Virus Free!!
لینکس سسٹم انتہائی مستحکم ہیں لینکس کے فائدےلینکس مفت ہے
وائرس کا کوئی خطرہ نہیں اور کافی سیکوئر ہے مطلب وائرس اٹیک نہیں کرتا۔آاتا ہے لینکس کے ساتھ ضرورت کے سافٹ ویئر کی سب سے زیادہ پہلے سے نصب
کم از کم وقت کے ساتھ اپنے تمام سافٹ ویئر اپ ڈیٹلینکس کبھی نہیں سست ہو تا۔
لینکس بھی سب سے پرانی ہارڈ ویئر پر چلا سکتے ہیںزیادہ سافٹ ویئر کو شامل کرنے کے لیئے کچھ کلکس کی ضرورت ہے
Some basic Commands in LINUX
SOME BASIC COMMANDS IN LINUX Command Name Description
1. su Example: su then Pswd yami
گIن ہونے کے لیئے۔۔۔۔۔ سسپر یوزر سے لو
2. mkdir Example: mkdir yami
نیا فولڈر اورڈائریکٹری بنانے کے لیئے۔۔۔۔۔
3. pwdExample: pwd and press enter
ورکنگ ڈائریکٹری چیک کرنے کے لیئے ۔۔۔۔۔
4. ls and enter لسٹ کو ظاہر کر تی ہے جو جو کام ہم کر رہے ہوں۔۔
5. touchExample: touch yami
ایک خالی فائل بنانے کے لیئے استعمال کی جاتی ہے۔
6. ls –l and enter ڈیٹیل لسٹ کو ظاہر کر تی ہے ۔۔۔۔۔
7. “cd” or “cd ..” and press Ent.
پاتھ کر تبدیل کرنے کے لیئے۔۔۔۔۔
SOME BASIC COMMANDS IN LINUX Command Name Description
8. rm file-nameExample: rm yami
کسی بھی فائل کو ڈیلیٹ کرنے لیئے۔۔۔۔۔
9. rm –r folder-nameExample : rm –r yami
کسی بھی خالی فولڈر کو ڈیلیٹ کرنے لیئے۔۔۔۔۔
10. rm –rf folder-nameExample: rm –rf yami
کسی بھی فولڈر کو ڈیلیٹ کرنے لیئے۔۔۔۔۔
11.date and press Ent. سشو کروانے کے لیئے۔۔۔۔۔ ڈیٹ اور ٹائم
12. date m/d/t/year ڈیٹ اور ٹائم تبدیل کروانے کے لیئے۔۔۔۔۔
13. Clear or Reset …… سکرین کو کلئیر کرنے کے لیئے۔۔۔۔۔
14. cal year-name آاIے سال لکھ دیں۔ سشو کروانے کے لیئے اور کلینڈر
SOME BASIC COMMANDS IN LINUX Command Name Description
15. cal m/year-name آاIے سال لکھ دیں سشو کروانے کے لیئے اور کلینڈر
16. cp s-file d-fileExample : cp yami df
کسی بھی فائل و فولڈر کو کاپی کرنے لیئے۔۔۔۔۔
17. cat filenameExample : cat yami
سشو کروانے کے لیئے۔۔۔۔۔ فائل کے کانٹنٹ
18. head yamiExample : head yami
سشو کروانے کے لیئے۔۔۔۔۔10فائل کی پہلی لائنز
19. tail yamiExample : tail yami
آاخری سشو کروانے کے لیئے۔۔۔۔۔10فائل کی لائنز
20. head –n yami or tail bExample : head –n yami
سشو کروانے کے لیئے۔۔۔۔۔ منتخب لائنز کو
SOME BASIC COMMANDS IN LINUX Command Name Description
21. wc –w file nameExample : wc –w yami
سشو رکرواتی ہے۔۔۔۔۔۔ فائل کے ٹوٹل الفاظ
22. wc –l file nameExample : wc –l yami
سشو رکرواتی ہے۔۔۔۔۔۔ فائل کی ٹوٹل لائنز
23. wc –c file nameExample : wc –c yami
سشو کروانے کے لیئے۔۔۔۔۔ فائل کےکریکٹر
24. wc file nameExample : wc yami
سشوکروانے کے لیئے۔۔۔۔۔ فائل کی مکمل معلومات
25. tail yamiExample : tail yami
آاخری سشو کروانے کے لیئے۔۔۔۔۔10فائل کی لائنز
26. vi file name Example : vi zubi
فائل بنانے اور ڈیٹا ایڈ کروانے کے لیئے اور محفوظس کے لیئے۔۔۔۔۔
اانکا سائز وغیرہ پارٹیشن کیسے بناتے ہیں اور کیسے
دیکھتے ہیں
SOME BASIC COMMANDS IN LINUX
Command Name Description27. useradd u-nameExample : useradd yami
نیا یوزر ایڈ کرنے کیلئے۔۔۔۔۔۔
28. passwd u-nameExample : passwd yami
پاسورڈ ایڈ کر نے کیلئے۔۔۔۔۔۔
29. cat , more, vi, view, Example :vi /etc/passwd
فائل کو دیکھنے اور فائل کو ایڈٹ کرنے واسطے اس کمانڈ کو یوز کرے۔۔۔
30. userdel –r/f u-nameExample : userdel –r /f yami
اپنے یوزر کو ڈیلیٹ کرنے کیلئے ۔۔۔۔۔
31. usermod –s /sbin/nologin u-nameExample : usermod –s /sbin/nologin zubi
یوزر کو ڈس ایبل کرنےکیلئے۔۔۔۔۔
گرافیکل طریقے نال یوزر نوں کداں ایڈ کری دا وا؟؟
SOME BASIC COMMANDS IN LINUX Command Name Description
32. su u nameExample : su zubi
سوئچ یوزر سے لوکل یوزر پر جانے کے لیئے۔۔۔۔۔۔
33. usermod –s /bin/bash unameExample : usermod –s /bin/bash zubi and check by cat
یو زر کو ان ایبل کروانے کے لیئے۔۔۔۔۔۔
34. cat , more, vi, view, Example :vi /etc/passwd
فائل کو دیکھنے اور فائل کو ایڈٹ کرنے واسطے اس کمانڈ کو یوز کرے۔۔۔
35. userdel –r/f u-nameExample : userdel –r /f yami
اپنے یوزر کو ڈیلیٹ کرنے کیلئے ۔۔۔۔۔
36. usermod –s /sbin/nologin u-nameExample : usermod –s /sbin/nologin zubi
یوزر کو ڈس ایبل کرنےکیلئے۔۔۔۔۔
SOME BASIC COMMANDS IN LINUX Command Name Description
37. infoExample : 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-nameExample : userdel –r /f yami
اپنے یوزر کو ڈیلیٹ کرنے کیلئے ۔۔۔۔۔
41. usermod –s /sbin/nologin u-nameExample : usermod –s /sbin/nologin zubi
یوزر کو ڈس ایبل کرنےکیلئے۔۔۔۔۔
SOME BASIC COMMANDS IN LINUX
Command Name Description42. df [options]Example : df yami
سشو کروانے کے لیئے۔۔۔۔۔۔ استعمال شدہ سپیس اور بقیہ جگہ
43. du [options]Example : du yami
.کتنی جگہ ہر فائل لیتی ہے اسکو دیکھنے کے لیئے۔۔۔۔۔
44. less [options] [filename]Example :less yami
ایک وقت میں ایک فائل ایک صفحے کے مواد کو دیکھنے کے .لیئے ۔۔۔۔۔۔
45. echo Example : echo + enter
سشو کروانے کے لیئے۔۔۔۔۔ آارIومنٹ کو
46. Man ls Example : man ls + enter
خاص قسم کی کمانڈز کو جاننے کے لیئے ۔۔۔۔۔
SOME BASIC COMMANDS IN LINUX Command Name Description
47. Ps –e Example : ps –e
سشو کروانے کے لیئے۔۔۔۔۔۔ تمام پروسیس
48. pstreeExample : pstree + enter
سشو کروانے لے لیئے۔۔۔۔۔۔ ایک ٹری کی شکل میں پروسس کو
49. topExample :top + enter
سشو کروانے کے لیئے ۔۔۔ انٹریکٹیو پروسس
50. vi mycronExample : vi mycron + Enter
ایڈیٹر مائی بیسٹ ۔۔۔۔۔۔۔۔۔
51. History Example : history + enter
ہسٹری چیک کرنے کے لیے ۔۔۔۔۔
SOME BASIC COMMANDS IN LINUX Command Name Description
52. whoamiExample : whoami + enter
سشو کروانے کے لیئے۔۔۔۔۔۔ کرنٹ یوزر
53. cat /etc/shellsExample : cat /etc/shells
سشو کروانے لے لیئے۔۔۔۔۔۔ شلز کو
54. topExample :top + enter
سشو کروانے کے لیئے ۔۔۔ انٹریکٹیو پروسس
55. vi mycronExample : vi mycron + Enter
ایڈیٹر مائی بیسٹ ۔۔۔۔۔۔۔۔۔
56. History Example : history + enter
ہسٹری چیک کرنے کے لیے ۔۔۔۔۔
HOW TO CONFIGURE INTERNET IN RHELسب سے پہلے اپنا ٹرمینل اوپن کریں
اپنے? نیٹ ورک کو چیک کرنے? کے? لیئے یہ کمانڈ لگائیں#service network restart
اور بعد میں اسکاIP
چیک کریں اس کمانڈ سے?# ifconfih
اب ہم چلتے ہیں اپنے اصل ٹاپک کی جانب
MAIN TOPICControlling Access to Files with Linux File System Permissions
File & Folder Level Permissions
Types of Permissions:-There are two types of permissions
• Local Permissions• Network Permissions
TYPES OF 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.
TYPES OF 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).
TYPES OF PERMISSIONS:-
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.
TYPES OF 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 MethodNumber 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 YamiProblem:-
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 = rwxGroup = 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
شکریہ