How to chown directory for multiple users?












4















Specs:
Running Centos 6
64 Bit



I am trying to chown a directory for all users on the VPS, aswell as for apache. But for some reason I can only have either apache, or just the users.



I tried doing the normal chown command but making a user a owner then apache the group, and vice versa.



travis:apache and apache:travis



I have to do it fully as in apache:apache or travis:travis.



The usual command I run to chown a user:



sudo chown -R userhere:userhere /path/to/whatever/i/need



For either to work fully.



Why is this important? Because whenver I am using wordpress, or any script that gives basic input to modify other items on the VPS it requires the apache to have access.



If its on apache the perms change to 48/48.



If I want users to be able to have FTP access I have to do userhere:userhere for it to work. But in the end I wont be able to use the web based scripts again.



Really lost, please help..



I am also confused about another perms issue: https://superuser.com/questions/694746/centos-6-31592-31592-use-group-permissions










share|improve this question





























    4















    Specs:
    Running Centos 6
    64 Bit



    I am trying to chown a directory for all users on the VPS, aswell as for apache. But for some reason I can only have either apache, or just the users.



    I tried doing the normal chown command but making a user a owner then apache the group, and vice versa.



    travis:apache and apache:travis



    I have to do it fully as in apache:apache or travis:travis.



    The usual command I run to chown a user:



    sudo chown -R userhere:userhere /path/to/whatever/i/need



    For either to work fully.



    Why is this important? Because whenver I am using wordpress, or any script that gives basic input to modify other items on the VPS it requires the apache to have access.



    If its on apache the perms change to 48/48.



    If I want users to be able to have FTP access I have to do userhere:userhere for it to work. But in the end I wont be able to use the web based scripts again.



    Really lost, please help..



    I am also confused about another perms issue: https://superuser.com/questions/694746/centos-6-31592-31592-use-group-permissions










    share|improve this question



























      4












      4








      4


      1






      Specs:
      Running Centos 6
      64 Bit



      I am trying to chown a directory for all users on the VPS, aswell as for apache. But for some reason I can only have either apache, or just the users.



      I tried doing the normal chown command but making a user a owner then apache the group, and vice versa.



      travis:apache and apache:travis



      I have to do it fully as in apache:apache or travis:travis.



      The usual command I run to chown a user:



      sudo chown -R userhere:userhere /path/to/whatever/i/need



      For either to work fully.



      Why is this important? Because whenver I am using wordpress, or any script that gives basic input to modify other items on the VPS it requires the apache to have access.



      If its on apache the perms change to 48/48.



      If I want users to be able to have FTP access I have to do userhere:userhere for it to work. But in the end I wont be able to use the web based scripts again.



      Really lost, please help..



      I am also confused about another perms issue: https://superuser.com/questions/694746/centos-6-31592-31592-use-group-permissions










      share|improve this question
















      Specs:
      Running Centos 6
      64 Bit



      I am trying to chown a directory for all users on the VPS, aswell as for apache. But for some reason I can only have either apache, or just the users.



      I tried doing the normal chown command but making a user a owner then apache the group, and vice versa.



      travis:apache and apache:travis



      I have to do it fully as in apache:apache or travis:travis.



      The usual command I run to chown a user:



      sudo chown -R userhere:userhere /path/to/whatever/i/need



      For either to work fully.



      Why is this important? Because whenver I am using wordpress, or any script that gives basic input to modify other items on the VPS it requires the apache to have access.



      If its on apache the perms change to 48/48.



      If I want users to be able to have FTP access I have to do userhere:userhere for it to work. But in the end I wont be able to use the web based scripts again.



      Really lost, please help..



      I am also confused about another perms issue: https://superuser.com/questions/694746/centos-6-31592-31592-use-group-permissions







      linux permissions centos apache-http-server ftp






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 20 '17 at 10:17









      Community

      1




      1










      asked Dec 31 '13 at 5:06









      TravisTravis

      582614




      582614






















          2 Answers
          2






          active

          oldest

          votes


















          15














          You'll need a group with apache and all the VPS users in it, call it vpsusers for instance



          # do this as root
          groupadd vpsusers
          gpasswd -a apache vpsusers
          gpasswd -a bob vpsusers # if you have a user named bob
          gpasswd -a alice vpsusers # if you have a user name alice
          # etc...


          And then make that group the group owner of the directory in question, eg



          # also do this as root
          chown -R :vpsusers /your/directory


          And finally, make that group-writeable



          # again, as root
          chmod -R g+w /your/directory


          (As always, think about what you're doing before you chmod or chown...)






          share|improve this answer


























          • Superb man, it helps me a lot

            – Er.KT
            Jul 1 '15 at 7:18











          • can you tell a bit more? you say: ...And then make that group the group owner of the directory in question..., but under that, you are naming only apache user in that line. what does that mean? should we execute same commands for other users too, one by one? or why only apache ? I think you should have used just chown -R :vpsusers /your/directory , right?

            – T.Todua
            Jan 7 at 13:10





















          2














          Just use this linux command



          sudo chown -R :users your_directory





          share|improve this answer



















          • 3





            While this may answer the question, it would be a better answer if you could provide some explanation why it does so.

            – DavidPostill
            Oct 23 '17 at 19:10











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f695162%2fhow-to-chown-directory-for-multiple-users%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          15














          You'll need a group with apache and all the VPS users in it, call it vpsusers for instance



          # do this as root
          groupadd vpsusers
          gpasswd -a apache vpsusers
          gpasswd -a bob vpsusers # if you have a user named bob
          gpasswd -a alice vpsusers # if you have a user name alice
          # etc...


          And then make that group the group owner of the directory in question, eg



          # also do this as root
          chown -R :vpsusers /your/directory


          And finally, make that group-writeable



          # again, as root
          chmod -R g+w /your/directory


          (As always, think about what you're doing before you chmod or chown...)






          share|improve this answer


























          • Superb man, it helps me a lot

            – Er.KT
            Jul 1 '15 at 7:18











          • can you tell a bit more? you say: ...And then make that group the group owner of the directory in question..., but under that, you are naming only apache user in that line. what does that mean? should we execute same commands for other users too, one by one? or why only apache ? I think you should have used just chown -R :vpsusers /your/directory , right?

            – T.Todua
            Jan 7 at 13:10


















          15














          You'll need a group with apache and all the VPS users in it, call it vpsusers for instance



          # do this as root
          groupadd vpsusers
          gpasswd -a apache vpsusers
          gpasswd -a bob vpsusers # if you have a user named bob
          gpasswd -a alice vpsusers # if you have a user name alice
          # etc...


          And then make that group the group owner of the directory in question, eg



          # also do this as root
          chown -R :vpsusers /your/directory


          And finally, make that group-writeable



          # again, as root
          chmod -R g+w /your/directory


          (As always, think about what you're doing before you chmod or chown...)






          share|improve this answer


























          • Superb man, it helps me a lot

            – Er.KT
            Jul 1 '15 at 7:18











          • can you tell a bit more? you say: ...And then make that group the group owner of the directory in question..., but under that, you are naming only apache user in that line. what does that mean? should we execute same commands for other users too, one by one? or why only apache ? I think you should have used just chown -R :vpsusers /your/directory , right?

            – T.Todua
            Jan 7 at 13:10
















          15












          15








          15







          You'll need a group with apache and all the VPS users in it, call it vpsusers for instance



          # do this as root
          groupadd vpsusers
          gpasswd -a apache vpsusers
          gpasswd -a bob vpsusers # if you have a user named bob
          gpasswd -a alice vpsusers # if you have a user name alice
          # etc...


          And then make that group the group owner of the directory in question, eg



          # also do this as root
          chown -R :vpsusers /your/directory


          And finally, make that group-writeable



          # again, as root
          chmod -R g+w /your/directory


          (As always, think about what you're doing before you chmod or chown...)






          share|improve this answer















          You'll need a group with apache and all the VPS users in it, call it vpsusers for instance



          # do this as root
          groupadd vpsusers
          gpasswd -a apache vpsusers
          gpasswd -a bob vpsusers # if you have a user named bob
          gpasswd -a alice vpsusers # if you have a user name alice
          # etc...


          And then make that group the group owner of the directory in question, eg



          # also do this as root
          chown -R :vpsusers /your/directory


          And finally, make that group-writeable



          # again, as root
          chmod -R g+w /your/directory


          (As always, think about what you're doing before you chmod or chown...)







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 7 at 13:55









          T.Todua

          1,44631728




          1,44631728










          answered Dec 31 '13 at 6:10









          BandramiBandrami

          1,2981014




          1,2981014













          • Superb man, it helps me a lot

            – Er.KT
            Jul 1 '15 at 7:18











          • can you tell a bit more? you say: ...And then make that group the group owner of the directory in question..., but under that, you are naming only apache user in that line. what does that mean? should we execute same commands for other users too, one by one? or why only apache ? I think you should have used just chown -R :vpsusers /your/directory , right?

            – T.Todua
            Jan 7 at 13:10





















          • Superb man, it helps me a lot

            – Er.KT
            Jul 1 '15 at 7:18











          • can you tell a bit more? you say: ...And then make that group the group owner of the directory in question..., but under that, you are naming only apache user in that line. what does that mean? should we execute same commands for other users too, one by one? or why only apache ? I think you should have used just chown -R :vpsusers /your/directory , right?

            – T.Todua
            Jan 7 at 13:10



















          Superb man, it helps me a lot

          – Er.KT
          Jul 1 '15 at 7:18





          Superb man, it helps me a lot

          – Er.KT
          Jul 1 '15 at 7:18













          can you tell a bit more? you say: ...And then make that group the group owner of the directory in question..., but under that, you are naming only apache user in that line. what does that mean? should we execute same commands for other users too, one by one? or why only apache ? I think you should have used just chown -R :vpsusers /your/directory , right?

          – T.Todua
          Jan 7 at 13:10







          can you tell a bit more? you say: ...And then make that group the group owner of the directory in question..., but under that, you are naming only apache user in that line. what does that mean? should we execute same commands for other users too, one by one? or why only apache ? I think you should have used just chown -R :vpsusers /your/directory , right?

          – T.Todua
          Jan 7 at 13:10















          2














          Just use this linux command



          sudo chown -R :users your_directory





          share|improve this answer



















          • 3





            While this may answer the question, it would be a better answer if you could provide some explanation why it does so.

            – DavidPostill
            Oct 23 '17 at 19:10
















          2














          Just use this linux command



          sudo chown -R :users your_directory





          share|improve this answer



















          • 3





            While this may answer the question, it would be a better answer if you could provide some explanation why it does so.

            – DavidPostill
            Oct 23 '17 at 19:10














          2












          2








          2







          Just use this linux command



          sudo chown -R :users your_directory





          share|improve this answer













          Just use this linux command



          sudo chown -R :users your_directory






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Oct 23 '17 at 18:45









          Δημητρης ΠαππάςΔημητρης Παππάς

          1211




          1211








          • 3





            While this may answer the question, it would be a better answer if you could provide some explanation why it does so.

            – DavidPostill
            Oct 23 '17 at 19:10














          • 3





            While this may answer the question, it would be a better answer if you could provide some explanation why it does so.

            – DavidPostill
            Oct 23 '17 at 19:10








          3




          3





          While this may answer the question, it would be a better answer if you could provide some explanation why it does so.

          – DavidPostill
          Oct 23 '17 at 19:10





          While this may answer the question, it would be a better answer if you could provide some explanation why it does so.

          – DavidPostill
          Oct 23 '17 at 19:10


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f695162%2fhow-to-chown-directory-for-multiple-users%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

          Mangá

          Eduardo VII do Reino Unido