Thursday 1 December 2011

Permission in LINUX question

Permission in LINUX question

Hi, just need a quick check on this question that i just done regarding permissions in linux.

================================================== ========
Code:

$ ls –l /Home
drwxr-x--- 2 Krystal T2a 512 Dec 25 Krsytal
drwxr-xr-x 2 Yuki T2a 512 Dec 25 Yuki
drwxr-x--- 2 Shaun T2b 512 Dec 25 Shaun
$ ls –l /Home/Krystal
-rwxr----- 1 Krystal T2a 5123 Jan 10 Lecture1.pdf
-rwx------ 1 Krystal T2a 1009 Jan 10 example1.sh
$ ls –l /Home/Yuki
-rwxr-x--- 1 Yuki T2a 5123 Jan 10 Lesson1.pdf
-r-------- 1 Yuki T2a 1009 Jan 10 Lesson2.pdf

================================================== ========

Questions:
1) Can Krystal, Yuki, Shaun read Lecture1.pdf ? Why ?
2) Can Krystal, Yuki, Shaun execute example1.sh ? Why ?
3) Can Shaun perform the command “ls /Home/Krystal ? Why ?
4) Can Yuki remove the file Lesson2.pdf ? Why ?
================================================== ========

Answers:
1) No, only Krystal and Yuki are able to read it, Shaun belongs to T2b group thus no permission is granted to him
2) No, only Krystal is able to execute it as she is granted permission. This file is granted ‘rwx’ permission to only Owner and not granted permission to ‘Group’ or ‘Others’
3) No, because Shaun belongs to a different group and no “read” permission have been given to him.
4) No, she is not entitled the permission to write or execute, she can only read the file.


There is no answer for me to refer with, so can someone help me check if my answers are correct? Thanks!

No comments:

Post a Comment