Show the current umask
why do new files have wrong permissions | check umask linux | default permissions for new files | umask 022 or 002 | umask | chmodumask && umask -SPrints the umask first in octal (such as 0022) and then symbolically (u=rwx,g=rx,o=rx). The umask subtracts permissions from the base values 666 for files and 777 for directories, so 022 results in 644 and 755. Explains why files created via SSH, cron or deploy scripts get different permissions than expected.
Note: umask 002 changes the value for the running shell, to make it permanent set it in ~/.profile, for example. PHP-FPM and other services have their own umask.
Also searched as
- why do new files have wrong permissions
- check umask linux
- default permissions for new files
- umask 022 or 002