PrepAway - Latest Free Exam Questions & Answers

What umask will set the file permissions on a newly created file to -rw-r–r– (644)?

What umask will set the file permissions on a newly created file to -rw-r–r– (644)?

A.
0002

B.
0022

C.
0224

D.
0246

Explanation/Reference:
The trick is to know that umask on a file excludes execute-priviliges per default, so to remove the write-privilige on a file use 022.

4 Comments on “What umask will set the file permissions on a newly created file to -rw-r–r– (644)?

    1. nwildner says:

      A file will never be “automatically executable” when you configure a umask on it.

      You could make a test: As root create a directory inside /home, then, create a text file inside /home too. You will see that when using a umask of 0022, they will have different permissions:

      root@workstation:/home# mkdir teste
      root@workstation:/home# touch testefile
      root@workstation:/home# ls -l
      total 24
      drwx—— 2 root root 16384 Jan 5 08:43 lost+found
      drwxr-x— 34 nicolas nicolas 4096 Jan 12 09:56 nicolas
      drwxr-xr-x 2 root root 4096 Jan 12 10:33 teste
      -rw-r–r– 1 root root 0 Jan 12 10:33 testefile




      0



      0

Leave a Reply