Studying for the CompTIA Linux+ Powered by LPI Certification Exams - Linux Certification - Linux All-in-One For Dummies, 5th Edition (2014)

Linux All-in-One For Dummies, 5th Edition (2014)

Book VIII. Linux Certification

Chapter 2. Studying for the CompTIA Linux+ Powered by LPI Certification Exams

In This Chapter

arrow Getting an overview of the CompTIA Linux+ Exams

arrow Looking into each domain in depth

The previous chapter examines the Linux Essentials exam – LPI’s lower-level certification. That certification should be viewed as a steppingstone to a higher-level exam. The Linux+ certification exam from CompTIA – consisting of the LPI LX0-101 and LX0-102 exams – is an ideal example of such a high-level test.

In the following sections, we provide an overview of the two exams and then explore the topics beneath each of the domains.

Overview of the CompTIA Linux+ Exams

The official name of the certification in question is “CompTIA Linux+ Powered by LPI” and although that’s a mouthful to say, it’s also a meaningful addition to a résumé. The certification is awarded by CompTIA; it consists of two exams by the Linux Professional Institute (LPI): LX0-101 and LX0-102. Accordingly, at the time of taking the exams, a candidate can choose to have the test scores forwarded to LPI — and gain the Level 1 certification (LPIC-1) at the same time.

tip.eps Records are separately maintained by LPI and CompTIA. If you choose not to forward your scores, you can be Linux+-certified but not LPIC-1 certified.

Each of the two exams consists of 60 questions that must be answered in 90 minutes. The passing score is 500 on a scale from 200 to 800, and it is highly recommended – but not required – that candidates have 12 months of Linux administration experience.

There are four domains on one exam and six on the other. Table 2-1 shows the domains on each, along with their prospective weighting.

Table 2-1 Domains on the Linux+ Exams

Exam

Domain

Weighting

LX0-101

101 System Architecture

14%

102 Linux Installation and Package Management

18%

103 GNU and Unix Commands

43%

104 Devices, Linux Filesystems, Filesystem Hierachy Standard

25%

LX0-102

105 Shells, Scripting, and Data Management

17%

106 User Interfaces and Desktops

8%

107 Administrative Tasks

20%

108 Essential System Services

17%

109 Networking Fundamentals

23%

110 Security

15%

The sections that follow look at each of these topics in more detail.

System Architecture

Table 2-2 shows the subtopics, weights, descriptions, and key knowledge areas for this topic.

3202

To adequately address these topics, focus on the following files, terms, and utilities: /dev, /etc/init.d, /etc/inittab, /proc, /sys, /var/log/messages, BIOS, boot loader, dmesg, init, kernel, lsmod, lspci, lsusb, modprobe, shutdown, and telinit.

Here are the top ten items to know as you study for this domain:

1. The system log is /var/log/messages and this is where the majority of events are written to by the system log daemon (syslogd). Messages routed there can be viewed with the dmesg command.

2. The logrotate command can be used to automatically archive log files and perform maintenance as configured in /etc/syslog.conf.

3. You can manually write entries to log files using the logger command.

4. The init daemon is responsible for maintaining proper running of daemons at specified run levels. The system attempts to go to the run level specified as the default in the /etc/inittab file upon each boot.

5. Run levels can be changed with the init and shutdown commands.

6. Valid run levels defined as standards are: 0 (power off), 1 (single-user mode), 2 (multiple user without NFS), 3 (multiple user with NFS), 5 (X environment), and 6 (reboot).

7. The lsmod command is used to list loaded modules. The insmod command is used to install a module. The rmmod command is used to remove a module from the system. The modinfo command will show information about a module.

8. The modprobe utility can probe and install a module and its dependents, while the depmod utility will determine and show any module dependencies that exist.

9. Kernel software is typically named linux-x.y.z where x.y.z represents the version number.

10. The make config command executes a command-line-oriented view and allows you to respond interactively with the kernel build.

Linux Installation and Package Management

Table 2-3 shows the subtopics, weights, descriptions, and key knowledge areas for this topic.

3203

To adequately address these topics, focus on the following files, terms, and utilities: /(root) file system, /boot/grub/menu.lst, /etc/apt/sources.list, /etc/ld.so.conf, /etc/yum.conf, /etc/yum.repos.d/, /home file system, /var file system, apt-cache, apt-get, aptitude, dpkg, dpkg-reconfigure, grub-install, LD_LIBRARY_PATH, ldconfig, ldd, MBR, mount points, partitions, rpm, rpm2cpio, superblock, swap space, yum, yumdownloader.

Here are the top ten items to know as you study for this domain:

1. The ldd command is used to see what shared libraries a program is dependent upon.

2. The ldconfig command is used to update and maintain the cache of shared library data. You can see the current cache by using the command ldconfig –p.

3. Popular package managers include Red Hat’s Package Manager (rpm) and Debian’s (dpkg). The purpose of both is to simplify working with software.

4. Options available with rpm include –i (for installing packages), -e (for removing packages), -q (for querying what packages belong to what files), -b (for building a package), and –p (to print/display information).

5. With dpkg, you use the dselect command to use the graphical interface. You can also use command-line options that include –i (to install packages), -l (to list information about the package), -r (to remove the package), and –c (to list all files in the package).

6. The Advanced Packaging Tool (apt) was designed as a front end for dpkg but now works with both .deb and .rpm packages.

7. The Yellow dog Updater, Modified is more commonly known as Yum and can be used at the command line to download RPM packages.

8. The superblock contains information about the type of file system, the size, status, and metadata information.

9. The GRUB bootloader (an acronym for GNU’s Grand Unified Bootloader) allows multiple operating systems to exist on the same machine and a user to choose which one they want to boot on startup. The latest version is GRUB 2.

10. Linux uses both a swap partition and a swap file for swap space. The swapon command can be used to toggle designated swap space on and off. Areas for swap space can be created with mkswap.

GNU and Unix Commands

Table 2-4 shows the subtopics, weights, descriptions, and key knowledge areas for this topic.

3204
3204a

To adequately address these topics, focus on the following files, terms, and utilities: &, ., bash, bg, bzip2, cat, cp, cpio, cut, dd, echo, egrep, env, exec, expand, export, fg, fgrep, file, file globbing, find, fmt, free, grep, gunzip, gzip, head, history, jobs,join, kill, killall, ls, man, mkdir, mv, nice, nl, nohup, od, paste, pr, ps, pwd, regex(7), renice, rm, rmdir, sed, set, sort, split, tail, tar, tee, top, touch, tr, uname, unexpand, uniq, unset, uptime, vi, wc, and xargs.

Here are the top ten items to know as you study for this domain:

1. When run, every command spans at least one process and processes can be viewed with ps or top (which continues to update the display dynamically).

2. Jobs can run in the foreground or background and be moved between the two. Jobs running in the foreground can be suspended by pressing Ctrl+Z.

3. Files can be copied using cp or moved using mv. Files can be deleted with rm and directories (which are created with mkdir) can be removed with rmdir. Recursive deletion can be done with rm –r.

4. To change directories, use the cd command. When used without parameters, this will move you to your home directory. To see what directory you are presently working in, use the pwd (present working directory) command.

5. The ls command has a plethora of options to allow you to list files. The –a option will list all (including hidden) files.

6. The cut command can pull fields from a file and they can be combined using either paste or join. The latter offers more features than the former and can be used with conditions.

7. The wc command can count the number of lines, words, and characters in a file.

8. The grep utility (and its counterparts egrep and fgrep) can be used to find matches for strings within files.

9. The find command can be used to search the system for files/directories that meet any number of criteria. When these entities are found, the xargs command can be used to look deeper within them for other values (such as in conjunction with grep).

10. It’s possible to convert data from one value to another by using a number of utilities. The most popular would include the tr (translate) utility and sed (the stream editor).

Devices, Linux File Systems, Filesystem Hierarchy Standard

Table 2-5 shows the subtopics, weights, descriptions, and key knowledge areas for this topic.

3205a
3205

To adequately address these topics, focus on the following files, terms, and utilities: /etc/fstab, /etc/updated.conf, /media, chgrp, chmod, chown, debugfs, df, du, dump32fs, e2fsck, edquota, ext2/ext3/ext4, find, fsck, ln, locate, mke2fs, mkfs, mkswap, mount, quota, quotaon, reiserfs v3, repquota, tune2fs, type, umask, umount, updated, vfat, whereis, which, xfs, xfs tools

Here are the top ten items to know as you study for this domain:

1. File and directory permissions can be changed with the chmod command (which accepts numeric and symbolic values).

2. The owner of a group can be changed with the chown command whereas the chgrp command allows changing he group associated with a file.

3. The du command can show how much of a disk is used.

4. The df command shows how much of a disk is free.

5. The main tool for troubleshooting disk issues is fsck which can check file-system structure, including inodes.

6. To mount file-systems, use the mount command and to unmount them use umount. To have mounting occur automatically at startup, add the entries to /etc/fstab.

7. Quotas can restrict the amount of space users or groups can use on the disk. Quotas are initialized with the quota command and they are toggled on and off with quotaon and quotaoff. They can be changed with edquota and reports can be generated with repquota.

8. When files are first created, the default permissions are equal to 666 minus any umask values. The default permissions for directories is equal to 777 minus any umask values.

9. The mke2fs utility can be used to make the file-system.

10. Linux supports numerous file-systems including ext2, ext3, ext4, and reiserfs.

Shells, Scripting, and Data Management

Table 2-6 shows the subtopics, weights, descriptions, and key knowledge areas for this topic — the first of the 102 exam.

3206

To adequately address these topics, focus on the following files, terms, and utilities: /etc/profile, ~/.bash_login, ~/.bash_logout, ~/.bash_profile, ~/.bashrc, ~/.profile, alias, delete, env, export, for, from, function, group by, if,insert, join, lists, order by, read, select, seq, set, test, unset, update, where, and while.

Here are the top ten items to know as you study for this domain:

1. Logic can be added to scripts by testing conditions with test or [. Commands can execute using if-then-fi deviations or through looping (while, until, or for). You can leave a script with the exit command or leave a loop with break.

2. Variables can be given at the command line and referenced as $1, $2, and so on, or entered into the executing file with the read command.

3. The alias command can be used to create an alias for a command to operate by another name (for example, being able to type dir and have ls –l performed).

4. Environmental variables can be viewed with the env command.

5. Variables can be added to the environment using the set command and export; they are removed using unset.

6. The /etc/profile configuration file is executed whenever a user logs in.

7. For those using the bash shell, the shell first looks for .bash_profile; if it does not file that profile, it looks for .bash_login.

8. When the bash user logs out, the shell will look for .bash_logout and execute any commands found there.

9. While other configuration files run only when the user logs in or out, the .bashrc file can execute each time a shell is run.

10. Shell scripts must have executable permissions to run, or be called by a shell (for example: sh script). The normal exit status of any script or application is 0 and anything else signifies a non-normal exit.

User Interfaces and Desktops

Table 2-7 shows the subtopics, weights, descriptions, and key knowledge areas for this topic.

3207

To adequately address these topics, focus on the following files, terms, and utilities: /etc/initab, /etc/x11/xorg.conf, braille display, DISPLAY, emacspeak, gdm configuration files, gestures, GOK, high contrast desktop themes, kdm configuration files, large screen desktop themes, mouse keys, on-screen reader, orca, screen magnifier, screen reader, slow/bounce/toggle keys, sticky/repeat keys, X, xdm configuration files, xdpyinfo, xhost, xwininfo

Here are the top ten items to know as you study for this domain:

1. The emacspeak speech interface is one of the most popular speech interfaces available for Linux.

2. The xdpyinfo utility can be used to view information about an X server. It can be used with the all option to see information about all the extensions supported by the server.

3. Window information for X can be viewed with the xwininfo utility. Using the -all option shows all the possible information.

4. The server access-control program for X is xhost. This is used to connect to a host across the network and work within the graphical interface.

5. The X Display Manager (xdm) is the default display manager included with the X Window System.

6. The /etc/x11/xorg.conf file is the X configuration file used for initial setup.

7. Several assistive technology projects have been developed for both KDE (the KDE Accessibility Project) and GNOME (the GNOME Accessibility Projects).

8. Orca is a screen reader from the GNOME project intended to help individuals who are blind or impaired. Orca will work with Firefox, Thunderbird, OpenOffice.org/LibreOffice, and other applications.

9. The GNOME onscreen keyboard reader (GOK) is another assistive technology. It works with XML files and can dynamically create keyboards to adapt to a user’s needs.

10. Slow keys can be configured for a keyboard preference to accept input only if a key is held; this prevents accidental presses from counting as input. Bounce keys can be configured to ignore fast duplicate key presses; sticky keys can be used to simulate simultaneous key presses.

Administrative Tasks

Table 2-8 shows the subtopics, weights, descriptions, and key knowledge areas for this topic.

3208

To adequately address these topics, focus on the following files, terms, and utilities: /etc/at.allow, /etc/at.deny, /etc/cron, /etc/cron.allow, /etc/cron.deny, /etc/crontab, /etc/group, /etc/localtime, /etc/passwd, /etc/shadow,/etc/skel, /etc/timezone, /usr/bin/locale, /usr/share/zoneinfo, /var/spool/cron/*, ASCII, at, atq, atrm, chage, crontab, date, environment variables, groupadd, groupdel, groupmod, iconv, ISO-8859, passwd, tzconfig, tzselect, Unicode, useradd, userdel, usermod, and UTF-8.

Here are the top ten items to know as you study for this domain:

1. Users can be added by manually editing the configuration files or by using the useradd command (and they can be removed with userdel).

2. The groupadd utility can be used to create groups and groupdel can be used to remove groups. Groups can be modified with groupmod and users can change between groups with the newgrp command.

3. To schedule a job to run only once in unattended mode, you can use the at command.

4. Scheduled jobs can be viewed with the atq command and deleted prior to execution with atrm.

5. Restrictions can be placed on who can use the at service (atd) by creating an at.allow file and only placing valid usernames beneath it.

6. You can create an at.deny file – instead of at.allow – and place in it the names of users who cannot use that at service (meaning that everyone not listed in there can still use it).

7. If you need to schedule an unattended job to run at any sort of regular interval, you can create a crontab (cron table) entry for it.

8. Crontab files are read by the cron daemon, which looks every minute to see whether any jobs need to run.

9. Restrictions can be placed on who can use cron by creating a cron.allow or a cron.deny file.

10. There are six fields to each entry in the cron tables: the minute the job is to run (0 to 59), the hour the job is to run (0 to 23), the day of the month (1 to 31), the month of the year (1 to 12), the day of the week (0 to 6), and the path to the executable that is to run.

Essential System Services

Table 2-9 shows the subtopics, weights, descriptions, and key knowledge areas for this topic.

3209

To adequately address these topics, focus on the following files, terms, and utilities: /etc/cups, /etc/localtime, /etc/ntp.conf, /etc/timezone, /usr/share/zoneinfo, ~/.forward, CUPS config files/tools/utils, date, exim, hwclock, klogd, logger, lpd legacy interface (lpr, lprm, lpq), mail, mailq, newaliases, ntpd, ntpdate, pool.ntp.org, postfix, qmail, sendmail, syslog.conf, syslogd.

Here are the top ten items to know as you study for this domain:

1. The Network Time Protocol daemon (ntpd) maintains the time on all servers using NTP.

2. The hwclock command can be used to display the date and time of a system’s hardware clock (also known as the real-time clock).

3. The time zone is configured in the /etc/timezone file. Local time is likewise configured in /etc/localtime.

4. The sendmail service is a general purpose SMTP program used for sending e-mail between servers.

5. The mailq command shows a list of messages in the mail queue and works sendmail.

6. The newaliases command builds a database for the mail aliases file.

7. Mail can be forwarded from one e-mail address to another using a .forward file.

8. Line printers are rarely used anymore, but support for them remains. The primary utilities associated with them were/are as follows: lpr (to submit a print job), lpq (to see the print queue), and lprm (to remove queued print jobs).

9. The Common Unix Printing System (CUPS) is the most common printing interface used on Linux today. It provides support for the line-printer daemon as well as for Server Message Block (SMB).

10. The kernel logging daemon (klogd) logs Linux kernel messages.

Networking Fundamentals

Table 2-10 shows the subtopics, weights, descriptions, and key knowledge areas for this topic.

 width=

To adequately address these topics, focus on the following files, terms, and utilities: /etc/hostname, /etc/hosts, /etc/nsswitch.conf, /etc/resolv.conf, /etc/services, dig, ftp, host, hostname, ifconfig, ifdown, ifup, netstat, ping, route,telnet, tracepath, and traceroute.

Here are the top ten items to know as you study for this domain:

1. IPv4 uses 32-bit addresses divided into four octets. The first octet identifies the class of address (A, B, C). The address can be public or private.

2. The ifconfig utility can be used to see the current IP configuration of the network cards.

3. The ping utility is an all purpose tool for testing connectivity. It will send echo messages to a specified host to see if it can be reached. It can be used with the loopback address (127.0.0.1) to test internal configuration.

4. Instead of using ping, one can use traceroute to see the route taken to reach a particular host.

5. The route utility will display the routing table and allow you to configure it.

6. The netstat utility will show the current status of ports — those that open, those that are listening, and so on.

7. The name of the network host is configured in /etc/hostname and can be viewed with the hostname command.

8. You can remotely log in to to another host with telnet, but it’s highly recommended that this utility no longer be used due to very weak security.

9. Ftp servers can be used to transfer files from one host to another.

10. DNS is used for resolving names to addresses. Utilities that can be used in conjunction with it include dig (for DNS lookup).

Security

Table 2-11 shows the subtopics, weights, descriptions, and key knowledge areas for this topic.

 width=

To adequately address these topics, focus on the following files, terms, and utilities: /etc/hosts.allow, /etc/hosts.deny, /etc/inetd.conf, /etc/inetd.d/*, /etc/init.d/*, /etc/inittab, /etc/nologin, /etc/passwd, /etc/shadow,/etc/ssh/ssh_host_dsa_key, /etc/ssh/ssh_host_rsa_key, /etc/ssh_known_hosts, /etc/sudoers, /etc/xinetd.conf, /etc/xinetd.d/*, ~/.gnupg/*, ~/.ssh/authorized_keys, ~/.ssh/id_dsa, ~/.ssh/id_rsa, chage, find,gpg, id_dsa.pub, id_rsa.pub, lsof, netstat, nmap, passwd, ssh, ssh_host_dsa_key.pub, ssh_host_rsa_key.pub, ssh-add, ssh-agent, ssh-keygen, su, sudo, ulimit, and usermod.

Here are the top ten items to know as you study for this domain:

1. Adding 1000 to standard permissions turns on the “sticky bit”, whereas 2000 turns on the SGID permission and 4000 turns on the SUID permission.

2. Links are created with the ln command. A hard link is nothing more than an alias to a file (sharing the same inode). A symbolic link is created with ln –s and is an actual file with its own inode. The symbolic link contains a pointer to the original file and can span across file systems (while the hard link cannot).

3. Passwords are changed with the passwd command. While older systems stored passwords in /etc/passwd, they are now in /etc/shadow where they are more secure.

4. To see who logged on most recently and may currently still be logged on, you can use the last command.

5. The su command allows you to become another user (returning with exit). If no other username is specified, then the root user is implied, hence su for superuser.

6. To run a command as another user (usually root) rather than become them, sudo should be used instead of su.

7. The who command shows who is logged on; the w command shows information combining who with uptime.

8. You can limit which hosts can remotely connect by using either a hosts.allow file (only those hosts specifically listed can connect) or a hosts.deny file (only those hosts specifically listed cannot connect).

9. The ulimit utility can show the limit on the number of open files allowed in Linux. You can also change that value by using this same command.

10. The usermod command changes attributes for a user and modifies the user account.