Section 33.8. Troubleshooting (Topic 2.214)


33.8. Troubleshooting (Topic 2.214)

33.8.1. Review Questions

  1. What is the last stage of the boot process?

  2. You wish to configure your system to stop replying to all ICMP packets. What file in the /etc/ directory can you edit to accomplish this?

  3. You have been provided with a directory that contains all of the necessary files and libraries to run the passwd command in a chroot environment. This directory is called /usr/local/chrootenv. What command would you form to run the passwd command in a chroot environment?

  4. You wish to run the passwd command in a chroot environment. However, the command fails in this environment. You suspect a problem with the libraries that the command requires. What can you do to learn more about the libraries used by the passwd command?

  5. Your system currently does not create home directories for each user by default whenever you use the useradd command. What file can you alter to change this default behavior?

  6. You have been using the dmesg command and examining the output, a cumbersome procedure, to find out which kernel the system is currently using. Which command would give this information?

33.8.2. Answers

  1. Initializing and setting up daemons.

  2. /etc/sysctl.conf.

  3. chroot /usr/local/chrootenv passwd.

  4. Use the ldd command:

     ldd /usr/bin/passwd 

  5. /etc/login.defs.

  6. uname -a.

33.8.3. Exercises

  1. Study the LDP Bootdisk HOWTO at http://www.ibiblio.org/pub/Linux/docs/HOWTO/Bootdisk-HOWTO. Make sure that you understand the boot process, how to create bootable CDs, and how to troubleshoot problems.

  2. Boot your system and review the boot process. Notice when the four different stages occur.

  3. View the contents of the /etc/login.defs file. Notice that this file allows you to customize various login settings. Change the FAIL_DELAY value to 10. Notice the USERGROUPS_ENAB enTRy. In many systems, this value is set to yes, which means that each time a user is deleted, the group will be deleted, as well. Also, review the FAILLOG_ENAB and LOG_OK_LOGINS enTRies.

  4. As a normal user, try to view the contents of the /etc/shadow file. You will not be able to. List the file's permissions. As root, view the contents of the /etc/shadow file. Notice that you can view it now. Make sure you understand each field of the file.

  5. Many systems default to allowing the rm command to delete files without warning. If your system does not have this setting already, add the following alias to the ~/.bashrc file (or to the pertinent file for your shell):

     alias rm='rm -i' 

    Once you have made this change, either log out and log back in or issue the following command (both periods are necessary):

     . .bashrc 

    Now, when you use rm to delete a file, you will be asked to confirm your choice.

  6. View the contents of the /etc/ld.so.conf file. Consider that making a change in the dynamic linking libraries involves simply opening this file in a text editor to add a path to the valid library, then running the ldconfig command to update the links. Using the -v option to ldconfig helps you see the changes made.

  7. Use the strings command to view the contents of various files on the system. Start small by viewing the /bin/ls command. Then, view other files to learn the text strings that they contain.

  8. Use the lsof command with grep to discover the following:

    • All open TCP connections

    • All open UDP connections

    • All processes associated with the bash shell (or whatever shell you are using

    • All regular processes (REG)

    You may also want to pipe the output through the less command so that you can view the content more easily. This exercise will require you not only to understand how to use lsof, grep, and less, but to understand each field in the output of the lsof command. You will see that the command is listed and then its PID, the user, its file descriptor (name), its type (regular file, FIFO, etc.), the device being used, its size in memory, and the node or filename being used.

  9. View the /etc/bashrc or /etc/bash.bashrc file. Notice the settings, and see how this file is also used to configure the look and feel of the prompt. Make any changes you like, but create a backup file just in case.

  10. Make sure that you can ping your system. Use the cat command to view the contents of the /proc/sys/net/ipv4/icmp_echo_ignore_all file. It should read 0.

  11. Suppose that you want to configure your system to ignore all pings. You can do this by editing the /etc/sysctl.conf file or by manually changing the value of the /proc/sys/net/ipv4/proc/sys/net/ipv4/icmp_echo_ignore_all file to 1. As root, open the /etc/sysctl.conf file and the following entry:

     net/ipv4/icmp_echo_ignore_all=1 

    Close the file, making sure to save your changes. Then, issue the following command to process the /etc/sysctl.conf file:

     sysctl -p /etc/sysctl.conf 

    Use the cat command to view the contents of the /proc/sys/net/ipv4/icmp_echo_ignore_all file. It will now read 1. You can use the following command to change the value back to 0:

     echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_all 



LPI Linux Certification in a Nutshell
LPI Linux Certification in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596005288
EAN: 2147483647
Year: 2004
Pages: 257

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net