Welcome to Centmin Mod Community
Become a Member

Nginx/php-fpm umask setting

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by Meirami, Apr 24, 2018.

  1. Meirami

    Meirami Member

    130
    17
    18
    Dec 21, 2017
    Ratings:
    +44
    Local Time:
    3:12 PM
    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 7.4 64bit
    • Centmin Mod Version Installed:
      123.09beta01.b018
    • Nginx Version Installed: 1.13.10
    • PHP Version Installed: 7.2.4
    • MariaDB MySQL Version Installed: 10.1.32
    • When was last time updated Centmin Mod code base ? : today, normally after few days since new update
    • Persistent Config:
      Code:
      PHPFINFO='y'                                               
      LETSENCRYPT_DETECT=y
    My Nextcloud (nginx/php-fpm) have changed default folder/file permissions.
    Mar 20 created user folder is drwxr-x---
    Apr 19 created user folder is drwxr-xr-x

    Umask is now 0022
    Have this changed after update?
    Where is the setting for this?
     
  2. eva2000

    eva2000 Administrator Staff Member

    41,292
    9,266
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,217
    Local Time:
    10:12 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    Nothing in Centmin Mod will auto change file/directory permissions after initial Centmin Mod install for your uploaded content. Only Centmin Mod during install sets up /home/nginx/domains and /usr/local/nginx/html directory default to umask 027 (755-027-750) but all subsequent created directories should default to 755

    Which specific directories changed for you ? examples ?
     
  3. Meirami

    Meirami Member

    130
    17
    18
    Dec 21, 2017
    Ratings:
    +44
    Local Time:
    3:12 PM
    I think if umask have changed and that's why I'm getting Nextcloud user's directory's permissions differently than earlier. I don't think that any old existing directory permissions have changed.
    Nextcloud user created in march have 750.
    Nextcloud user created now have 755.
    So when creating new user in the Nextcloud the user's directory have different permissions than earlier.

    This answer is from Nextcloud's forum and that's why I'm here.
    Code:
    Actually every file and folder which is newly created by Nextcloud (and therefor by nginx) will have the same specific permissions. There won’t be any differences (between different NC users for example).
    
    Which permissions are set for newly created folder/ files is defined by the users umask; in this case the umask of nginx.
    But I'm getting umask 0022 when I'm logged in as root. That's 755. Isn't it?

    With command "su -l nginx -c umask -s /bin/bash" I get 0002 and that's 775. I'm quite confused. If nginx is creator, should it be 775?

    Anyway default umask is 022 and that's the same 755 which I got now when creating a new user. I'm just curious why I have different permissions...

    Sorry my english, some times it's too hard to make a good and clear question. Hopefully the second try is enough. :D
     
  4. eva2000

    eva2000 Administrator Staff Member

    41,292
    9,266
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,217
    Local Time:
    10:12 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    FYI, CentOS uid (user ids greater than 199) use umask 002 default (777-002=775) while less than 199 i.e. root user has umask default 022 (777-022= 755)

    How was directory created ? as root user ? or via ftp client and pure-ftpd virtual ftp user ? You can test this by creating a test directory one as root user, one via ftp client using pure-ftpd virtual ftp user and compare the default directory permissions too
     
  5. Meirami

    Meirami Member

    130
    17
    18
    Dec 21, 2017
    Ratings:
    +44
    Local Time:
    3:12 PM
    Directories were created by Nextcloud when I created new user with web browser.
     
  6. eva2000

    eva2000 Administrator Staff Member

    41,292
    9,266
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +14,217
    Local Time:
    10:12 PM
    Nginx 1.17.x
    MariaDB 5.5/10.x
    From my experience php-fpm created files and directories usually get 644 and 755 permissions respectively for me which is normal.