What is the difference between the default user group and root group?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP








up vote
0
down vote

favorite












Suppose I have a directory with default permission



drwxr-xr-x 4 root root 4096 Dec 11 23:47 webtorrent-desktop/


I will Change only the owner



$ sudo chown -R sandy webtorrent-desktop 
drwxr-xr-x 4 sandy root 4096 Dec 11 23:47 webtorrent-desktop/


Now I will change the group as well



$ sudo chown -R sandy: webtorrent-desktop <br>
drwxr-xr-x 4 sandy sandy 4096 Dec 11 23:47 webtorrent-desktop/


So, my question is what is the difference between these two

1) I am owner of the file or directory but it's group is root

2) I am owner of the file or directory and group is also mine.



And will I need root permission for some operation in 1st case










share|improve this question

























    up vote
    0
    down vote

    favorite












    Suppose I have a directory with default permission



    drwxr-xr-x 4 root root 4096 Dec 11 23:47 webtorrent-desktop/


    I will Change only the owner



    $ sudo chown -R sandy webtorrent-desktop 
    drwxr-xr-x 4 sandy root 4096 Dec 11 23:47 webtorrent-desktop/


    Now I will change the group as well



    $ sudo chown -R sandy: webtorrent-desktop <br>
    drwxr-xr-x 4 sandy sandy 4096 Dec 11 23:47 webtorrent-desktop/


    So, my question is what is the difference between these two

    1) I am owner of the file or directory but it's group is root

    2) I am owner of the file or directory and group is also mine.



    And will I need root permission for some operation in 1st case










    share|improve this question























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      Suppose I have a directory with default permission



      drwxr-xr-x 4 root root 4096 Dec 11 23:47 webtorrent-desktop/


      I will Change only the owner



      $ sudo chown -R sandy webtorrent-desktop 
      drwxr-xr-x 4 sandy root 4096 Dec 11 23:47 webtorrent-desktop/


      Now I will change the group as well



      $ sudo chown -R sandy: webtorrent-desktop <br>
      drwxr-xr-x 4 sandy sandy 4096 Dec 11 23:47 webtorrent-desktop/


      So, my question is what is the difference between these two

      1) I am owner of the file or directory but it's group is root

      2) I am owner of the file or directory and group is also mine.



      And will I need root permission for some operation in 1st case










      share|improve this question













      Suppose I have a directory with default permission



      drwxr-xr-x 4 root root 4096 Dec 11 23:47 webtorrent-desktop/


      I will Change only the owner



      $ sudo chown -R sandy webtorrent-desktop 
      drwxr-xr-x 4 sandy root 4096 Dec 11 23:47 webtorrent-desktop/


      Now I will change the group as well



      $ sudo chown -R sandy: webtorrent-desktop <br>
      drwxr-xr-x 4 sandy sandy 4096 Dec 11 23:47 webtorrent-desktop/


      So, my question is what is the difference between these two

      1) I am owner of the file or directory but it's group is root

      2) I am owner of the file or directory and group is also mine.



      And will I need root permission for some operation in 1st case







      permissions filesystem user-management groups






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 25 at 5:39









      Kashyap Kansara

      18817




      18817




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          The difference is who has access to the file.



          As you're aware, there are three unique permission bits: the user (u), the group (g), and others (o). Each one of these can be treated differently depending on the set bits.



          For example, if a file is set to permissions 770 (rwxrwx---), it means both the owning user and owning group can read, write, and execute the file. If we disable the write bit for the group (resulting in rwxr-x---), it means the owning group can read and execute the file, but not edit it.



          So, why is this important? Say you're on a server with a bunch of other people making a website. All of these users are in a group we're going to call developers. We need all of the developers to be able to write to the file, so we give the group read and write permissions. This way, every developer can access the files they need.



          Now, let's say there's a folder in our fictional work environment that developers should be able to see, but not change. In that folder, we remove the write permission from the group. This allows devs to see it (and optionally run it), but not change it.



          However, as the root user, things are different. Root can already do whatever they want, so it doesn't really matter. It's important to note, though, that when root:root owns a file and write permissions are off for other users, nobody else can edit that file. This is very often used for system configurations that only admin users can touch.



          Now, what this means for your two questions:



          1. When you're the owning user and root is the owning group - you control the file entirely, and can set (useless) permissions for root. Similarly, members of the group root (normally just root) can use the file according to the set permissions.

          2. When you're both the owning user and group - you control the file even more entirely. Only your user and your personal group are "owners" and everyone else goes through the "others" permission set.

          Functionally on most modern systems, though, there is no difference between modes 1 and 2.






          share|improve this answer




















          • Thank you very much for taking your time to write really detailed answer.
            – Kashyap Kansara
            Feb 25 at 14:28










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "89"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1009508%2fwhat-is-the-difference-between-the-default-user-group-and-root-group%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          The difference is who has access to the file.



          As you're aware, there are three unique permission bits: the user (u), the group (g), and others (o). Each one of these can be treated differently depending on the set bits.



          For example, if a file is set to permissions 770 (rwxrwx---), it means both the owning user and owning group can read, write, and execute the file. If we disable the write bit for the group (resulting in rwxr-x---), it means the owning group can read and execute the file, but not edit it.



          So, why is this important? Say you're on a server with a bunch of other people making a website. All of these users are in a group we're going to call developers. We need all of the developers to be able to write to the file, so we give the group read and write permissions. This way, every developer can access the files they need.



          Now, let's say there's a folder in our fictional work environment that developers should be able to see, but not change. In that folder, we remove the write permission from the group. This allows devs to see it (and optionally run it), but not change it.



          However, as the root user, things are different. Root can already do whatever they want, so it doesn't really matter. It's important to note, though, that when root:root owns a file and write permissions are off for other users, nobody else can edit that file. This is very often used for system configurations that only admin users can touch.



          Now, what this means for your two questions:



          1. When you're the owning user and root is the owning group - you control the file entirely, and can set (useless) permissions for root. Similarly, members of the group root (normally just root) can use the file according to the set permissions.

          2. When you're both the owning user and group - you control the file even more entirely. Only your user and your personal group are "owners" and everyone else goes through the "others" permission set.

          Functionally on most modern systems, though, there is no difference between modes 1 and 2.






          share|improve this answer




















          • Thank you very much for taking your time to write really detailed answer.
            – Kashyap Kansara
            Feb 25 at 14:28














          up vote
          1
          down vote



          accepted










          The difference is who has access to the file.



          As you're aware, there are three unique permission bits: the user (u), the group (g), and others (o). Each one of these can be treated differently depending on the set bits.



          For example, if a file is set to permissions 770 (rwxrwx---), it means both the owning user and owning group can read, write, and execute the file. If we disable the write bit for the group (resulting in rwxr-x---), it means the owning group can read and execute the file, but not edit it.



          So, why is this important? Say you're on a server with a bunch of other people making a website. All of these users are in a group we're going to call developers. We need all of the developers to be able to write to the file, so we give the group read and write permissions. This way, every developer can access the files they need.



          Now, let's say there's a folder in our fictional work environment that developers should be able to see, but not change. In that folder, we remove the write permission from the group. This allows devs to see it (and optionally run it), but not change it.



          However, as the root user, things are different. Root can already do whatever they want, so it doesn't really matter. It's important to note, though, that when root:root owns a file and write permissions are off for other users, nobody else can edit that file. This is very often used for system configurations that only admin users can touch.



          Now, what this means for your two questions:



          1. When you're the owning user and root is the owning group - you control the file entirely, and can set (useless) permissions for root. Similarly, members of the group root (normally just root) can use the file according to the set permissions.

          2. When you're both the owning user and group - you control the file even more entirely. Only your user and your personal group are "owners" and everyone else goes through the "others" permission set.

          Functionally on most modern systems, though, there is no difference between modes 1 and 2.






          share|improve this answer




















          • Thank you very much for taking your time to write really detailed answer.
            – Kashyap Kansara
            Feb 25 at 14:28












          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          The difference is who has access to the file.



          As you're aware, there are three unique permission bits: the user (u), the group (g), and others (o). Each one of these can be treated differently depending on the set bits.



          For example, if a file is set to permissions 770 (rwxrwx---), it means both the owning user and owning group can read, write, and execute the file. If we disable the write bit for the group (resulting in rwxr-x---), it means the owning group can read and execute the file, but not edit it.



          So, why is this important? Say you're on a server with a bunch of other people making a website. All of these users are in a group we're going to call developers. We need all of the developers to be able to write to the file, so we give the group read and write permissions. This way, every developer can access the files they need.



          Now, let's say there's a folder in our fictional work environment that developers should be able to see, but not change. In that folder, we remove the write permission from the group. This allows devs to see it (and optionally run it), but not change it.



          However, as the root user, things are different. Root can already do whatever they want, so it doesn't really matter. It's important to note, though, that when root:root owns a file and write permissions are off for other users, nobody else can edit that file. This is very often used for system configurations that only admin users can touch.



          Now, what this means for your two questions:



          1. When you're the owning user and root is the owning group - you control the file entirely, and can set (useless) permissions for root. Similarly, members of the group root (normally just root) can use the file according to the set permissions.

          2. When you're both the owning user and group - you control the file even more entirely. Only your user and your personal group are "owners" and everyone else goes through the "others" permission set.

          Functionally on most modern systems, though, there is no difference between modes 1 and 2.






          share|improve this answer












          The difference is who has access to the file.



          As you're aware, there are three unique permission bits: the user (u), the group (g), and others (o). Each one of these can be treated differently depending on the set bits.



          For example, if a file is set to permissions 770 (rwxrwx---), it means both the owning user and owning group can read, write, and execute the file. If we disable the write bit for the group (resulting in rwxr-x---), it means the owning group can read and execute the file, but not edit it.



          So, why is this important? Say you're on a server with a bunch of other people making a website. All of these users are in a group we're going to call developers. We need all of the developers to be able to write to the file, so we give the group read and write permissions. This way, every developer can access the files they need.



          Now, let's say there's a folder in our fictional work environment that developers should be able to see, but not change. In that folder, we remove the write permission from the group. This allows devs to see it (and optionally run it), but not change it.



          However, as the root user, things are different. Root can already do whatever they want, so it doesn't really matter. It's important to note, though, that when root:root owns a file and write permissions are off for other users, nobody else can edit that file. This is very often used for system configurations that only admin users can touch.



          Now, what this means for your two questions:



          1. When you're the owning user and root is the owning group - you control the file entirely, and can set (useless) permissions for root. Similarly, members of the group root (normally just root) can use the file according to the set permissions.

          2. When you're both the owning user and group - you control the file even more entirely. Only your user and your personal group are "owners" and everyone else goes through the "others" permission set.

          Functionally on most modern systems, though, there is no difference between modes 1 and 2.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 25 at 6:08









          Kaz Wolfe

          25.6k1371131




          25.6k1371131











          • Thank you very much for taking your time to write really detailed answer.
            – Kashyap Kansara
            Feb 25 at 14:28
















          • Thank you very much for taking your time to write really detailed answer.
            – Kashyap Kansara
            Feb 25 at 14:28















          Thank you very much for taking your time to write really detailed answer.
          – Kashyap Kansara
          Feb 25 at 14:28




          Thank you very much for taking your time to write really detailed answer.
          – Kashyap Kansara
          Feb 25 at 14:28

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1009508%2fwhat-is-the-difference-between-the-default-user-group-and-root-group%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          pylint3 and pip3 broken

          Missing snmpget and snmpwalk

          How to enroll fingerprints to Ubuntu 17.10 with VFS491