diff options
| author | mokha <mokha@cisco.com> | 2019-05-18 14:24:38 -0600 |
|---|---|---|
| committer | mokha <mokha@cisco.com> | 2019-05-18 14:24:38 -0600 |
| commit | 9cec99cd641ed4e40c3730dc839ba4f644327c14 (patch) | |
| tree | 73eb5dfa0374698ea1149247951afd3d6605fa60 | |
| parent | 3693d1ea87e29507c5a257cd2c659e9379ec90ab (diff) | |
record script to look at /etc/passwd
| -rw-r--r-- | README.md | 38 | ||||
| -rw-r--r-- | exercises/section-8 | 15 |
2 files changed, 51 insertions, 2 deletions
@@ -9,11 +9,45 @@ Be sure to complete the final step—click on the Send for Marking button to not 1. Solve problems 7–11 and 15–17 at the end of Chapter 7. 7. Give three commands that you can use to list the absolute pathname of your home directory. +```bash +モ cd +モ pwd +/Users/mokha +モ cd ~/ +モ pwd +/Users/mokha +モ echo $HOME +/Users/mokha +``` +8. Write down the line in the /etc/passwd file on your system that contains information about your login. What are your login shell, user ID, home directory, and group ID? Does your system contain the encrypted password in the /etc/passwd or /etc/shadow file? ```bash +Script started on Sat May 18 14:19:43 2019 +bash-3.2$ docker run -it fedora /bin/sh
+sh-4.4# useradd -p "password" mo
+sh-4.4# grep mo /etc/passwd
+daemon:x:2:2:daemon:/sbin:/sbin/nologin
+mo:x:1000:1000::/home/mo:/bin/bash
+sh-4.4# grep mo /etc/csh shadow
+daemon:*:17725:0:99999:7:::
+mo:password:18034:0:99999:7:::
+sh-4.4# exit
+exit
+ebash-3.2$ ei[Kxit
+exit
+ +Script done on Sat May 18 14:20:23 2019 ``` - 8. Write down the line in the /etc/passwd file on your system that contains information about your login. What are your login shell, user ID, home directory, and group ID? Does your system contain the encrypted password in the /etc/passwd or /etc/shadow file? - 9. What would happen if the last field of the line in the /etc/passwd file were replaced with /usr/bin/date? Why? + +user id: 1000 +group id: 1000 +$HOME: /home/mo +shell: bash + +Password is stored in `/etc/shadow` + + +9. What would happen if the last field of the line in the /etc/passwd file were replaced with /usr/bin/date? Why? 10. What are the inode numbers of the root and your home directories on your machine? Give the commands that you used to find these inode numbers. 11. Create a directory, called memos, in your home directory. Go into this directory and create a file memo.james by using one of the editors discussed in Chapter 5. Give three pathnames for this file. diff --git a/exercises/section-8 b/exercises/section-8 new file mode 100644 index 0000000..c6d32d8 --- /dev/null +++ b/exercises/section-8 @@ -0,0 +1,15 @@ +Script started on Sat May 18 14:19:43 2019 +bash-3.2$ docker run -it fedora /bin/sh
+sh-4.4# useradd -p "password" mo
+sh-4.4# grep mo /etc/passwd
+daemon:x:2:2:daemon:/sbin:/sbin/nologin
+mo:x:1000:1000::/home/mo:/bin/bash
+sh-4.4# grep mo /etc/csh shadow
+daemon:*:17725:0:99999:7:::
+mo:password:18034:0:99999:7:::
+sh-4.4# exit
+exit
+ebash-3.2$ ei[Kxit
+exit
+ +Script done on Sat May 18 14:20:23 2019 |
