Guide to Umask Values in Linux
  • 08 Feb 2023
  • 1 Minute to read
  • Dark
    Light

Guide to Umask Values in Linux

  • Dark
    Light

Article summary

Sometimes in Linux, you will need to go ahead and set a umask on a user, files, or anything else to change the default permissions files or folders will be created as. Below is a little matrix of what the umask commands will do.

Umask Command == User Group Owner (ls -lah output)== Decimal Value== Chmod

umask 0077 == rwx --- --- == 700 600 == u=rwX,go= 

umask 0007 == rwx rwx --- == 770 660 == ug=rwX,o= 

umask 0027 == rwx r-x --- == 750 640 == u=rwX,g=rX,o= 

umask 0022 == rwx r-x r-x == 755 644 == u=rwX,go=rX 

umask 0002 == rwx rwx r-x == 775 664 == ug=rwX,o=rX 

umask 0000 == rwx rwx rwx == 777 666 == a=rwXX

A common usage of this would be within suphp.conf in an Apache / Suphp environment. 

root@server [~]# grep umask /opt/suphp/etc/suphp.conf

umask=0022

Meaning folders by default would be created with 755 permissions, and files with 644 permissions.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.
ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence