Find the answer to your Linux question:
Results 1 to 6 of 6
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2011
    Posts
    3

    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!
    Last edited by Roxoff; 12-01-2011 at 08:56 AM. Reason: Added Code tags to make output readable

  2. #2
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,890
    For Q3 - I thought you needed 'x' permission to use 'ls' on a directory? I though the 'r' permission allowed you to cd to it (I could be wrong, though, so taking my advice may affect your test results).

    Other than that, it looks like a good set of answers to me.
    Linux user #126863 - see http://linuxcounter.net/

  3. #3
    Banned
    Join Date
    Nov 2011
    Location
    India
    Posts
    29
    Quote Originally Posted by tzem View Post
    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!

    Yes, your answers are correct buddy!!!

    Thanks,
    Manoj
    Last edited by MikeTbob; 12-01-2011 at 11:10 AM. Reason: removed redirect

  4. #4
    Just Joined!
    Join Date
    Dec 2011
    Posts
    3
    Quote Originally Posted by Roxoff View Post
    For Q3 - I thought you needed 'x' permission to use 'ls' on a directory? I though the 'r' permission allowed you to cd to it (I could be wrong, though, so taking my advice may affect your test results).

    Other than that, it looks like a good set of answers to me.
    Thanks for your response! I just tried playing around with the permission and confirmed that once there is no 'x', one cannot access into the folder, however as long as there is 'r', user can still read into the folder using 'ls'! cheers, we learn together~

  5. #5
    Just Joined!
    Join Date
    Dec 2011
    Posts
    3
    Quote Originally Posted by manojsamtani View Post
    Yes, your answers are correct buddy!!!

    Thanks,
    Manoj
    Thanks bud! your confirmation means alot to me! was preparing for my exams for linux module! ;D

  6. #6
    Super Moderator Roxoff's Avatar
    Join Date
    Aug 2005
    Location
    Nottingham, England
    Posts
    3,890
    Quote Originally Posted by tzem View Post
    Thanks for your response! I just tried playing around with the permission and confirmed that once there is no 'x', one cannot access into the folder, however as long as there is 'r', user can still read into the folder using 'ls'! cheers, we learn together~
    Ahh, yes, it's the other way round... This'll put it into context for your studies; I've been working with Linux since about 1996 and in all that time it's never once been important that I know that .
    Linux user #126863 - see http://linuxcounter.net/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •