Read LPI Linux Certification in a Nutshell Online
Authors: Adam Haeder; Stephen Addison Schneiter; Bruno Gomes Pessanha; James Stanger
Tags: #Reference:Computers
What daemon is associated with the control files
/etc/hosts.allow
and
/etc/hosts.deny
?
In general terms, describe a method to locate SUID programs in
the local filesystem. Why might an administrator do this
routinely?
What is the danger of making
/bin/vi
SUID?
Why should a user run
ssh
instead of
telnet
?
Describe shadow passwords and the file where the passwords are
stored. Why don’t we store encrypted password strings in
/etc/passwd
anymore?
How can the tool
/usr/sbin/lsof
help you
identify potential security issues?
What is the difference between a hard limit and a soft limit,
with regard to the
ulimit
command?
Why is it advisable to use
sudo
rather
than
su
in an environment with multiple
administrators?
What kinds of things can you ascertain about a remote system
with the
nmap
command?
Describe the process of key-based authentication between
systems using
ssh
.
What is the difference between a public and a private key?
What are they used for?
Describe how to encrypt a file with
gpg
.
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?
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?
Look at the file
/etc/shadow
. What user accounts do not
have passwords? Why don’t they?
Experiment with the
chage
command to set
the password age for your account.
Run
ulimit –a
. What default limits are
set? What would be some useful limits to place on users?
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?
Run
nmap localhost
. Does this output
match what you saw from the previous
netstat
command? Why or why not?
If you have
xinetd
installed, go to the
/etc/xinetd.d
directory and
determine what services are enabled.
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.
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.
What environment variable holds the list of all directories that
are searched by the shell when you type a command name?
$LIST
$VIEW
$PATH
$ENV
None of the above
In the
bash
shell, entering the!!
command has the same effect as which one
of the following (assuming
bash
is in emacs
mode)?
Ctrl-P and Enter
Ctrl-N and Enter
Ctrl-U and Enter
!-2
!2
Name the command that displays pages from the online user’s
manual and command reference.
Which of the following commands displays the comments from a
bash
script? Select all that apply.
find “^#” /etc/rc.d/rc.local
sed ‘/^#/ !d’ /etc/init.d/httpd
grep ^# /etc/init.d/httpd
grep ^# /etc/passwd
locate “^#” /etc/skel/.bashrc
Which one of the following answers creates an environment
variableVAR1
, present in the
environment of a
bash
child process?
VAR1="fail" ; export VAR1
VAR1="fail" \ export VAR1
VAR1="fail"
set VAR1="fail" ; enable VAR1
export VAR1 \ VAR1="fail"
What SQL command is used to modify data present in a
table?
INSERT
WHERE
UPDATE
OVERWRITE
JOIN
What output will the following command generate:
seq
-s";" -w 1 10
01;02;03;04;05;06;07;08;09;10
1;2;3;4;5;6;7;8;9;10
1;10
01;02;03;04;05;06;07;08;09;010
None of the above
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.
Putalias cp='cp -i'
in
~/.bashrc
Putalias cp='cp -i'
in
~/.bash_profile
Putalias cp='cp -p'
in
~/.bashrc
Putalias cp='cp -p'
in
~/.bash_profile
Putalias cp = 'cp -I'
in
~/.bashrc
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?
in
a1
a2
a1
a2
$v1
$v1
$v1
No output is produced, but the script executes
correctly.
No output is produced, because the script has an
error.
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.
Accounts
jdoe
and
bsmith
have no passwords.
Accounts
jdoe
and
bsmith
are disabled.
The passwords are in
/etc/passwd-
.
The passwords are in
/etc/shadow
.
The passwords are in
/etc/shadow-
.
What is the main configuration file for X Windows?
/etc/xorg.conf
/etc/x11.conf
/etc/X11/x11.conf
/etc/X11/xorg.conf
None of the above
What file in the user’s home directory will an X Windows
application look to for configuration settings such as color and video
mode?
~/.xinitrc
~/.xconfig
~/.Xresources
~/.xorg.conf
~/.bashrc
What is the protocol XDMCP used for?
Remote logging of X Windows events.
Remote control of a running X Windows display.
Graphical login support for the local host.
Graphical login support for remote hosts on the
network.
None of the above.
Which of the following are
not
commonly
used display managers for X Windows? Choose two.
xdm
gdm
kdm
xfce
X11
Emacspeak is:
A popular text editor for Linux.
A window manager.
An assistive technology that handles screen reading for a
number of console applications.
An assistive technology that provides a user with an
on-screen keyboard.
None of the above.
Which one of the following outcomes results from the following
command?
#chmod g+s /home/software
The SUID bit will be set for
/home/software
.
The SGID bit will be set for
/home/software
, preventing access by those
not a member of the
software
group.
The SGID bit will be set for
/home/software
, to keep group membership of
the directory consistent for all files created.
The sticky bit will be set for
/home/software
.
The sticky bit will be applied to all files in
/home/software
.
Which one of these files determines how messages are stored
using
syslogd
?
/etc/sysconfig/logger.conf
/etc/syslog.conf
/etc/syslogd.conf
/etc/conf.syslog
/etc/conf.syslogd
Which MTA was designed specifically with security in
mind?
Sendmail
Postfix
Qmail
Exim
None of the above
Where are mail logs usually stored in a standard
syslog
setup?
/var/log/messages
/var/log/secure
/var/log/dmesg
/var/log/maillog
/var/maillog
How many hosts can exist on a subnet with mask 255.255.255.128?
Select one.
512
256
128
127
126
For an Internet workstation with a single network interface,
what routes must be added to interface
eth0
after
it is initialized? Select one.
None
Interface
Interface and default gateway
Interface, local network, and default gateway
On a Linux server, what service is most likely “listening” on
port 25? Select one.
Apache
SSHd
Postfix
Samba
FTP
Which one of these protocols is a Layer 4 connection-oriented
protocol? Select one.
TCP
IP
UDP
ICMP
Which command will display information about Ethernet interface
eth0
? Select one.
cat /proc/eth/0
ifconfig eth0
ipconfig eth0
ipconfig /dev/eth0
cat /etc/eth0.conf
What does the
printcap
entrysd
indicate? Select one.
The system default printer
A printer’s spool directory
A device file for the printer
A location where errors are stored
The printer driver
Which of the following is a valid entry in
/etc/fstab
for a remote NFS mount from server
fs1
? Select one.
fs1:/proc /mnt/fs1 nfs defaults 9
9
/mnt/fs1 fs1:/proc nfs defaults 0
0
fs1:/home /mnt/fs1 nfs defaults 0
0
/mnt/fs1 fs1:/home nfs defaults 0
0
/home:fs1 /mnt/fs1 nfs defaults 0
0
Which network protocol is used by SSH and FTP? Select
one.
ICMP
UDP
TCP
DHCP
PPP
Which of the following programs will display DNS information for
a host? Choose all that apply.
host
nslookup
nsstat
dig
ping
Which of the following statements regarding the ICMP protocol is
not
true? Select one.
ICMP is connectionless.
ICMP provides network flow control.
ICMP is also known as UDP.
ICMP is used by
ping
.
What server daemon resolves domain names to IP addresses for
requesting hosts?
What function does a print filter serve? Select one.
It collates output from multiple users.
It translates various data formats into a page description
language.
It rejects print requests from unauthorized users.
It rejects print requests from unauthorized hosts.
It analyzes print data and directs print requests to the
appropriate
lpd
.
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.
Two DNS servers on the public network are being used for
resolution.
One DNS server on the local network is being used for
resolution.
The configuration contains errors that will prevent the
resolver from
functioning
.
A caching-only nameserver is the first nameserver
queried.
The resolver library will consultnameserver 192.168.250.2
first.
Name the file that contains simple mappings between IP addresses
and system names.
What program can be used to interactively change the behavior of
a print queue? Select one.
lpd
lpr
lpq
lprm
lpc
What program will display a list of each hop across the network
to a specified destination? Select one.
tracert
rttrace
traceroute
routetrace
init
What is the system-wide
bash
configuration
file called? Include the entire path.
How can a nonprivileged user configure
sendmail
to forward mail to another account?
Select one.
She can add a new entry in
/etc/aliases
.
She can create a
.forward
file
containing the new address.
She can create an
.alias
file
containing the new address.
She can create a
sendmail.cf
file
containing the new address.
She cannot forward mail without assistance from the
administrator.