Why do I have to use “sudo” when I am in the super user group?

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











up vote
3
down vote

favorite












[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ groups martin
martin : martin wheel


I am under my own home directory:



[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ pwd
/home/martin/anaconda3


But when I tried delete a file in my own directory, I received this error:



[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ rm test2.ipynb
mv: cannot create regular file ‘/export/.trash/test2.ipynb’: Permission denied


Why is that?










share|improve this question





















  • It looks like you have an alias or overriding script for rm; please edit in the output of type rm.
    – Michael Homer
    Aug 11 at 2:56














up vote
3
down vote

favorite












[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ groups martin
martin : martin wheel


I am under my own home directory:



[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ pwd
/home/martin/anaconda3


But when I tried delete a file in my own directory, I received this error:



[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ rm test2.ipynb
mv: cannot create regular file ‘/export/.trash/test2.ipynb’: Permission denied


Why is that?










share|improve this question





















  • It looks like you have an alias or overriding script for rm; please edit in the output of type rm.
    – Michael Homer
    Aug 11 at 2:56












up vote
3
down vote

favorite









up vote
3
down vote

favorite











[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ groups martin
martin : martin wheel


I am under my own home directory:



[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ pwd
/home/martin/anaconda3


But when I tried delete a file in my own directory, I received this error:



[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ rm test2.ipynb
mv: cannot create regular file ‘/export/.trash/test2.ipynb’: Permission denied


Why is that?










share|improve this question













[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ groups martin
martin : martin wheel


I am under my own home directory:



[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ pwd
/home/martin/anaconda3


But when I tried delete a file in my own directory, I received this error:



[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ rm test2.ipynb
mv: cannot create regular file ‘/export/.trash/test2.ipynb’: Permission denied


Why is that?







permissions authorization






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 11 at 2:46









user697911

1142




1142











  • It looks like you have an alias or overriding script for rm; please edit in the output of type rm.
    – Michael Homer
    Aug 11 at 2:56
















  • It looks like you have an alias or overriding script for rm; please edit in the output of type rm.
    – Michael Homer
    Aug 11 at 2:56















It looks like you have an alias or overriding script for rm; please edit in the output of type rm.
– Michael Homer
Aug 11 at 2:56




It looks like you have an alias or overriding script for rm; please edit in the output of type rm.
– Michael Homer
Aug 11 at 2:56










2 Answers
2






active

oldest

votes

















up vote
1
down vote













Background



The 3rd example you showed where you're attempting to rm the file looks to have the rm command overloaded with a sequence of commands, one of which, attempts to do a mv of the file to /export/.trash.



Permissions




[martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ rm test2.ipynb
mv: cannot create regular file ‘/export/.trash/test2.ipynb’: Permission denied




Look at the permissions for /export/.trash/:



$ ls -ld /export/.trash


Everything should be owned by your user 'martin' so that this account can delete files and optionally mv them to this directory.



I suspect someone used the sudo command when working in this directory and, perhaps accidentally, set the permissions of the .trash directory so that root owns it.



Overloaded command



Regarding your rm command. You can check if it's been overloaded as an alias or a shell function with the same name using the type command. Examples:



$ type -f rm
rm is aliased to `rm -i'

$ type -f mv
mv is aliased to `mv -i'


Here we can see that the mv and rm commands have been overloaded as aliases to mv -i and rm -i.






share|improve this answer





























    up vote
    0
    down vote













    I agree that the output from rm indicates the rm is an alias or a function doing something else, from the path name it seems to try to move to a trash directory instead of removing.



    To address the original question, group 0 (wheel) basically means nothing. On BSD based systems, su (not sudo) to root is restricted to members of the wheel grouup, but that is just a function of the su command on BSD and not a function of the OS itself.



    The sudo command is commonly used on Linux. It is highly configurable. Membership in group 0 can be made a requirement to be able to use sudo, but doesn't automatically use sudo.






    share|improve this answer




















      Your Answer







      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "106"
      ;
      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: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      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%2funix.stackexchange.com%2fquestions%2f461938%2fwhy-do-i-have-to-use-sudo-when-i-am-in-the-super-user-group%23new-answer', 'question_page');

      );

      Post as a guest






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote













      Background



      The 3rd example you showed where you're attempting to rm the file looks to have the rm command overloaded with a sequence of commands, one of which, attempts to do a mv of the file to /export/.trash.



      Permissions




      [martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ rm test2.ipynb
      mv: cannot create regular file ‘/export/.trash/test2.ipynb’: Permission denied




      Look at the permissions for /export/.trash/:



      $ ls -ld /export/.trash


      Everything should be owned by your user 'martin' so that this account can delete files and optionally mv them to this directory.



      I suspect someone used the sudo command when working in this directory and, perhaps accidentally, set the permissions of the .trash directory so that root owns it.



      Overloaded command



      Regarding your rm command. You can check if it's been overloaded as an alias or a shell function with the same name using the type command. Examples:



      $ type -f rm
      rm is aliased to `rm -i'

      $ type -f mv
      mv is aliased to `mv -i'


      Here we can see that the mv and rm commands have been overloaded as aliases to mv -i and rm -i.






      share|improve this answer


























        up vote
        1
        down vote













        Background



        The 3rd example you showed where you're attempting to rm the file looks to have the rm command overloaded with a sequence of commands, one of which, attempts to do a mv of the file to /export/.trash.



        Permissions




        [martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ rm test2.ipynb
        mv: cannot create regular file ‘/export/.trash/test2.ipynb’: Permission denied




        Look at the permissions for /export/.trash/:



        $ ls -ld /export/.trash


        Everything should be owned by your user 'martin' so that this account can delete files and optionally mv them to this directory.



        I suspect someone used the sudo command when working in this directory and, perhaps accidentally, set the permissions of the .trash directory so that root owns it.



        Overloaded command



        Regarding your rm command. You can check if it's been overloaded as an alias or a shell function with the same name using the type command. Examples:



        $ type -f rm
        rm is aliased to `rm -i'

        $ type -f mv
        mv is aliased to `mv -i'


        Here we can see that the mv and rm commands have been overloaded as aliases to mv -i and rm -i.






        share|improve this answer
























          up vote
          1
          down vote










          up vote
          1
          down vote









          Background



          The 3rd example you showed where you're attempting to rm the file looks to have the rm command overloaded with a sequence of commands, one of which, attempts to do a mv of the file to /export/.trash.



          Permissions




          [martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ rm test2.ipynb
          mv: cannot create regular file ‘/export/.trash/test2.ipynb’: Permission denied




          Look at the permissions for /export/.trash/:



          $ ls -ld /export/.trash


          Everything should be owned by your user 'martin' so that this account can delete files and optionally mv them to this directory.



          I suspect someone used the sudo command when working in this directory and, perhaps accidentally, set the permissions of the .trash directory so that root owns it.



          Overloaded command



          Regarding your rm command. You can check if it's been overloaded as an alias or a shell function with the same name using the type command. Examples:



          $ type -f rm
          rm is aliased to `rm -i'

          $ type -f mv
          mv is aliased to `mv -i'


          Here we can see that the mv and rm commands have been overloaded as aliases to mv -i and rm -i.






          share|improve this answer














          Background



          The 3rd example you showed where you're attempting to rm the file looks to have the rm command overloaded with a sequence of commands, one of which, attempts to do a mv of the file to /export/.trash.



          Permissions




          [martin@A08-R32-I196-2-FZ1RLP2 anaconda3]$ rm test2.ipynb
          mv: cannot create regular file ‘/export/.trash/test2.ipynb’: Permission denied




          Look at the permissions for /export/.trash/:



          $ ls -ld /export/.trash


          Everything should be owned by your user 'martin' so that this account can delete files and optionally mv them to this directory.



          I suspect someone used the sudo command when working in this directory and, perhaps accidentally, set the permissions of the .trash directory so that root owns it.



          Overloaded command



          Regarding your rm command. You can check if it's been overloaded as an alias or a shell function with the same name using the type command. Examples:



          $ type -f rm
          rm is aliased to `rm -i'

          $ type -f mv
          mv is aliased to `mv -i'


          Here we can see that the mv and rm commands have been overloaded as aliases to mv -i and rm -i.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 11 at 3:15

























          answered Aug 11 at 3:02









          slm♦

          238k65491662




          238k65491662






















              up vote
              0
              down vote













              I agree that the output from rm indicates the rm is an alias or a function doing something else, from the path name it seems to try to move to a trash directory instead of removing.



              To address the original question, group 0 (wheel) basically means nothing. On BSD based systems, su (not sudo) to root is restricted to members of the wheel grouup, but that is just a function of the su command on BSD and not a function of the OS itself.



              The sudo command is commonly used on Linux. It is highly configurable. Membership in group 0 can be made a requirement to be able to use sudo, but doesn't automatically use sudo.






              share|improve this answer
























                up vote
                0
                down vote













                I agree that the output from rm indicates the rm is an alias or a function doing something else, from the path name it seems to try to move to a trash directory instead of removing.



                To address the original question, group 0 (wheel) basically means nothing. On BSD based systems, su (not sudo) to root is restricted to members of the wheel grouup, but that is just a function of the su command on BSD and not a function of the OS itself.



                The sudo command is commonly used on Linux. It is highly configurable. Membership in group 0 can be made a requirement to be able to use sudo, but doesn't automatically use sudo.






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  I agree that the output from rm indicates the rm is an alias or a function doing something else, from the path name it seems to try to move to a trash directory instead of removing.



                  To address the original question, group 0 (wheel) basically means nothing. On BSD based systems, su (not sudo) to root is restricted to members of the wheel grouup, but that is just a function of the su command on BSD and not a function of the OS itself.



                  The sudo command is commonly used on Linux. It is highly configurable. Membership in group 0 can be made a requirement to be able to use sudo, but doesn't automatically use sudo.






                  share|improve this answer












                  I agree that the output from rm indicates the rm is an alias or a function doing something else, from the path name it seems to try to move to a trash directory instead of removing.



                  To address the original question, group 0 (wheel) basically means nothing. On BSD based systems, su (not sudo) to root is restricted to members of the wheel grouup, but that is just a function of the su command on BSD and not a function of the OS itself.



                  The sudo command is commonly used on Linux. It is highly configurable. Membership in group 0 can be made a requirement to be able to use sudo, but doesn't automatically use sudo.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 11 at 15:14









                  RalfFriedl

                  3,6401522




                  3,6401522



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461938%2fwhy-do-i-have-to-use-sudo-when-i-am-in-the-super-user-group%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Displaying single band from multi-band raster using QGIS

                      How many registers does an x86_64 CPU actually have?