Book: LPI Linux Certification in a Nutshell Section: Chapter 8. Exam 101 Review Questions and Exercises
### 8.5 Administrative Tasks (Topic 2.11) #### 8.5.1 Review questions Why is it considered insecure to store encrypted passwords in /etc/passwd ? What is the alternative? When the alternative is implemented, what happens to the password field in /etc/passwd ? What would happen to a user account if the default shell were changed to /bin/false ? When a new account is created with useradd -m, what files are used to populate the new home directory? Compare and contrast the execution of /etc/profile and /etc/bashrc. What is the complete filename for the file where most syslog messages are sent? Describe the three syslog parameters: facility, level, and action. Compare and contrast cron and at. Is there a cron command? State the format of a crontab file, describing each of the six fields. What does an asterisk mean in crontab fields 1 through 5? Compare and contrast the differential and incremental backup methods. Why is mt usually used along with tar to implement simple backup schemes? What special measures must be taken with regard to device names when using mt for multiple-volume tar backups? #### 8.5.2 Exercises ##### 8.5.2.1 Exercise 2.11-1. User accounts Examine the /etc/passwd file on your system. Is this the only means of user authentication on your system? Are shadow passwords in use? Are user accounts handled by NIS or are they all local? Repeat the first exercise for groups. If you have an expendable system available, experiment with implementing shadow passwords. Add a user with useradd, including a new home directory populated with files from /etc/skel. Add a group with groupadd. Use usermod to add your new user to the new group. Set the new user's password using passwd. Log into the new account, and use newgrp to change to the new group. Delete the new group and user (including home directory) using groupdel and userdel. ##### 8.5.2.2 Exercise 2.11-2. User environment and variables Examine the contents of /etc/skel. How similar are they to your own home directory? Review the contents of /etc/profile and /etc/bashrc. ##### 8.5.2.3 Exercise 2.11-3. Syslog and log files Add the local5 facility to your configuration as described in Section 7.3. Use logger to write to your new log file, and verify its contents. Compare your log entries with those in /var/log/messages. Examine /etc/logrotate.conf. What happens after /var/log/messages is rotated? ##### 8.5.2.4 Exercise 2.11-4. cron and at Add an entry in your personal crontab file to perform a task, such as sending you an email message. Confirm that the action occurs as expected. Experiment with the five time specifiers. Schedule a command in the future with at. How is at different from cron? ##### 8.5.2.5 Exercise 2.11-5. Backup Imagine that you have recently been made responsible for an important production system. No formalized backup procedures are in place. Backup operations that are run are not cataloged and media are scattered. Now imagine that after a holiday weekend the system has crashed due to a power failure. Upon restart, the system has severe disk errors requiring manual fsck. After repairs are complete, the system is again usable, but users complain about missing, truncated, or corrupt files. If a formalized backup procedure had been in place, would the outcome have been different? If you have a tape drive available, experiment with tar, creating small tarfiles on a tape. Using the nonrewinding tape device, create multiple archives on the tape, and use mt to position among them. Verify that the various archives you create are accessible to tar.