LPI 102 Test Guide

source: http://gnosis.cx/publish/programming/exam102.html

1. Suppose that after installing a serial multi-port card on a system, the mouse connected to a serial port on your motherboard stops functioning. Which of the following commands is MOST likely to be useful in diagnosing this problem?

Answer: setserial -a /dev/cua0

2. To determine what SCSI devices are attached to and recognized on either of the two SCSI channels by the currently running system, which command line would be BEST to run?

Answer: cat /proc/scsi/scsi

3. Which of the following command lines would provide the most useful information in diagnosing a suspected hardware address conflict between an an EISA ethernet NIC card and a video controller?

    • A. cat /proc/irq

    • B. cat /proc/meminfo

    • C. cat /proc/iomem Answer

    • D. cat /proc/modules

4. Whick of the following Linux utilities is MOST useful in determining what sort of motherboard audio support exists on the current system?

Answer: modprobe

5. Which Linux utility would provide BEST guidance to determining the relative performance characteristics of the several local hard-disks installed on a system?

Answer: hdparm

6. Please examine the '/etc/lilo.conf' file listed in the exhibit. Assume for purposes of this question that this configuration accurately matches the partitioning of the current system, and also that 'lilo' has been run while this configuration file is as listed. Which of the following statements do you know to be true?

boot=/dev/hda

map=/boot/map install=/boot/boot.b vga=791 default=redhat keytable=/boot/us.klt lba32 prompt timeout=200 message=/boot/message menu-scheme=wb:bw:wb:bw image=/boot/vmlinuz-2.4.7-10 label=redhat-2.4.7 root=/dev/hda9 read-only image=/boot/vmlinuz-2.4.16 label=redhat alias=redhat-2.4.16 root=/dev/hda9 read-only image=/boot/vmlinuz-2.4.8-26mdk label=mandrake81 root=/dev/hda10 initrd=/boot/initrd.img append=" devfs=mount" read-only image=/boot/vmlinuz-2.2.15-4mdk label=mandrake71 root=/dev/hda7 read-only other=/dev/hda2 label=eComStation table=/dev/hda other=/dev/fd0 label=floppy unsafe

    • A. lilo is installed to the master boot record of the first Answer IDE hard-disk.

    • B. lilo is installed on the partition '/dev/hda9' where there is a kernel image called '/boot/vmlinuz-2.4.7-10' on that partition.

    • C. Exactly three partitions on '/dev/hda' contain separate Linux installation.

    • D. The default boot kernel image is in a file named Answer 'vmlinuz-2.4.16'.

    • E. The kernel image /boot/vmlinuz-2.4.8-26mdk is stored on the partition '/dev/hda10'.

    • F. The current system contains exactly one IDE hard-disk.

7. Suppose that you have just downloaded the application 'someapp' in the form of the file 'someapp-1.3.7.src.tar.bz2'. You have placed this file in your '~/tmp' directory. Which of the following command lines would be a reasonable first step for installation of the application

    • A. rpm Uvh someapp-1.3.7.src.tar.bz2

    • B. tar xvfj someapp-* Answer

    • C. bunzip2 someapp-1.3.7.src.tar.bz2 | tar tvf - Answer

    • D. cat someapp-1.3.7* | tar xvfz -

    • E. dbkg -L someapp-1.3.7.src.tar.bz2 | less

    • F. make --all someapp-1.3.7.src.tar.bz2

8. Which of the following commands is frequently run first when compiling an unpacked Linux application from C source code?

Answer: configure

9. Which of the following command lines would be MOST useful in determining a list of the shared libraries loaded with the application '/usr/local/bin/someapp'?

Answer: ldd -v /usr/local/bin/someapp

10. Assume you are maintaining a Debian-based Linux system. You wish to install the application 'someapp'. Which of the following command lines would be the most common way to install the application?

Answer: apt-get install someapp

11. Assume you are maintaining a Debian-based Linux system. You find a file on your system called '/usr/local/bin/curious', and are unsure why the file is present. Which of the following commands would provide you with information about the Debian package from which the file was installed?

Answer: dpkg -S /usr/local/bin/curious

12. Assume you are maintaining a RPM-based Linux sysem. Which of the following command lines would be a likely choice for installing a precompiled distribution of the application 'someapp'

Answer: rpm -Uvh someapp-1.3.7.i586.rpm

13. Assume you are maintaining a RPM-based Linux sysem. Which of the following applications can be used (if present on your system) for interactive management of installed packages?

Answer: BDF

    • A. dselect

    • B. kpackage

    • C. gpackage

    • D. xrpm

    • E. rpmfind

    • F. gnorpm

14. Which of the following command lines would you use to verify that a Red Hat Package for 'someapp' that you wish to install has not become corrupted, or been tampered with?

Answer: rpm -Kv someapp-1.3.7.i586.rpm | tee someapp-1.3.7.md5

15. Which of the following utilities can be used to load driver support for an additional hardware device at runtime?

Answer: AC

    • A. modprobe

    • B. lsmod

    • C. insmod

    • D. chmod

    • E. modules

    • F. modinfo

16. The exhibit for this question is one screen of the kernel config utility at '/usr/src/linux-2.4.17/scripts/Menuconfig'. Based on this screen which of the following statements describe the kernel that would be created after saving the listed options?

Answer: BF

boot=/dev/hda map=/boot/map install=/boot/boot.b vga=791 default=redhat keytable=/boot/us.klt lba32 prompt timeout=200 message=/boot/message menu-scheme=wb:bw:wb:bw image=/boot/vmlinuz-2.4.7-10 label=redhat-2.4.7 root=/dev/hda9 read-only image=/boot/vmlinuz-2.4.16 label=redhat alias=redhat-2.4.16 root=/dev/hda9 read-only image=/boot/vmlinuz-2.4.8-26mdk label=mandrake81 root=/dev/hda10 initrd=/boot/initrd.img append=" devfs=mount" read-only image=/boot/vmlinuz-2.2.15-4mdk label=mandrake71 root=/dev/hda7 read-only other=/dev/hda2 label=eComStation table=/dev/hda other=/dev/fd0 label=floppy unsafe

    • A. Multi-IO card drivers are contained in loadable modules rather than in the base kernel.

    • B. The compiled system supports parallel ports at a hardware level, but we cannot determine whether parallel printer support is installed.

    • C. IEEE 1284 (enhanced parallel) mode drivers are contained in loadable modules rather than in the base kernel.

    • D. PCMCIA management drivers are contained in loadable modules rather than in the base kernel.

    • E. Kernel support for SuperIO chipsets is included in this base kernel.

    • F. IEEE 1284 (enhanced parallel) mode drivers are compiled directly into this base kernel.

Which of the following command lines can NOT be used to configure the compilation of a new Linux kernel and kernel modules?

    • A. make xconfig

    • B. make menuconfig

    • C. make kernconfig Answer

    • D. make config

17. Which of the following key sequences will save changes made during a 'vi' editing session, and end the application?

Answer: <esc>:wq

18. Which of the following utilities can be used to terminate a spooled print job without printing it?

Answer: B

    • A. lpr

    • B. lpc

    • C. lpd

    • D. lpq

19. Which of the following Linux comand lines will convert a plain text file 'file.txt' to postscript for later (prettified) printing or viewing? Assume for this question that any mentioned utilities are actually installed to the system in question.

Answer: AB

    • A. enscript -p - file.txt > file.ps

    • B. a2ps -o file.ps file.txt

    • C. text2ps < file.txt > file.ps

    • D. cat file.txt | lpr -P file.ps

    • E. ps2ascii file.ps file.txt

    • F. gs --source=file.txt --output=file.ps

20. There have been a number of print-spooling systems developed for Linux, often offering a different range of capabilities such as format conversions and job-control tools. Which ONE of the following is NOT a widely used print-spooling system?

Answer: B

    • A. CUPS

    • B. GPR

    • C. PDQ

    • D. LPD

21. There have been a number of document-type filtering systems developed for Linux, and working in cooperation with print-spooling daemons. Which ONE of the following is NOT a widely used filtering tool?

Answer: doctype-filter

22. The exhibit for this question shows several shell configuration files. Assume for this exercise that the PS1 environment variable is not modified elsewhere in the (partially) displayed files, nor is it set anywhere else. If user 'jdoe' opens a secure shell connection to this system (named 'fury') from a remote location, what will his bash prompt display?

Answer: C

# head -2 /home/jdoe/.bashrc PS1='From .bashrc --* ' export PS1 # head -2 /home/jdoe/.bash_login PS1='From .bash_login --* ' export PS1 # head -2 .bash_profile PS1='From .bash_profile --* ' export PS1 # grep 'PS1=' /etc/bashrc [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

    • A. From .bashrc --*

    • B. From .bash_login --*

    • C. From .bash_profile --*

    • D. [jdoe@fury jdoe]$

23. The exhibit for this question shows several shell configuration files on machine 'fury'. Assume for this exercise that the PS1 environment variable is not modified elsewhere in the (partially) displayed files, nor is it set anywhere else. If the root user issues a 'su jdoe' command, what will her bash prompt display?

Answer: A

# head -2 /home/jdoe/.bashrc PS1='From .bashrc --* ' export PS1 # head -2 /home/jdoe/.bash_login PS1='From .bash_login --* ' export PS1 # head -2 .bash_profile PS1='From .bash_profile --* ' export PS1 # grep 'PS1=' /etc/bashrc [ "$PS1" = "\\s-\\v\\\$ " ] && PS1="[\u@\h \W]\\$ "

    • A. From .bashrc --*

    • B. From .bash_login --*

    • C. From .bash_profile --*

    • D. [jdoe@fury root]$

24. Which of the following bash command lines could be used to "run every executable file in the current directory"?

    • A. for i in * ; do { case [ -x $i ] ; { ./$i; } esac } done

    • B. while i in * ; do { if [ -x $i ] ; then { ./$i; } fi } done

    • C. foreach i in * ; do { if [ -x $i ] ; then { ./$i; } done }

    • D. for i in * ; do { if [ -x $i ] ; then { ./$i; } fi } done

25. What special line is normally placed at the top of a custom bash shell script?

Answer: #!/bin/bash

26. Which of the following utilities are commonly available on a Linux system, and have the capability to detect chipset details and installed memory on local video cards (useful for configuring XFree86)?

Answer: BD

    • A. XF86Config

    • B. SuperProbe

    • C. scanpci

    • D. XConfigurator

    • E. X11Setup

    • F. scanvideo

27. The file '/etc/X11XF86Config' contains configuration information about the local X server. Where within this file can you specify the video resolutions available when using the Ctrl-Alt-(Plus/Minus) toggles?

Answer: B

    • A. Section "Device" / Subsection "Resolutions"

    • B. Section "Screen" / Subsection "Display"

    • C. Section "Monitor" /Subsection "Mode"

    • D. Section "Video" / Subsection "ModeLine"

28. Which of the following XFree86 tools is used to configure access to remote X11 clients?

Answer: xdm

29. Unfortunately, not all X11 applications are well behaved. In particular, some applications are notorious for leaving behind phantom processes when an X session is exited. Which command line below might you use to make sure the application 'Xsomeapp' is terminated?

Answer: ps h -o pid -C Xsomeapp | xargs kill -9

30. Suppose that you would like to allow the current system to act as an X client for SOME remote X servers. Also assume that the current system is configured to recognize the alias TRUSTED for a corresponding IP address. Which of the following command lines would allow the machine TRUSTED to run an X11 application that lives on the current system?

Answer: xhost +TRUSTED

31. Which of the following environment variables is used to determine which workstation--local or remote--a launched X11 application will display on?

Answer: DISPLAY

32. RFC 1700 defines a set of standard port numbers for TCP/IP services. Some of these ports are fairly obscure, while a number are used on a daily basis by a Linux systems administrator for diagnosis of network issues. Which three services are mapped to the TCP/IP ports 80, 110 and 21 (in the listed order)?

Answer: http, pop3, ftp

33. Which of the following files is used to define aliases for IP addresses, especially within a local TCP/IP network?

Answer: /etc/hosts

34. Which of the following statements BEST describes a reason why you would want to run a DHCP server on an internal company LAN network?

    • A. To serve as a gateway between the external internet and an internal network, and to provide IP address translation of packets.

    • B. To filter network packets that may contain unauthorized or malicious contents, such as "hacker" portscans or overly large email attachments.

    • C. To allow in-company machines to access a central "web-services" application that is utilized in common by various employees.

    • D. To avoid confict between assigned IP addresses on various Answer in-company machines, especially where machines such as laptops may between different ethernet hubs.

35. Which of the following TCP/IP network utilities is the BEST tool to use to establish if a given IP address is reachable under the current network configuration?

Answer: ping

36. Which of the following TCP/IP network utilities is BEST used to determine the hardware ethernet address of the card(s) installed in the current machine?

Answerr: ifconfig

37. Which of the following TCP/IP network utilities is the BEST tool to use in identifying bottlenecks between remote machines on the network? Specifically, assume a goal in this debugging is to determine the paths travelled in the forwarding of network packets, and identify intermediate routers that may be dropping packets.

Answer: traceroute

38. Suppose that you find that your ISPs DNS service is slow or unreliable, and you would like to configure aliases for a few frequently targetted sites directly on the machines of users of the company internal network you maintain. Which of the following TCP/IP network utilities could you use to determine the IP address assigned to symbolic domain names (e.g."www.somehostsite.com")?

Answer: CDF

    • A. hostname

    • B. whois

    • C. host

    • D. nslookup

    • E. netstat

    • F. ping

39. Which of the following commands is NOT a widely used Linux utility for initiating and configuring PPP connections?

    • A. KPPP

    • B. WvDial

    • C. netconf

    • D. netppp Answer

40. Which of the following utilities is often used in conjunction with inetd to log and filter incoming connection requests?

    • A. tcpd Answer

    • B. logwatch

    • C. ipfilt

    • D. xinetd

41.The exhibit for this question shows the content of a hypothetical '/etc/xinetd.d/floozflam' configuration file. Assume that '/etc/xinetd.conf' includes the line "includedir /etc/xinetd.d", and that xinetd is used on the current system. Which of the following statements can you deduce from the provided information?

Answer: C

# description: the floozflam server handles # flamflooz client connections service floozflam { disable = yes flags = NORETRY socket_type = stream wait = yes user = root server = /usr/sbin/in.floozflamd log_on_failure += USERID }

    • A. The floozflam service is carried over the UDP protocol.

    • B. Multiple floozflam servers will be forked if multiple incoming requests are received.

    • C. The floozflam service in not activated on the current system.

    • D. If a floozflam connection fails, the IP address of the requesting client is logged.

42. Suppose that the 'sendmail' application is used on the current system as a mail transport agent. What file may user 'jdoe' modify in order to cause mail sent to him to be temporarily directed to an address outside the system's domain?

    • A. /etc/sendmail/jdoe/forward

    • B. /home/jdoe/aliases

    • C. /etc/mail/aliases

    • D. /home/jdoe/.forward Answer

43. Suppose that the 'sendmail' application is used on the current system as a mail transport agent. If the file '/etc/aliases' has been manually updated, what command needs to be run in order to cause the changes to take effect?

    • A. sendmail -bh

    • B. sendmail -ba

    • C. sendmail -bi Answer

    • D. sendmail -bp

44. Which of the following command lines can be used to determine the list of modules that have been compiled into the Apache web server?

    • A. ls /etc/httpd/modules/

    • B. httpd -l Answer

    • C. apache --modules

    • D. less /etc/httpd/conf/modules.conf

45. Which of the following files or directories is used to configure the local directories that are made available remotely by an Network File System server?

    • A. /etc/fstab

    • B. /mnt/nfs

    • C. /etc/smb.conf

    • D. /etc/exports Answer

46. Which of the following protocols/tools is MOST likely to be used in integrating a Linux system into a Windows network, and for accessing Windows files?

    • A. NFS

    • B. SAMBA Answer

    • C. FTP

    • D. SCP

47. Suppose that you have configured one Linux system on an internal LAN to run a DNS server. Which of the following files need to be updated on each DNS client on the LAN to get them to utilize the DNS service?

    • A. /etc/hosts

    • B. /etc/exports

    • C. /etc/resolv.conf Answer

    • D. /etc/dns.conf

48. In performing a security audit on a Linux system, one well-known security issue is applications that are configured to run as root (or from other high-permission accounts) that may be subject to call vulnerabilities such as buffer overruns. Which of the following command lines can be used for an initial sweep in analyzing this issue?

    • A. suid --list /*

    • B. chmod -R u-s ./*

    • C. find / -perm +4000 -user root Answer

    • D. chgrp root `find / -suid`

49. Which of the following protocols or tools is BEST used to batch copy files between networked machines in a manner that protects their contents from an intruder using a packet sniffer?

    • A. ssh/scp Answer

    • B. httpd/SSL

    • C. gpg/snmp

    • D. nfs/md5sum

50. Which of the following Linux utilities is used to update the user passwords stored in '/etc/passwd' to utilize the more secure "shadow password" style.

    • A. passwd -s

    • B. mkshadow

    • C. shadowpw

    • D. pwconv Answer

51. Which of the following websites are well-known and important resources for monitoring known security problems in Linux distributions, and for obtaining patches and updates for vulnerable applications and components?

Answer: ADF

    • A. http://www.securityfocus.com/

    • B. http://www.bugtraq.com/

    • C. http://www.securityupdate.net/

    • D. http://www.cert.org/

    • E. http://www.linux-bugwatch.gov/

    • F. http://www.linuxsecurity.com

52. One danger of a poorly written (or malicious) CGI application is that it can fork overly many child processes, eventually swamping the host system. Which of the following steps could BEST be used to control this specific danger?

Answer: A

    • A. Include the line 'ulimit -u 512' in the file /etc/profile.

    • B. For each CGI user, run the command 'edquota username', and set blocks to 2048 (or other appropriate value).

    • C. If a user is discovered to have an errant CGI application, run the command line 'ps hU username -o pid | xargs kill -9' to terminate their stray processes.

    • D. Edit the file /etc/limits to include a line similar to 'CGI 512 2048 0 0 -' (or other appropriate values).

EOF