exam questions

Exam 1z0-821 All Questions

View all questions & answers for the 1z0-821 exam

Exam 1z0-821 topic 1 question 155 discussion

Actual exam question from Oracle's 1z0-821
Question #: 155
Topic #: 1
[All 1z0-821 Questions]

User jack makes use of the bash shell; his home directory is/export/home/jack.
What is the correct setting of umask, and where should it be set, to allow jack to create a shell script using the vi editor, that is executable by default?

  • A. It is not possible to make a script executable without using the chmod command.
  • B. umask value of 0002 set in /etc/profile
  • C. umask value of 0002 set in /export/home/jack/.bashrc
  • D. umask value of 0722 set in /etc/profile
  • E. umask value of 0722 set In /export/home/jack/.bashrc
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
The user file-creation mode mask (umask) is use to determine the file permission for newly created files. It can be used to control the default file permission for new files. It is a four-digit octal number.
You can setup umask in /etc/bashrc or /etc/profile file for all users. By default most Unix distro set it to 0022 (022) or 0002 (002).
1. The default umask 002 used for normal user. With this mask default directory permissions are 775 and default file permissions are 664.
2. The default umask for the root user is 022 result into default directory permissions are 755 and default file permissions are 644.
3. For directories, the base permissions are (rwxrwxrwx) 0777 and for files they are 0666 (rw-rw-rw).
In short,
1. A umask of 022 allows only you to write data, but anyone can read data.
2. A umask of 077 is good for a completely private system. No other user can read or write your data if umask is set to 077.
3. A umask of 002 is good when you share data with other users in the same group. Members of your group can create and modify data files; those outside your group can read data file, but cannot modify it. Set your umask to 007 to completely exclude users who are not group members.

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
majekla
6 months ago
exactly (dlicheri).
upvoted 1 times
...
dlicheri
1 year, 7 months ago
It is not possible to create a that is executable by setting umask to 000. you must execute a chmod command against file to make it executable.
upvoted 1 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago