LPI Linux Certification in a Nutshell (71 page)

Read LPI Linux Certification in a Nutshell Online

Authors: Adam Haeder; Stephen Addison Schneiter; Bruno Gomes Pessanha; James Stanger

Tags: #Reference:Computers

BOOK: LPI Linux Certification in a Nutshell
11.37Mb size Format: txt, pdf, ePub
Chapter 25. Exam 102 Review
Questions and Exercises

This chapter presents review questions to highlight important
concepts and hands-on exercises that you can use to gain experience with the
Topics covered on the LPI Exam 102. The exercises can be particularly useful
if you’re not accustomed to more advanced Linux administration, and they
should help you better prepare for the exam. To complete the exercises, you
need a working Linux system that is not in production use. You might also
find it useful to have a pen and paper handy to write down your responses as
you work your way through the review questions and
exercises
.

Shells, Scripting, and Data Management (Topic 105)
Review Questions
  1. Why is it dangerous to have “.” (the current working
    directory) in your $PATH variable?

  2. What characteristic of a
    bash
    variable
    changes when the variable is exported?

  3. What configuration files will
    bash
    read
    when a shell is started?

  4. Describe the concept of shell aliases.

  5. When is a shell function more suitable than a shell
    alias?

  6. Describe the function of
    /etc/profile
    .

  7. What must the author of a new script file do to the file’s
    mode in order to make it executable?

  8. How does the shell determine what interpreter to execute when
    starting a script?

  9. How can a shell script use return values of the commands it
    executes?

  10. What are some common open source databases available on Linux
    systems?

  11. Describe the common MySQL datatypes and when they are
    appropriate to use.

  12. What is the difference between a join and a left join in a SQL
    query?

Exercises
  1. Using
    bash
    , enter the
    export
    command and the
    set
    command. Which set of variables is a subset of the other? What is
    the difference between the variables reported by
    export
    and those reported by
    set
    ? Finally, enter
    which
    export
    . Where is the
    export
    command
    located?

  2. Examine
    /etc/profile
    . How is the default
    umask
    set? What customizations
    are done in the file for system users?

  3. Create a simple
    bash
    script using the
    #!/bin/bash
    syntax, set the
    executable mode bits, and execute the shell. If it runs correctly,
    add errors to see the diagnostic messages. Have the script report
    both exported and nonexported variables. Verify that the nonexported
    variables do not survive the startup of the new shell.

  4. Create some bash aliases in your current shell. Start a new
    shell by running the command
    bash
    in your
    current shell. Do your aliases work in this child shell? Why or why
    not?

  5. Create a MySQL table structure that could be used to store the
    fields in the file
    /etc/passwd
    .
    Write a shell script to parse this file, one line at a time, and
    call the
    mysql
    command-line program to insert
    the users defined in
    /etc/passwd
    into your table. Once this is
    complete, write a SQL query to list all usernames that have a shell
    of
    /bin/bash
    .

The X Window System (Topic 106)
Review questions
  1. What is the main X Windows configuration file?

  2. What are the troubleshooting steps you need to take when X
    Windows won’t start?

  3. How can you switch between desktop environments (for example,
    running KDE instead of Gnome)?

  4. What are some common functions that can be used to assist
    visually impaired users with using X Windows?

  5. What file would you edit to make an application run every time
    you log into X Windows?

Exercises
  1. Boot your system into runlevel 3. Log in as root and type the
    command
    /usr/bin/startx
    . Exit X Windows and
    examine the logfile
    /var/log/Xorg.0.log
    . What specific things
    does this file tell you about your graphical environment? From this
    file, can you determine what video card you have and what
    resolutions it supports?

  2. Exit X Windows and use the
    /sbin/init
    command to change your system to runlevel 5. Once X Windows starts,
    hit the key combination Ctrl-Alt-backspace. What happens to X
    Windows? Why does this happen?

Administrative Tasks (Topic 107)
Review questions
  1. What would happen to a user account if the default
    shell were changed to
    /bin/false
    ?

  2. When a new account is created with
    useradd
    -m
    , what files are used to populate the new home
    directory?

  3. Compare and contrast the execution of
    /etc/profile
    and
    /etc/bashrc
    .

  4. Compare and contrast
    cron
    and
    at
    .

  5. Is there a
    cron
    command?

  6. Describe the format of a
    crontab
    file,
    describing each of the six fields.

  7. What does an asterisk mean in
    crontab
    fields 1 through 5?

Exercises
  1. Add a user with
    useradd
    , including a new
    home directory populated with files from
    /etc/skel
    .

  2. Add a group with
    groupadd
    .

  3. Use
    usermod
    to add your new user to the
    new group.

  4. Set the new user’s password using
    passwd
    .

  5. Log into the new account, and use
    newgrp
    to change to the new group.

  6. Delete the new group and user (including home directory) using
    groupdel
    and
    userdel
    .

  7. Examine the contents of
    /etc/skel
    . How
    similar are they to your own home
    directory
    ?

  8. Review the contents of
    /etc/profile
    and
    /etc/bashrc
    .

  9. 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.

  10. Schedule a command in the future with
    at
    .
    How is
    at
    different from
    cron
    ?

Essential System Services (Topic 108)
Review Questions
  1. Why is accurate time important on a Linux system? What
    options exist to keep time in sync?

  2. Describe the difference between system time and the hardware
    clock.

  3. How is time stored on a Linux system? How is the time zone
    used to modify this value?

  4. What two things does the
    syslogd
    server
    use to categorize log entries? What are the limitations of this
    format?

  5. Give some examples of what kinds of messages you would expect
    to see in
    /var/log/messages
    .

  6. What does
    lpd
    do to handle incoming print
    jobs destined for empty print queues?

  7. Describe the kinds of information included in
    /etc/printcap
    .

  8. What is the function of a print filter?

  9. What does the
    -P
    option specify to the
    print commands?

  10. When is it useful to pipe into the standard input of
    lpr
    instead of simply using a filename as an
    argument?

  11. How is the Ghostscript program used in printing to a
    non-PostScript printer?

  12. What filter is used on a Linux system to print to remote
    printers on Windows clients?

  13. What are the common Mail Transport Agents (MTAs) used on Linux
    systems? Give a brief description of each.

  14. What command would you use to view the contents of the mail
    queue on a system running sendmail? What command would you use to
    force a resend of that queue?

  15. What is the easiest way to forward all email coming into an
    account to another email address?

  16. What file is used to maintain email aliases for local users?
    Describe the maintenance procedure for this file.

Exercises
  1. Run the
    date
    command on your system. Is
    your system clock accurate? Run the command
    ntpd
    –gnq
    . Did you system time change? By how much?

  2. Add this line:

    *.*    /var/log/everything

    to
    /etc/syslog.conf
    and
    restart
    syslog
    . Now run
    tail –f
    /var/log/everything
    . What kinds of things do you see? How
    often are events written to this log?

  3. Add the
    local5
    facility to
    your configuration. Use
    logger
    to write to your
    new logfile, and verify its contents. Compare your log entries with
    those in
    /var/log/messages
    .

  4. Examine
    /etc/logrotate.conf
    . What happens
    after
    /var/log/messages
    is rotated?

  5. On a system with an existing printer, examine
    /etc/printcap
    . Which print filter is used for
    the printer? Which queue or queues are directed at the
    printer?

  6. Check the printer status with
    lpq -P
    printer
    and
    lpc
    status
    . Print to the queue using
    lpr
    -P
    printer file
    .

  7. Examine
    /var/spool/lpd
    for the spool
    directory of your print queue. Examine the files you find
    there.

  8. Determine what MTA is installed on your system. Is it
    listening on TCP port 25? How can you tell?

  9. Type the command
    telnet localhost 25
    .
    What do you see?

  10. Type the command
    echo “test” | mail root
    .
    Now type
    tail /var/log/maillog
    . Was your mail
    delivered? How can you tell?

Networking Fundamentals (Topic 109)
Review Questions
  1. Describe how the subnet mask affects the maximum
    number of hosts that can be put on a TCP/IP network.

  2. Name the three default address classes and the subnet masks
    associated with them.

  3. Identify the IPv4 private address ranges.

  4. What are some advantages IPv6 has over IPv4?

  5. The UDP protocol is said to be connectionless. Describe this
    concept and its consequences for applications that use UDP.

  6. What is a TCP port? Give some examples of common TCP ports and
    the applications and protocols that use them.

  7. What user command is frequently used to send ICMP messages to
    remote hosts to verify those hosts’ connectivity?

  8. Describe the contents and use of
    /etc/hosts
    .

  9. In what configuration file are DNS servers listed? What is
    intended if the local loopback address is included there on a
    workstation?

  10. Name two modes of the
    netstat
    command and
    the program’s output in each case.

  11. Describe why the
    route
    command is needed
    for a single interface on a nonrouting workstation.

  12. How does
    traceroute
    determine the
    identities of intermediate gateways?

  13. Describe the advantages and consequences of implementing
    DHCP.

Exercises
  1. Examine your system’s TCP/IP configuration using
    ifconfig eth0
    or a similar command for your
    network interface. Are you using DHCP? What type of subnet are you
    running with? Is it a class A, B, or C address? Are you using a
    private address? Experiment with taking the interface offline using
    ifconfig eth0 down
    and
    ifconfig eth0
    up
    .

  2. Examine the contents of
    /etc/services
    .
    How many protocols do you recognize?

  3. Use the
    dig
    command to locate information
    from DNS servers about a domain name.

  4. Examine your
    /etc/hosts
    file. How much
    name resolution is accomplished in this file manually?

  5. Examine your
    /etc/resolv.conf
    file. How
    many DNS servers do you have avail
    able
    ?

  6. Execute
    netstat -r
    . How many routes are
    reported? What are the routes to the local network and interface
    for?

  7. Use
    traceroute
    to examine the route to a
    favorite website.

Other books

Owning Corey by Maris Black
Midnight at Mallyncourt by Jennifer Wilde
The Dark Chronicles by Jeremy Duns
News of the World: A Novel by Paulette Jiles
Edge of Battle by Dale Brown
God's Formula by James Lepore
A Thousand Tombs by Molly Greene
My Body in Nine Parts by Raymond Federman