LPI Linux Certification in a Nutshell (72 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
7.55Mb size Format: txt, pdf, ePub
Security (Topic 110)
Review Questions
  1. What daemon is associated with the control files
    /etc/hosts.allow
    and
    /etc/hosts.deny
    ?

  2. In general terms, describe a method to locate SUID programs in
    the local filesystem. Why might an administrator do this
    routinely?

  3. What is the danger of making
    /bin/vi
    SUID?

  4. Why should a user run
    ssh
    instead of
    telnet
    ?

  5. Describe shadow passwords and the file where the passwords are
    stored. Why don’t we store encrypted password strings in
    /etc/passwd
    anymore?

  6. How can the tool
    /usr/sbin/lsof
    help you
    identify potential security issues?

  7. What is the difference between a hard limit and a soft limit,
    with regard to the
    ulimit
    command?

  8. Why is it advisable to use
    sudo
    rather
    than
    su
    in an environment with multiple
    administrators?

  9. What kinds of things can you ascertain about a remote system
    with the
    nmap
    command?

  10. Describe the process of key-based authentication between
    systems using
    ssh
    .

  11. What is the difference between a public and a private key?
    What are they used for?

  12. Describe how to encrypt a file with
    gpg
    .

Exercises
  1. Use
    find
    as described in
    Chapter 22
    to locate SUID
    files. Is the list larger than you expected? Are the entries on your
    list justifiably SUID programs?

  2. Create an entry in
    /etc/sudoers
    that lets your user account
    run any command as root. Run some commands through
    sudo
    and watch the file
    /var/log/messages
    . What entries do you
    see? How would this be useful in a multiadministrator
    environment?

  3. Look at the file
    /etc/shadow
    . What user accounts do not
    have passwords? Why don’t they?

  4. Experiment with the
    chage
    command to set
    the password age for your account.

  5. Run
    ulimit –a
    . What default limits are
    set? What would be some useful limits to place on users?

  6. Run
    netstat --tcp –anp | grep LISTEN
    .
    What processes on your system are listening on TCP ports? If you
    were to harden this system, how would you change this
    configuration?

  7. Run
    nmap localhost
    . Does this output
    match what you saw from the previous
    netstat
    command? Why or why not?

  8. If you have
    xinetd
    installed, go to the
    /etc/xinetd.d
    directory and
    determine what services are enabled.

  9. Run
    ssh-keygen –t dsa
    . What files were
    created in
    ~/.ssh
    ? What are the
    permissions on those files?

On the Exam

Practice, practice, practice! The best way to get familiar with
Linux is by interacting with a working Linux system. Become familiar
with the command line and how to read logfiles. Nothing is hidden from
you in Linux; if you know where to look, simple tools such as
cat
,
ls
, and
grep
will tell you everything you need to know
about your system. Spend as much time as you can working hands-on with
a Linux system before you take the LPI 102 exam.

Chapter 26. Exam 102 Practice Test

This chapter will give you an idea of what kinds of questions
you can expect to see on the LPI 102 test. All questions are either
multiple-choice single answer, multiple-choice multiple answer, or fill in
the blank.

The questions are not designed to trick you; they are designed to test
your knowledge of the Linux operating system.

As of April 1, 2009, all exam weights for LPI exams have been
standardized to 60 weights.

Regardless of weight totals, each exam score is between 200 and 800. A
passing score is 500. However, the number of correct questions required to
achieve a score of 500 varies with the overall difficulty of the specific
exam that is taken.

The number of questions on the exam is also tied to the total of the
weights of the Objectives on the exam. With a total weight count of 60, the
exam will have 60 questions. For each weighting, there will be one question.
For example, if an Objective has a weight of 4, there will be 4 questions on
the exam related to the objective.

The answers for these sample questions are at the end of this
chapter.

Questions
  1. What environment variable holds the list of all directories that
    are searched by the shell when you type a command name?

    1. $LIST

    2. $VIEW

    3. $PATH

    4. $ENV

    5. None of the above

  2. In the
    bash
    shell, entering the
    !!
    command has the same effect as which one
    of the following (assuming
    bash
    is in emacs
    mode)?

    1. Ctrl-P and Enter

    2. Ctrl-N and Enter

    3. Ctrl-U and Enter

    4. !-2

    5. !2

  3. Name the command that displays pages from the online user’s
    manual and command reference.

  4. Which of the following commands displays the comments from a
    bash
    script? Select all that apply.

    1. find “^#” /etc/rc.d/rc.local

    2. sed ‘/^#/ !d’ /etc/init.d/httpd

    3. grep ^# /etc/init.d/httpd

    4. grep ^# /etc/passwd

    5. locate “^#” /etc/skel/.bashrc

  5. Which one of the following answers creates an environment
    variable
    VAR1
    , present in the
    environment of a
    bash
    child process?

    1. VAR1="fail" ; export VAR1

    2. VAR1="fail" \ export VAR1

    3. VAR1="fail"

    4. set VAR1="fail" ; enable VAR1

    5. export VAR1 \ VAR1="fail"

  6. What SQL command is used to modify data present in a
    table?

    1. INSERT

    2. WHERE

    3. UPDATE

    4. OVERWRITE

    5. JOIN

  7. What output will the following command generate:
    seq
    -s";" -w 1 10

    1. 01;02;03;04;05;06;07;08;09;10

    2. 1;2;3;4;5;6;7;8;9;10

    3. 1;10

    4. 01;02;03;04;05;06;07;08;09;010

    5. None of the above

  8. Adam wants to protect himself from inadvertently overwriting
    files when copying them, so he wants to alias
    cp
    to prevent overwrite. How should he go about this? Select one.

    1. Put
      alias cp='cp -i'
      in
      ~/.bashrc

    2. Put
      alias cp='cp -i'
      in
      ~/.bash_profile

    3. Put
      alias cp='cp -p'
      in
      ~/.bashrc

    4. Put
      alias cp='cp -p'
      in
      ~/.bash_profile

    5. Put
      alias cp = 'cp -I'
      in
      ~/.bashrc

  9. Consider the following script, stored in a file with proper
    modes for execution:

    #!/bin/bash
    for $v1 in a1 a2
    do
    echo $v1
    done

    Which one of the following best represents the output produced
    on a terminal by this script?

    1. in

      a1

      a2

    2. a1

      a2

    3. $v1

      $v1

      $v1

    4. No output is produced, but the script executes
      correctly.

    5. No output is produced, because the script has an
      error.

  10. Monica consults the
    /etc/passwd
    file
    expecting to find encrypted passwords for all of the users on her
    system. She sees the following:

    jdoe:x:500:500::/home/jdoe:/bin/bash
    bsmith:x:501:501::/home/bsmith:/bin/tcsh

    Which of the following is true? Select one.

    1. Accounts
      jdoe
      and
      bsmith
      have no passwords.

    2. Accounts
      jdoe
      and
      bsmith
      are disabled.

    3. The passwords are in
      /etc/passwd-
      .

    4. The passwords are in
      /etc/shadow
      .

    5. The passwords are in
      /etc/shadow-
      .

  11. What is the main configuration file for X Windows?

    1. /etc/xorg.conf

    2. /etc/x11.conf

    3. /etc/X11/x11.conf

    4. /etc/X11/xorg.conf

    5. None of the above

  12. What file in the user’s home directory will an X Windows
    application look to for configuration settings such as color and video
    mode?

    1. ~/.xinitrc

    2. ~/.xconfig

    3. ~/.Xresources

    4. ~/.xorg.conf

    5. ~/.bashrc

  13. What is the protocol XDMCP used for?

    1. Remote logging of X Windows events.

    2. Remote control of a running X Windows display.

    3. Graphical login support for the local host.

    4. Graphical login support for remote hosts on the
      network.

    5. None of the above.

  14. Which of the following are
    not
    commonly
    used display managers for X Windows? Choose two.

    1. xdm

    2. gdm

    3. kdm

    4. xfce

    5. X11

  15. Emacspeak is:

    1. A popular text editor for Linux.

    2. A window manager.

    3. An assistive technology that handles screen reading for a
      number of console applications.

    4. An assistive technology that provides a user with an
      on-screen keyboard.

    5. None of the above.

  16. Which one of the following outcomes results from the following
    command?

    #
    chmod g+s /home/software
    1. The SUID bit will be set for
      /home/software
      .

    2. The SGID bit will be set for
      /home/software
      , preventing access by those
      not a member of the
      software
      group.

    3. The SGID bit will be set for
      /home/software
      , to keep group membership of
      the directory consistent for all files created.

    4. The sticky bit will be set for
      /home/software
      .

    5. The sticky bit will be applied to all files in
      /home/software
      .

  17. Which one of these files determines how messages are stored
    using
    syslogd
    ?

    1. /etc/sysconfig/logger.conf

    2. /etc/syslog.conf

    3. /etc/syslogd.conf

    4. /etc/conf.syslog

    5. /etc/conf.syslogd

  18. Which MTA was designed specifically with security in
    mind?

    1. Sendmail

    2. Postfix

    3. Qmail

    4. Exim

    5. None of the above

  19. Where are mail logs usually stored in a standard
    syslog
    setup?

    1. /var/log/messages

    2. /var/log/secure

    3. /var/log/dmesg

    4. /var/log/maillog

    5. /var/maillog

  20. How many hosts can exist on a subnet with mask 255.255.255.128?
    Select one.

    1. 512

    2. 256

    3. 128

    4. 127

    5. 126

  21. For an Internet workstation with a single network interface,
    what routes must be added to interface
    eth0
    after
    it is initialized? Select one.

    1. None

    2. Interface

    3. Interface and default gateway

    4. Interface, local network, and default gateway

  22. On a Linux server, what service is most likely “listening” on
    port 25? Select one.

    1. Apache

    2. SSHd

    3. Postfix

    4. Samba

    5. FTP

  23. Which one of these protocols is a Layer 4 connection-oriented
    protocol? Select one.

    1. TCP

    2. IP

    3. UDP

    4. ICMP

  24. Which command will display information about Ethernet interface
    eth0
    ? Select one.

    1. cat /proc/eth/0

    2. ifconfig eth0

    3. ipconfig eth0

    4. ipconfig /dev/eth0

    5. cat /etc/eth0.conf

  25. What does the
    printcap
    entry
    sd
    indicate? Select one.

    1. The system default printer

    2. A printer’s spool directory

    3. A device file for the printer

    4. A location where errors are stored

    5. The printer driver

  26. Which of the following is a valid entry in
    /etc/fstab
    for a remote NFS mount from server
    fs1
    ? Select one.

    1. fs1:/proc /mnt/fs1 nfs defaults 9
      9

    2. /mnt/fs1 fs1:/proc nfs defaults 0
      0

    3. fs1:/home /mnt/fs1 nfs defaults 0
      0

    4. /mnt/fs1 fs1:/home nfs defaults 0
      0

    5. /home:fs1 /mnt/fs1 nfs defaults 0
      0

  27. Which network protocol is used by SSH and FTP? Select
    one.

    1. ICMP

    2. UDP

    3. TCP

    4. DHCP

    5. PPP

  28. Which of the following programs will display DNS information for
    a host? Choose all that apply.

    1. host

    2. nslookup

    3. nsstat

    4. dig

    5. ping

  29. Which of the following statements regarding the ICMP protocol is
    not
    true? Select one.

    1. ICMP is connectionless.

    2. ICMP provides network flow control.

    3. ICMP is also known as UDP.

    4. ICMP is used by
      ping
      .

  30. What server daemon resolves domain names to IP addresses for
    requesting hosts?

  31. What function does a print filter serve? Select one.

    1. It collates output from multiple users.

    2. It translates various data formats into a page description
      language.

    3. It rejects print requests from unauthorized users.

    4. It rejects print requests from unauthorized hosts.

    5. It analyzes print data and directs print requests to the
      appropriate
      lpd
      .

  32. Consider the following excerpt from the file
    /etc/resolv.conf
    on a Linux
    workstation
    :

    nameserver 127.0.0.1
    nameserver 192.168.1.5
    nameserver 192.168.250.2

    What can be said about this configuration? Select one.

    1. Two DNS servers on the public network are being used for
      resolution.

    2. One DNS server on the local network is being used for
      resolution.

    3. The configuration contains errors that will prevent the
      resolver from
      functioning
      .

    4. A caching-only nameserver is the first nameserver
      queried.

    5. The resolver library will consult
      nameserver 192.168.250.2
      first.

  33. Name the file that contains simple mappings between IP addresses
    and system names.

  34. What program can be used to interactively change the behavior of
    a print queue? Select one.

    1. lpd

    2. lpr

    3. lpq

    4. lprm

    5. lpc

  35. What program will display a list of each hop across the network
    to a specified destination? Select one.

    1. tracert

    2. rttrace

    3. traceroute

    4. routetrace

    5. init

  36. What is the system-wide
    bash
    configuration
    file called? Include the entire path.

  37. How can a nonprivileged user configure
    sendmail
    to forward mail to another account?
    Select one.

    1. She can add a new entry in
      /etc/aliases
      .

    2. She can create a
      .forward
      file
      containing the new address.

    3. She can create an
      .alias
      file
      containing the new address.

    4. She can create a
      sendmail.cf
      file
      containing the new address.

    5. She cannot forward mail without assistance from the
      administrator.

Other books

Hotlanta by Mitzi Miller
Unicorn Keep by Angelia Almos
The Rescuer by Joyce Carol Oates
Phantom of Blood Alley by Paul Stewart
The Enemy by Charlie Higson
The Juniper Tree and Other Tales by The Brothers Grimm
Last Ditch by Ngaio Marsh
Mermaids in the Backyard by Catherine Hapka
Grimble at Christmas by Quentin Blake
Times Without Number by John Brunner