summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2019-05-25 13:10:05 -0600
committermo <mo.khan@gmail.com>2019-05-25 13:10:05 -0600
commit4e8ce2f5cc8209bedd5d00a3ad5ede1c1620523e (patch)
tree45b1e884d434d7a68b4a4c2f6a1a9ba99395db42 /README.md
parent1fc7af73dcb50d309c0f53a7c6081f92f3f2a0cd (diff)
complete 8.14
Diffstat (limited to 'README.md')
-rw-r--r--README.md35
1 files changed, 34 insertions, 1 deletions
diff --git a/README.md b/README.md
index c1037a1..451bfc1 100644
--- a/README.md
+++ b/README.md
@@ -297,7 +297,40 @@ $ cp /etc/passwd dir1
See `exercises/chapter-8.13`.
-14. What umask command should be executed to set the permissions bit mask to 037? With this mask, what default access privileges are associated with any new file that you create on the system? Why? Where would you put this command so that every time you log on to the system this mask is effective?
+14. What `umask` command should be executed to set the permissions bit mask to `037`? With this mask, what default access privileges are associated with any new file that you create on the system? Why? Where would you put this command so that every time you log on to the system this mask is effective?
+
+The `umask` indicates which permission bits to turn off. ie. `777 - mask`.
+
+To change the default umask to `037`.
+
+```bash
+$ touch before
+$ umask 037
+$ umask after
+$ ls -alh before after
+-rw-r-----. 1 root root 0 May 25 19:03 after
+-rw-r--r--. 1 root root 0 May 25 19:03 before
+```
+
+The default access privileges are:
+
+```text
+777 - 037 = 740
+
+rwx|r--|---
+```
+
+User: Read, write, execute.
+Group: Read
+Everyone: no access
+
+The `umask` can be placed in any startup scripts such as:
+
+* $HOME/.profile (System V UNIX)
+* $HOME/.login (BSD UNIX)
+* $HOME/.bash\_profile
+
+See `exercises/chapter-8.14`.
15. Give a command line for setting the default access mode so that you have read, write, and execute privileges, your group has read and execute permissions, and all others have no permission for a newly created executable file or directory. How would you test it to be sure that it works correctly?