SlideShare a Scribd company logo
1 of 12
Lecture 2<br />Why?File security  Permissions<br />                             Why?<br /> Multiuser environment <br />,[object Object]
Authorization   ‘Privilege on file’………………………………………………………………………<br />what are Permissions?<br />,[object Object],For a file: <br />File =  info   { owner + mtime + atime + ctime + perm + size } +      date+ inode #<br />,[object Object]
w     To edit file   [vi – gedit – copy  edit file without read it]
x     To execute an executable file (c file should have x to be
                 executable) ex : commands   ls –l dateFor a directory: <br />Directory = Sheet of the names of its contents(files or dir)<br />,[object Object]
          this directory (ls dir   need read permission)
w     To create or remove 0r rename file or dir from the
              directory
x     To cd to this directory you need execute
To know info about contents of this dir rather than it’s name           ls –l directory    need (r+x)  Note:  <br />ls    –ld      directory<br />Only requires execute on the parent no permission is required for this directory<br />  Ex: <br />cat    /etc/passwd<br />                                         x     x     x        r<br />     ls    /etc<br />                                         x     x   r<br />     wc    /etc/group<br />                                         x      x   x       r<br />     ls    -l    /usr/bin<br />                                         x          x    x   r+w<br />    cd     /var<br />                                         x      x   x       <br />rm    /etc/shadow<br />                                      x    x  x+w      no permission is required<br />cp    /etc/passwd   /export/home/iti<br />                        x    x    x        r         x        x       x         x+w<br />          cp    /etc/passwd   /export/home/iti/pass<br />                        x    x    x        r         x        x       x      x+w    w   <br />                                                             if pass not already exists<br />x       w   <br />                                             if pass already exists<br />………………………………………………………………………<br />How to view Permissions?<br />For a file: <br />Type of file:- :    regular filed:   directoryl :   softlinkb,c :  device files : socket fileex:/var/tmp/mapping-root162560464185ls –l file<br />File nameLast mtimeSizePrimary Group of ownerOwnerLink count<br />For a directory: <br />                    ls     -ld   directory      <br />………………………………………………………………………<br />How Permissions are checked?<br />616585-468630<br />………………………………………………………………………<br />How to change Permission?<br />Default for file and directory:<br />File:   rw- r- - r- -<br />Directory:    rwx r-x r-x<br />chmod command:<br />,[object Object]
 Octal
Symbols:

More Related Content

What's hot

Unix Commands
Unix CommandsUnix Commands
Unix Commands
Dr.Ravi
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
Rohit Kumar
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
Dimas Prasetyo
 
Character_Device_drvier_pc
Character_Device_drvier_pcCharacter_Device_drvier_pc
Character_Device_drvier_pc
Rashila Rr
 

What's hot (20)

Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands Course 102: Lecture 3: Basic Concepts And Commands
Course 102: Lecture 3: Basic Concepts And Commands
 
Course 102: Lecture 7: Simple Utilities
Course 102: Lecture 7: Simple Utilities Course 102: Lecture 7: Simple Utilities
Course 102: Lecture 7: Simple Utilities
 
Linux
LinuxLinux
Linux
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell Scripting
 
Unix Commands
Unix CommandsUnix Commands
Unix Commands
 
Basic linux commands
Basic linux commandsBasic linux commands
Basic linux commands
 
Linux system admin
Linux system adminLinux system admin
Linux system admin
 
Unix tips and tricks
Unix tips and tricksUnix tips and tricks
Unix tips and tricks
 
Basics of Unix Adminisration
Basics  of Unix AdminisrationBasics  of Unix Adminisration
Basics of Unix Adminisration
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
Linux shell scripting
Linux shell scriptingLinux shell scripting
Linux shell scripting
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014Unix Command-Line Cheat Sheet BTI2014
Unix Command-Line Cheat Sheet BTI2014
 
An Introduction to Linux
An Introduction to LinuxAn Introduction to Linux
An Introduction to Linux
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Character_Device_drvier_pc
Character_Device_drvier_pcCharacter_Device_drvier_pc
Character_Device_drvier_pc
 
Vi Editor
Vi EditorVi Editor
Vi Editor
 
Course 102: Lecture 4: Using Wild Cards
Course 102: Lecture 4: Using Wild CardsCourse 102: Lecture 4: Using Wild Cards
Course 102: Lecture 4: Using Wild Cards
 
Basic commands
Basic commandsBasic commands
Basic commands
 
Course 102: Lecture 6: Seeking Help
Course 102: Lecture 6: Seeking HelpCourse 102: Lecture 6: Seeking Help
Course 102: Lecture 6: Seeking Help
 

Viewers also liked (6)

lec4.docx
lec4.docxlec4.docx
lec4.docx
 
Call+for+Papers+2011.pdf
Call+for+Papers+2011.pdfCall+for+Papers+2011.pdf
Call+for+Papers+2011.pdf
 
lec1.docx
lec1.docxlec1.docx
lec1.docx
 
lec5+.docx
lec5+.docxlec5+.docx
lec5+.docx
 
fatma.docx
fatma.docxfatma.docx
fatma.docx
 
d.docx
d.docxd.docx
d.docx
 

Similar to lec2.docx

8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
southees
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
Craig Cannon
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
Dima Gomaa
 

Similar to lec2.docx (20)

Linux
LinuxLinux
Linux
 
Unix Basics Commands
Unix Basics CommandsUnix Basics Commands
Unix Basics Commands
 
50 Most Frequently Used UNIX Linux Commands -hmftj
50 Most Frequently Used UNIX  Linux Commands -hmftj50 Most Frequently Used UNIX  Linux Commands -hmftj
50 Most Frequently Used UNIX Linux Commands -hmftj
 
58518522 study-aix
58518522 study-aix58518522 study-aix
58518522 study-aix
 
8.1.intro unix
8.1.intro unix8.1.intro unix
8.1.intro unix
 
Rhel 6.2 complete ebook
Rhel 6.2 complete ebookRhel 6.2 complete ebook
Rhel 6.2 complete ebook
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
 
The one page linux manual
The one page linux manualThe one page linux manual
The one page linux manual
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
50 most frequently used unix
50 most frequently used unix50 most frequently used unix
50 most frequently used unix
 
Rhel 6.2 complete ebook
Rhel 6.2  complete ebookRhel 6.2  complete ebook
Rhel 6.2 complete ebook
 
Basics of Linux
Basics of LinuxBasics of Linux
Basics of Linux
 
Examples -partII
Examples -partIIExamples -partII
Examples -partII
 
2.Utilities.ppt
2.Utilities.ppt2.Utilities.ppt
2.Utilities.ppt
 
Unix fundamentals
Unix fundamentalsUnix fundamentals
Unix fundamentals
 
workshop_1.ppt
workshop_1.pptworkshop_1.ppt
workshop_1.ppt
 
Directories description
Directories descriptionDirectories description
Directories description
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Container Security
Container SecurityContainer Security
Container Security
 
Introduction to linux day-3
Introduction to linux day-3Introduction to linux day-3
Introduction to linux day-3
 

More from ismailaboshatra (19)

d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
d.docx
d.docxd.docx
d.docx
 
dt.docx
dt.docxdt.docx
dt.docx
 
dt.docx
dt.docxdt.docx
dt.docx
 
dt.docx
dt.docxdt.docx
dt.docx
 
Answers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docxAnswers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docx
 
Answers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docxAnswers+of+C+sample+exam.docx
Answers+of+C+sample+exam.docx
 
QM17025+Rev0.1-05May2011.doc
QM17025+Rev0.1-05May2011.docQM17025+Rev0.1-05May2011.doc
QM17025+Rev0.1-05May2011.doc
 
unix-OS-Lab-4.doc
unix-OS-Lab-4.docunix-OS-Lab-4.doc
unix-OS-Lab-4.doc
 
salesorder_example_normalization.doc
salesorder_example_normalization.docsalesorder_example_normalization.doc
salesorder_example_normalization.doc
 
Lecture5-SQL.docx
Lecture5-SQL.docxLecture5-SQL.docx
Lecture5-SQL.docx
 
ER_LAB_Solution_30.doc
ER_LAB_Solution_30.docER_LAB_Solution_30.doc
ER_LAB_Solution_30.doc
 
amanttttt.pptx
amanttttt.pptxamanttttt.pptx
amanttttt.pptx
 
chat+with+dr+14-3.docx
chat+with+dr+14-3.docxchat+with+dr+14-3.docx
chat+with+dr+14-3.docx
 

lec2.docx

  • 1.
  • 2.
  • 3. w To edit file [vi – gedit – copy edit file without read it]
  • 4. x To execute an executable file (c file should have x to be
  • 5.
  • 6. this directory (ls dir need read permission)
  • 7. w To create or remove 0r rename file or dir from the
  • 8. directory
  • 9. x To cd to this directory you need execute
  • 10.
  • 13. u: Owner g: group o: others
  • 14. r: read w: write x: execute
  • 15. u=rw,g=r,o=r give owner read/write & g read & others read
  • 16. u+x,g+x,o+x append execute for all
  • 17. u-rw remove read & write permission from owner
  • 18. a+r append execute for all (a) equivalent to u&g&o
  • 20. Owner Owner’s group Others
  • 21.
  • 22. R W X R W X R W X Denied: 0
  • 23. Exist: 1
  • 24. rw- r- - r- - : 110 100 100 : 644
  • 25.
  • 26. How to view mask??
  • 28. 0022 Default
  • 29. How to change mask??
  • 31. # umask a=rwx
  • 32. So any file will be created will have permission rw-rw-rw-
  • 33. & any directory will be created will have permission rwxrwxrwx
  • 35. 0000 full permission
  • 37. # umask 000 000 Complement of required permissions
  • 38. So any file will be created will have permission rw-rw-rw-
  • 39. & any directory will be created will have permission rwxrwxrwx
  • 41.
  • 42.
  • 44. Esc: To shift to the command mode
  • 46. k
  • 47. hl
  • 48.
  • 49. j
  • 50. i To turn to editing (inserting) mode
  • 51. a To turn to editing (appending) mode
  • 52. A To turn to editing mode and go to the end of the line
  • 53. I To turn to editing mode and go to the beginning of the line
  • 54. 0 To go to the beginning of line
  • 55. $ To go to the end line
  • 56. G To go to the end of file
  • 57. H To go to the begin of file
  • 58. R Replace
  • 59. x Delete the character on cursor
  • 60. X Delete the character at the left of the cursor
  • 61. :w Save file
  • 62. :wq save and quit equivalent to ZZ
  • 63. :w filename Save as filename
  • 64. :q To quit refuse to quit if no save
  • 65. :q! To force to quit without saving
  • 66. yy To copy current line you are standing on
  • 67. dd cut current line you are standing on
  • 68. p paste below the line you are standing on
  • 69. P Paste above the line you are standing on
  • 70. y#w copy # words and then paste them where you want
  • 71. d#w cut # words and then paste them where you want
  • 72. O begin to write above line you are standing on
  • 73. o begin to write below line you are standing on
  • 74. / text Search for the text n: next occurance N: previous occurance
  • 75. ~ Switch from lower case to upper case & vice versa for
  • 76. Highlighted word
  • 77. u undo “but just once” U undo all changes happen to line
  • 78. . redo
  • 79. r replace
  • 80. :# go to line #
  • 81. #j go to line # relative to current line
  • 82. :#d cut line #
  • 83. dH cut from line you r standing on till beginning of file(up)
  • 84. d0 cut from where you r standing on till end of line == D
  • 85. dG cut from line you r standing on till end of file(down)
  • 86. d$ cut from where you r standing on till begin of line
  • 87. :#dd 3dd cut line you r standing on and 2 lines below this line
  • 88. :#y copy line #
  • 89. yH copy from line you r standing on till beginning of file(up)
  • 90. y0 copy from where you r standing on till end of line
  • 91. yG copy from line you r standing on till end of file(down)
  • 92. y$ copy from where you r standing on till begin of line
  • 93. :#yy 3yy copy line you r standing on and 2 lines below this line
  • 94. :set number To numbering the file
  • 95. :set nonu To turn numbering of file off
  • 96. :set showmode To show mode {command mode } show nothing
  • 100.
  • 101.
  • 102.
  • 103. Once this command is executed an entry will be added to /etc/group
  • 104.