You want every regular file a shell creates to come out as rw-r----- (640) and every new directory as rwxr-x--- (750). Type the complete command that sets that default.
LPIC-1 Exam 101-500, objective 104. Devices, Linux filesystems, filesystem hierarchy standard hard
Draft — not checked yet. This question was written from the published exam objectives and cites the clause it comes from, but nobody has yet read it against that clause and signed for it.
It is kept out of search results and out of mock exams until they have. Read the source below before you take the answer as settled.
Answer
Type the answer.
Accepted answers
umask 027umask 0027
Case sensitive — Linux is, and grading LS as ls would teach a falsehood.
Why
The umask masks bits out of the base creation mode: 666 for regular files and 777 for directories. 666 with 027 removed leaves 640, and 777 with 027 removed leaves 750. The leading fourth digit is optional and is normally 0. Run umask with no argument to display the current value, or `umask -S` to see it in symbolic form. Put it in a login script such as ~/.bash_profile or /etc/profile to make it permanent.
Where this comes from
- Cited
- LPI exam objective 104.5
- What it says
- Set default file creation permissions with umask.
Practise this
Reading one question is not practice. The trainer will draw a set from objective 104 and space the ones you get wrong.