How to add a second owner of a folder using terminal on Mac?

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











up vote
4
down vote

favorite












On Mac using terminal and "chown" command I can set owner for a folder like this:



sudo chown -R _www somefolder


However this replaces me with _www.
I.e. I'm not in the list of owners anymore.



enter image description here



I then have to open folder properties in Finder, add myself as a second owner and set permissions using the GUI.



enter image description here



And this is what the ACL looks like:



enter image description here



Is there a way to add TWO owners using terminal?
In other words how to add a second owner to a folder using terminal?
Not necessarily chown.



PS: Just in case.. on the screenshots users "_www" and "Oleg (Я)" have permissions "Read and write".







share|improve this question


















  • 1




    How do the permissions of the file with two owners look like in terminal. I doubt the Mac does this via POSIX file attributes, but via some ACL stuff.
    – Philippos
    Feb 9 at 14:01










  • You can't add a second owner. You may check for ACLs, if ordinary group-based security permission is not enough. You may also consider to own the file by a third user (root, nobody, or any neutral third account), and giving the access to both of users by group-based rules or by acls.
    – peterh
    Feb 9 at 14:25














up vote
4
down vote

favorite












On Mac using terminal and "chown" command I can set owner for a folder like this:



sudo chown -R _www somefolder


However this replaces me with _www.
I.e. I'm not in the list of owners anymore.



enter image description here



I then have to open folder properties in Finder, add myself as a second owner and set permissions using the GUI.



enter image description here



And this is what the ACL looks like:



enter image description here



Is there a way to add TWO owners using terminal?
In other words how to add a second owner to a folder using terminal?
Not necessarily chown.



PS: Just in case.. on the screenshots users "_www" and "Oleg (Я)" have permissions "Read and write".







share|improve this question


















  • 1




    How do the permissions of the file with two owners look like in terminal. I doubt the Mac does this via POSIX file attributes, but via some ACL stuff.
    – Philippos
    Feb 9 at 14:01










  • You can't add a second owner. You may check for ACLs, if ordinary group-based security permission is not enough. You may also consider to own the file by a third user (root, nobody, or any neutral third account), and giving the access to both of users by group-based rules or by acls.
    – peterh
    Feb 9 at 14:25












up vote
4
down vote

favorite









up vote
4
down vote

favorite











On Mac using terminal and "chown" command I can set owner for a folder like this:



sudo chown -R _www somefolder


However this replaces me with _www.
I.e. I'm not in the list of owners anymore.



enter image description here



I then have to open folder properties in Finder, add myself as a second owner and set permissions using the GUI.



enter image description here



And this is what the ACL looks like:



enter image description here



Is there a way to add TWO owners using terminal?
In other words how to add a second owner to a folder using terminal?
Not necessarily chown.



PS: Just in case.. on the screenshots users "_www" and "Oleg (Я)" have permissions "Read and write".







share|improve this question














On Mac using terminal and "chown" command I can set owner for a folder like this:



sudo chown -R _www somefolder


However this replaces me with _www.
I.e. I'm not in the list of owners anymore.



enter image description here



I then have to open folder properties in Finder, add myself as a second owner and set permissions using the GUI.



enter image description here



And this is what the ACL looks like:



enter image description here



Is there a way to add TWO owners using terminal?
In other words how to add a second owner to a folder using terminal?
Not necessarily chown.



PS: Just in case.. on the screenshots users "_www" and "Oleg (Я)" have permissions "Read and write".









share|improve this question













share|improve this question




share|improve this question








edited Feb 9 at 14:29

























asked Feb 9 at 13:53









Oleg

315




315







  • 1




    How do the permissions of the file with two owners look like in terminal. I doubt the Mac does this via POSIX file attributes, but via some ACL stuff.
    – Philippos
    Feb 9 at 14:01










  • You can't add a second owner. You may check for ACLs, if ordinary group-based security permission is not enough. You may also consider to own the file by a third user (root, nobody, or any neutral third account), and giving the access to both of users by group-based rules or by acls.
    – peterh
    Feb 9 at 14:25












  • 1




    How do the permissions of the file with two owners look like in terminal. I doubt the Mac does this via POSIX file attributes, but via some ACL stuff.
    – Philippos
    Feb 9 at 14:01










  • You can't add a second owner. You may check for ACLs, if ordinary group-based security permission is not enough. You may also consider to own the file by a third user (root, nobody, or any neutral third account), and giving the access to both of users by group-based rules or by acls.
    – peterh
    Feb 9 at 14:25







1




1




How do the permissions of the file with two owners look like in terminal. I doubt the Mac does this via POSIX file attributes, but via some ACL stuff.
– Philippos
Feb 9 at 14:01




How do the permissions of the file with two owners look like in terminal. I doubt the Mac does this via POSIX file attributes, but via some ACL stuff.
– Philippos
Feb 9 at 14:01












You can't add a second owner. You may check for ACLs, if ordinary group-based security permission is not enough. You may also consider to own the file by a third user (root, nobody, or any neutral third account), and giving the access to both of users by group-based rules or by acls.
– peterh
Feb 9 at 14:25




You can't add a second owner. You may check for ACLs, if ordinary group-based security permission is not enough. You may also consider to own the file by a third user (root, nobody, or any neutral third account), and giving the access to both of users by group-based rules or by acls.
– peterh
Feb 9 at 14:25










3 Answers
3






active

oldest

votes

















up vote
1
down vote













This is not possible because a Unix file have one owner, try to use a group instead.






share|improve this answer




















  • Side note: surprising, but in Unix, the Owner and the Group are both a single integer, and nothing forbids for multiple users to have the same user-id. Thus, in the view of the kernel permission checking, there is no essential difference between uid and gid.
    – peterh
    Feb 9 at 14:23










  • @peterh "two users" with the same uid are not "two users" but one user with two names. The uid is what defines a user, not the name. Also, "there is no essential difference between uid and gid" is just nonsense - were you drunk when you wrote that?
    – cas
    Feb 10 at 1:59

















up vote
1
down vote













this is a xy-problem



X:problem, how can two user access same file, with same right ?



solution I use multiple chown => Y:problem



Solution for X problem



according to http://aplawrence.com/MacOSX/acl.html



you can use



 chmod +a "allow Oleg list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown"
chmod +a "allow _www list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown"


I can't test it right now, I don't have mac OS 10.5 available.



You might replace the long string above with the result of ls -e



Y:solution: I try to use multiple chown.



This is not possible:
Unix/Linux/OS X's file have only one owner at a time.






share|improve this answer



























    up vote
    1
    down vote



    accepted










    Found the answer (type this in Terminal):



    sudo chmod +a 'Oleg allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity' somefolder


    Where 'Oleg' is a user name and 'somefolder' is a folder name in question.



    The permissions inside single quotes after the 'allow' keyword are just copied from the output of ls -le



    Now both users '_www' and 'Oleg' can read, write files and subdirectories, etc.



    That was the intention.



    Strictly speaking yes, you can not add a second "owner" in POSIX attributes sense, e.g. via Chown.



    However in Mac you can give owner-like permissions to numerous users via ACL like Philippos commented (thanks for hinting).






    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%2f423048%2fhow-to-add-a-second-owner-of-a-folder-using-terminal-on-mac%23new-answer', 'question_page');

      );

      Post as a guest






























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      1
      down vote













      This is not possible because a Unix file have one owner, try to use a group instead.






      share|improve this answer




















      • Side note: surprising, but in Unix, the Owner and the Group are both a single integer, and nothing forbids for multiple users to have the same user-id. Thus, in the view of the kernel permission checking, there is no essential difference between uid and gid.
        – peterh
        Feb 9 at 14:23










      • @peterh "two users" with the same uid are not "two users" but one user with two names. The uid is what defines a user, not the name. Also, "there is no essential difference between uid and gid" is just nonsense - were you drunk when you wrote that?
        – cas
        Feb 10 at 1:59














      up vote
      1
      down vote













      This is not possible because a Unix file have one owner, try to use a group instead.






      share|improve this answer




















      • Side note: surprising, but in Unix, the Owner and the Group are both a single integer, and nothing forbids for multiple users to have the same user-id. Thus, in the view of the kernel permission checking, there is no essential difference between uid and gid.
        – peterh
        Feb 9 at 14:23










      • @peterh "two users" with the same uid are not "two users" but one user with two names. The uid is what defines a user, not the name. Also, "there is no essential difference between uid and gid" is just nonsense - were you drunk when you wrote that?
        – cas
        Feb 10 at 1:59












      up vote
      1
      down vote










      up vote
      1
      down vote









      This is not possible because a Unix file have one owner, try to use a group instead.






      share|improve this answer












      This is not possible because a Unix file have one owner, try to use a group instead.







      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Feb 9 at 14:00









      Lionel Bino

      1192




      1192











      • Side note: surprising, but in Unix, the Owner and the Group are both a single integer, and nothing forbids for multiple users to have the same user-id. Thus, in the view of the kernel permission checking, there is no essential difference between uid and gid.
        – peterh
        Feb 9 at 14:23










      • @peterh "two users" with the same uid are not "two users" but one user with two names. The uid is what defines a user, not the name. Also, "there is no essential difference between uid and gid" is just nonsense - were you drunk when you wrote that?
        – cas
        Feb 10 at 1:59
















      • Side note: surprising, but in Unix, the Owner and the Group are both a single integer, and nothing forbids for multiple users to have the same user-id. Thus, in the view of the kernel permission checking, there is no essential difference between uid and gid.
        – peterh
        Feb 9 at 14:23










      • @peterh "two users" with the same uid are not "two users" but one user with two names. The uid is what defines a user, not the name. Also, "there is no essential difference between uid and gid" is just nonsense - were you drunk when you wrote that?
        – cas
        Feb 10 at 1:59















      Side note: surprising, but in Unix, the Owner and the Group are both a single integer, and nothing forbids for multiple users to have the same user-id. Thus, in the view of the kernel permission checking, there is no essential difference between uid and gid.
      – peterh
      Feb 9 at 14:23




      Side note: surprising, but in Unix, the Owner and the Group are both a single integer, and nothing forbids for multiple users to have the same user-id. Thus, in the view of the kernel permission checking, there is no essential difference between uid and gid.
      – peterh
      Feb 9 at 14:23












      @peterh "two users" with the same uid are not "two users" but one user with two names. The uid is what defines a user, not the name. Also, "there is no essential difference between uid and gid" is just nonsense - were you drunk when you wrote that?
      – cas
      Feb 10 at 1:59




      @peterh "two users" with the same uid are not "two users" but one user with two names. The uid is what defines a user, not the name. Also, "there is no essential difference between uid and gid" is just nonsense - were you drunk when you wrote that?
      – cas
      Feb 10 at 1:59












      up vote
      1
      down vote













      this is a xy-problem



      X:problem, how can two user access same file, with same right ?



      solution I use multiple chown => Y:problem



      Solution for X problem



      according to http://aplawrence.com/MacOSX/acl.html



      you can use



       chmod +a "allow Oleg list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown"
      chmod +a "allow _www list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown"


      I can't test it right now, I don't have mac OS 10.5 available.



      You might replace the long string above with the result of ls -e



      Y:solution: I try to use multiple chown.



      This is not possible:
      Unix/Linux/OS X's file have only one owner at a time.






      share|improve this answer
























        up vote
        1
        down vote













        this is a xy-problem



        X:problem, how can two user access same file, with same right ?



        solution I use multiple chown => Y:problem



        Solution for X problem



        according to http://aplawrence.com/MacOSX/acl.html



        you can use



         chmod +a "allow Oleg list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown"
        chmod +a "allow _www list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown"


        I can't test it right now, I don't have mac OS 10.5 available.



        You might replace the long string above with the result of ls -e



        Y:solution: I try to use multiple chown.



        This is not possible:
        Unix/Linux/OS X's file have only one owner at a time.






        share|improve this answer






















          up vote
          1
          down vote










          up vote
          1
          down vote









          this is a xy-problem



          X:problem, how can two user access same file, with same right ?



          solution I use multiple chown => Y:problem



          Solution for X problem



          according to http://aplawrence.com/MacOSX/acl.html



          you can use



           chmod +a "allow Oleg list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown"
          chmod +a "allow _www list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown"


          I can't test it right now, I don't have mac OS 10.5 available.



          You might replace the long string above with the result of ls -e



          Y:solution: I try to use multiple chown.



          This is not possible:
          Unix/Linux/OS X's file have only one owner at a time.






          share|improve this answer












          this is a xy-problem



          X:problem, how can two user access same file, with same right ?



          solution I use multiple chown => Y:problem



          Solution for X problem



          according to http://aplawrence.com/MacOSX/acl.html



          you can use



           chmod +a "allow Oleg list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown"
          chmod +a "allow _www list,search,add_file,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity,writesecurity,chown"


          I can't test it right now, I don't have mac OS 10.5 available.



          You might replace the long string above with the result of ls -e



          Y:solution: I try to use multiple chown.



          This is not possible:
          Unix/Linux/OS X's file have only one owner at a time.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 9 at 14:55









          Archemar

          19k93366




          19k93366




















              up vote
              1
              down vote



              accepted










              Found the answer (type this in Terminal):



              sudo chmod +a 'Oleg allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity' somefolder


              Where 'Oleg' is a user name and 'somefolder' is a folder name in question.



              The permissions inside single quotes after the 'allow' keyword are just copied from the output of ls -le



              Now both users '_www' and 'Oleg' can read, write files and subdirectories, etc.



              That was the intention.



              Strictly speaking yes, you can not add a second "owner" in POSIX attributes sense, e.g. via Chown.



              However in Mac you can give owner-like permissions to numerous users via ACL like Philippos commented (thanks for hinting).






              share|improve this answer
























                up vote
                1
                down vote



                accepted










                Found the answer (type this in Terminal):



                sudo chmod +a 'Oleg allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity' somefolder


                Where 'Oleg' is a user name and 'somefolder' is a folder name in question.



                The permissions inside single quotes after the 'allow' keyword are just copied from the output of ls -le



                Now both users '_www' and 'Oleg' can read, write files and subdirectories, etc.



                That was the intention.



                Strictly speaking yes, you can not add a second "owner" in POSIX attributes sense, e.g. via Chown.



                However in Mac you can give owner-like permissions to numerous users via ACL like Philippos commented (thanks for hinting).






                share|improve this answer






















                  up vote
                  1
                  down vote



                  accepted







                  up vote
                  1
                  down vote



                  accepted






                  Found the answer (type this in Terminal):



                  sudo chmod +a 'Oleg allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity' somefolder


                  Where 'Oleg' is a user name and 'somefolder' is a folder name in question.



                  The permissions inside single quotes after the 'allow' keyword are just copied from the output of ls -le



                  Now both users '_www' and 'Oleg' can read, write files and subdirectories, etc.



                  That was the intention.



                  Strictly speaking yes, you can not add a second "owner" in POSIX attributes sense, e.g. via Chown.



                  However in Mac you can give owner-like permissions to numerous users via ACL like Philippos commented (thanks for hinting).






                  share|improve this answer












                  Found the answer (type this in Terminal):



                  sudo chmod +a 'Oleg allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity' somefolder


                  Where 'Oleg' is a user name and 'somefolder' is a folder name in question.



                  The permissions inside single quotes after the 'allow' keyword are just copied from the output of ls -le



                  Now both users '_www' and 'Oleg' can read, write files and subdirectories, etc.



                  That was the intention.



                  Strictly speaking yes, you can not add a second "owner" in POSIX attributes sense, e.g. via Chown.



                  However in Mac you can give owner-like permissions to numerous users via ACL like Philippos commented (thanks for hinting).







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 9 at 14:59









                  Oleg

                  315




                  315






















                       

                      draft saved


                      draft discarded


























                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f423048%2fhow-to-add-a-second-owner-of-a-folder-using-terminal-on-mac%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Popular posts from this blog

                      Peggy Mitchell

                      Palaiologos

                      The Forum (Inglewood, California)