summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo <mo.khan@gmail.com>2019-05-25 13:51:27 -0600
committermo <mo.khan@gmail.com>2019-05-25 13:51:27 -0600
commit29154349c11e43fece205c663136b7450c010f67 (patch)
treee5e253334cc13b0b4faeb72d2492325dbd9a7488
parentd5500cd77061f54c5d2b4b7e13386c3f6b0ce14b (diff)
complete 8.16
-rw-r--r--README.md30
-rw-r--r--exercises/chapter-8.1615
2 files changed, 40 insertions, 5 deletions
diff --git a/README.md b/README.md
index 8f6e9ba..31c4aee 100644
--- a/README.md
+++ b/README.md
@@ -350,17 +350,37 @@ formula:
The desired `umask` value would be `027`.
```bash
-[root@2a10b6355d3a ~]# mkdir before
-[root@2a10b6355d3a ~]# umask 027
-[root@2a10b6355d3a ~]# mkdir after
-[root@2a10b6355d3a ~]# ls -l
+$ mkdir before
+$ umask 027
+$ mkdir after
+$ ls -l
drwxr-x---. 2 root root 4096 May 25 19:36 after
drwxr-xr-x. 2 root root 4096 May 25 19:36 before
```
See `exercises/chapter-8.15`.
-16. Give chmod command lines that perform the same tasks that the mesg n and mesg y commands do. (Hint: Every hardware device, including your terminal, has an associated file in the /dev directory.)
+16. Give `chmod` command lines that perform the same tasks that the `mesg n` and `mesg y` commands do. (Hint: Every hardware device, including your terminal, has an associated file in the /dev directory.)
+
+`mesg n` blocks write access to the currently logged in users `tty` by
+any other users. `mesg y` allows write access to the currentl logged in
+users `tty` session.
+
+To accomplish the same tasks without using `mesg` you will need to
+identity which device the current tty is attached to. This can be done
+by using the `tty` program. Once the device is identified, you can
+change the permissions for that file.
+
+```bash
+$ tty
+/dev/pts/6
+$ ls -alh /dev/pts/6
+crw--w----. 1 mokha 136, 6 May 25 13:45 /dev/pts/6
+$ chmod 600 /dev/pts/6
+```
+
+See `exercises/chapter-8.16`.
+
17. What are the purposes of the set-user-ID (SUID), set-group-ID (SGID), and sticky bits?
## Do problem 9 (What do the following commands do?) in Chapter 9.
diff --git a/exercises/chapter-8.16 b/exercises/chapter-8.16
new file mode 100644
index 0000000..e20c466
--- /dev/null
+++ b/exercises/chapter-8.16
@@ -0,0 +1,15 @@
+Script started on 2019-05-25 13:49:16-06:00 [TERM="screen-256color" TTY="/dev/pts/6" COLUMNS="238" LINES="13"]
+bash-5.0$ docker run -it fedora /bin/bash
+]0;@52accce64b70:/[root@52accce64b70 /]# [root@52accce64b70 /]# tty
+/dev/pts/0
+]0;@52accce64b70:/[root@52accce64b70 /]# ls -alh /dev/pts/0
+crw--w----. 1 root tty 136, 0 May 25 19:49 /dev/pts/0
+]0;@52accce64b70:/[root@52accce64b70 /]# chmod 600 /dev/pts/0
+]0;@52accce64b70:/[root@52accce64b70 /]# ls -alh /dev/pts/0
+crw-------. 1 root tty 136, 0 May 25 19:49 /dev/pts/0
+]0;@52accce64b70:/[root@52accce64b70 /]# exit
+exit
+bash-5.0$ exit
+exit
+
+Script done on 2019-05-25 13:49:59-06:00 [COMMAND_EXIT_CODE="0"]