Ubuntu Linux set default folder permissions for specific directory?

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











up vote
0
down vote

favorite












My web server is running on Ubuntu Linux. The user www-data is able to create directories inside the /data/ directory but the permissions on a newly created directory is 345.



How can I make the default permissions for a directory created by the user www-data in /data/ 774?



  1. The folder owner is www-data and the user group is www-data.



  2. I've tried doing the following:



    sudo setfacl -dR -m g::rwx,u::rwx /data/ 
    sudo chmod -R 774 /data


  3. Could it be umask related?



  4. My getfacl output is as follows:



    getfacl: Removing leading '/' from absolute path names
    # file: data/
    # owner: www-data
    # group: www-data
    # flags: -s-
    user::rwx
    user:www-data:rwx
    user:ubuntu:rwx
    group::rwx
    mask::rwx
    other::rwx
    default:user::rwx
    default:group::rwx
    default:other::rwx


How can I achieve this?







share|improve this question


























    up vote
    0
    down vote

    favorite












    My web server is running on Ubuntu Linux. The user www-data is able to create directories inside the /data/ directory but the permissions on a newly created directory is 345.



    How can I make the default permissions for a directory created by the user www-data in /data/ 774?



    1. The folder owner is www-data and the user group is www-data.



    2. I've tried doing the following:



      sudo setfacl -dR -m g::rwx,u::rwx /data/ 
      sudo chmod -R 774 /data


    3. Could it be umask related?



    4. My getfacl output is as follows:



      getfacl: Removing leading '/' from absolute path names
      # file: data/
      # owner: www-data
      # group: www-data
      # flags: -s-
      user::rwx
      user:www-data:rwx
      user:ubuntu:rwx
      group::rwx
      mask::rwx
      other::rwx
      default:user::rwx
      default:group::rwx
      default:other::rwx


    How can I achieve this?







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      My web server is running on Ubuntu Linux. The user www-data is able to create directories inside the /data/ directory but the permissions on a newly created directory is 345.



      How can I make the default permissions for a directory created by the user www-data in /data/ 774?



      1. The folder owner is www-data and the user group is www-data.



      2. I've tried doing the following:



        sudo setfacl -dR -m g::rwx,u::rwx /data/ 
        sudo chmod -R 774 /data


      3. Could it be umask related?



      4. My getfacl output is as follows:



        getfacl: Removing leading '/' from absolute path names
        # file: data/
        # owner: www-data
        # group: www-data
        # flags: -s-
        user::rwx
        user:www-data:rwx
        user:ubuntu:rwx
        group::rwx
        mask::rwx
        other::rwx
        default:user::rwx
        default:group::rwx
        default:other::rwx


      How can I achieve this?







      share|improve this question














      My web server is running on Ubuntu Linux. The user www-data is able to create directories inside the /data/ directory but the permissions on a newly created directory is 345.



      How can I make the default permissions for a directory created by the user www-data in /data/ 774?



      1. The folder owner is www-data and the user group is www-data.



      2. I've tried doing the following:



        sudo setfacl -dR -m g::rwx,u::rwx /data/ 
        sudo chmod -R 774 /data


      3. Could it be umask related?



      4. My getfacl output is as follows:



        getfacl: Removing leading '/' from absolute path names
        # file: data/
        # owner: www-data
        # group: www-data
        # flags: -s-
        user::rwx
        user:www-data:rwx
        user:ubuntu:rwx
        group::rwx
        mask::rwx
        other::rwx
        default:user::rwx
        default:group::rwx
        default:other::rwx


      How can I achieve this?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 19 at 9:28









      aliceinpalth

      760116




      760116










      asked Feb 19 at 5:48









      Asma.Said

      1




      1




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          My answer would indeed be "umask". With umask you indicate what permissions should be removed. In your case, 3.



          umask 003


          www-data needs to set that before creating files or directories.






          share|improve this answer




















          • how would you set umask for specific user "www-data" per directory ? Thanks
            – Asma.Said
            Feb 19 at 9:45











          • It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
            – Gerard H. Pille
            Feb 19 at 9:56










          • yes it's Apache httpd, and it's using mkdir
            – Asma.Said
            Feb 19 at 10:47










          • I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
            – Gerard H. Pille
            Feb 19 at 14:16










          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%2f425088%2fubuntu-linux-set-default-folder-permissions-for-specific-directory%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
          0
          down vote













          My answer would indeed be "umask". With umask you indicate what permissions should be removed. In your case, 3.



          umask 003


          www-data needs to set that before creating files or directories.






          share|improve this answer




















          • how would you set umask for specific user "www-data" per directory ? Thanks
            – Asma.Said
            Feb 19 at 9:45











          • It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
            – Gerard H. Pille
            Feb 19 at 9:56










          • yes it's Apache httpd, and it's using mkdir
            – Asma.Said
            Feb 19 at 10:47










          • I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
            – Gerard H. Pille
            Feb 19 at 14:16














          up vote
          0
          down vote













          My answer would indeed be "umask". With umask you indicate what permissions should be removed. In your case, 3.



          umask 003


          www-data needs to set that before creating files or directories.






          share|improve this answer




















          • how would you set umask for specific user "www-data" per directory ? Thanks
            – Asma.Said
            Feb 19 at 9:45











          • It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
            – Gerard H. Pille
            Feb 19 at 9:56










          • yes it's Apache httpd, and it's using mkdir
            – Asma.Said
            Feb 19 at 10:47










          • I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
            – Gerard H. Pille
            Feb 19 at 14:16












          up vote
          0
          down vote










          up vote
          0
          down vote









          My answer would indeed be "umask". With umask you indicate what permissions should be removed. In your case, 3.



          umask 003


          www-data needs to set that before creating files or directories.






          share|improve this answer












          My answer would indeed be "umask". With umask you indicate what permissions should be removed. In your case, 3.



          umask 003


          www-data needs to set that before creating files or directories.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Feb 19 at 8:41









          Gerard H. Pille

          1,169212




          1,169212











          • how would you set umask for specific user "www-data" per directory ? Thanks
            – Asma.Said
            Feb 19 at 9:45











          • It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
            – Gerard H. Pille
            Feb 19 at 9:56










          • yes it's Apache httpd, and it's using mkdir
            – Asma.Said
            Feb 19 at 10:47










          • I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
            – Gerard H. Pille
            Feb 19 at 14:16
















          • how would you set umask for specific user "www-data" per directory ? Thanks
            – Asma.Said
            Feb 19 at 9:45











          • It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
            – Gerard H. Pille
            Feb 19 at 9:56










          • yes it's Apache httpd, and it's using mkdir
            – Asma.Said
            Feb 19 at 10:47










          • I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
            – Gerard H. Pille
            Feb 19 at 14:16















          how would you set umask for specific user "www-data" per directory ? Thanks
          – Asma.Said
          Feb 19 at 9:45





          how would you set umask for specific user "www-data" per directory ? Thanks
          – Asma.Said
          Feb 19 at 9:45













          It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
          – Gerard H. Pille
          Feb 19 at 9:56




          It's not set "per directory". Once set, it's effective for all new directories and files created. For a normal user account, you'd set this in his profile. But www-data is a service user, a daemon. I suppose we're talking about Apache, httpd? What process is actually creating the new directories?
          – Gerard H. Pille
          Feb 19 at 9:56












          yes it's Apache httpd, and it's using mkdir
          – Asma.Said
          Feb 19 at 10:47




          yes it's Apache httpd, and it's using mkdir
          – Asma.Said
          Feb 19 at 10:47












          I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
          – Gerard H. Pille
          Feb 19 at 14:16




          I know Apache rather well, but still don't know how you could do a "mkdir", which is a shell command. Can you explain?
          – Gerard H. Pille
          Feb 19 at 14:16












           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f425088%2fubuntu-linux-set-default-folder-permissions-for-specific-directory%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          Peggy Mitchell

          Palaiologos

          The Forum (Inglewood, California)