From 4e8ce2f5cc8209bedd5d00a3ad5ede1c1620523e Mon Sep 17 00:00:00 2001 From: mo Date: Sat, 25 May 2019 13:10:05 -0600 Subject: complete 8.14 --- README.md | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'README.md') 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? -- cgit v1.2.3