Welcome to the Linux Foundation Forum!

Access control through group membership

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": 

root@SandBox1:~# ls /root/quotamnt

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

Then added user smk to group "root":

smk@SandBox1:~$ sudo usermod -a -G root smk

Verify it exists:

smk@SandBox1:~$ 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:

smk@SandBox1:~$ ls /root/quotamnt

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

Thanks in advance!

SMK

 

 

Comments

  • luisviveropena
    luisviveropena Posts: 1,144
    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.

  • sadamahan
    sadamahan 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 

  • sadamahan
    sadamahan 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 


  • sadamahan
    sadamahan 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


  • luisviveropena
    luisviveropena Posts: 1,144
    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.

  • coop
    coop Posts: 915
    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.

Categories

Upcoming Training