Welcome to the Linux Foundation Forum!

Access control through group membership

sadamahansadamahan Posts: 11
edited May 2017 in LFS201 Class Forum

Hello Everyone

Can someone please help me understand why user smk cannot access a folder /root/quotamnt when user smk belongs to a valid group (root) that is authorized to access the folder (/root/quotamnt).

Have a folder /root/quotamnt that allows users in group "root": 

[email protected]:~# ls /root/quotamnt

drwxr-xr-x  3 root root 1.0K May 24 14:41 quotamnt

Then added user smk to group "root":

[email protected]:~$ sudo usermod -a -G root smk

Verify it exists:

[email protected]:~$ groups smk

smk : smk root adm cdrom sudo dip plugdev lpadmin sambashare

Logged out and logged back in as smk.

Why can't smk access /root/quotamnt:

[email protected]:~$ ls /root/quotamnt

ls: cannot access '/root/quotamnt': Permission denied

Thanks in advance!

SMK

 

 

Comments

  • luisviveropenaluisviveropena Posts: 603
    edited May 2017

    Hello SMK,

    Are you sure you want to add a normal user to the root group? Is that a good idea? If you want to know why you can't access that directory you can see it here:

    ls -l /

    Regards,

    Luis.

  • sadamahansadamahan Posts: 11
    edited May 2017

    Hello Luis

    Thank you for your response. I am attempting to add a normal user to the root group only to learn the concepts - would not do that on a live system. 

    If a user is in the root group, I believe they should have access to everything that root does. I see the output of ls -l / but that does not make it clear to me why I cannot access a folder /root/quotamnt. 

    Best Regards

    SMK 

  • sadamahansadamahan Posts: 11
    edited May 2017

    Hello Luis

    Thank you for your response. I am attempting to add a normal user to the root group only to learn the concepts - would not do that on a live system. 

    If a user is in the root group, I believe they should have access to everything that root does. I see the output of ls -l / but that does not make it clear to me why I cannot access a folder /root/quotamnt. 

    Best Regards

    SMK 


  • sadamahansadamahan Posts: 11
    edited May 2017

    Hello Luis

    Thank you for your response. I am attempting to add a normal user to the root group only to learn the concepts - would not do that on a live system. 

    If a user is in the root group, I believe they should have access to everything that root does. I see the output of ls -l / but that does not make it clear to me why I cannot access a folder /root/quotamnt. 

    Best Regards

    SMK


  • luisviveropenaluisviveropena Posts: 603
    edited June 2017

    Hello Sadamahan,

    You may start studying Chapter 35. File permissions and ownership, I think that should be enough to understand this. If after that you still are unclear, please go back here.

    Regards,

    Luis.

  • coopcoop Posts: 512
    edited June 2017

    Please try adding to another group, not root.  Not only is this a very very bad idea, but exactly what would happen is likely to differ on different systems.  I have never seen someone do this.

Sign In or Register to comment.