LPIC-2

Free LPIC-2 practice questions

10 questions from our LPIC-2 practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.

Back to the LPIC-2 practice exams

Question 1 of 10, 200: Capacity Planning

A server with eight CPU cores shows 'load average: 7.92, 8.05, 7.98' in the output of uptime. Which interpretation is MOST accurate?

  1. AThe CPUs are about 8% utilized, because load average is the percentage of CPU time used over each of the three intervals
  2. BThe host is badly overloaded, since on Linux any load average above 1.00 means that processes are waiting in the run queue for a free CPU core
  3. COn average about eight tasks were runnable or in uninterruptible I/O, which roughly matches the core count, so the host is busy but not badly oversubscribed Correct answer
  4. DLoad is rising sharply, because the 15-minute value is lower than the 5-minute value and the three figures are read from right to left, newest last

Answer and explanation: On Linux the load average counts tasks that are runnable or in uninterruptible sleep, averaged over 1, 5 and 15 minutes, and has to be compared with the number of CPUs. A steady value of about 8 on eight cores means they are fully used without a long queue. The 'above 1.00 is overloaded' rule only applies to a single CPU. Load average is not a CPU percentage, and the three values are stable here, not a sharp trend.

Question 2 of 10, 201: Linux Kernel

A security baseline requires that once the system has booted, no further kernel modules can be loaded until the next reboot. Which setting does this?

  1. ASet kernel.tainted = 1 in a file under /etc/sysctl.d/, which tells the kernel to reject new module insertions
  2. BDelete /lib/modules/$(uname -r)/modules.dep, so that the kernel refuses every later insmod request
  3. CAdd 'blacklist *' to /etc/modprobe.d/lockdown.conf, which blocks every module that is not yet loaded
  4. DSet kernel.modules_disabled = 1 late in boot, after all required modules are loaded Correct answer

Answer and explanation: kernel.modules_disabled is a one-way switch: once it is set to 1, the kernel refuses all module loading and unloading, and the value cannot go back to 0 until reboot, so it must be set after needed modules are loaded. kernel.tainted reports taint flags and does not control loading. blacklist takes module names, not wildcards, and only affects alias-based autoloading. Without modules.dep modprobe fails, but insmod with a file path still works.

Question 3 of 10, 202: System Startup

A server drops to a 'grub rescue>' prompt after a disk reorganization. /boot/grub is on the second GPT partition of the first disk. Which commands boot it to the normal GRUB menu?

  1. Aroot (hd0,1), kernel /boot/grub/normal.mod, boot, then rerun grub-install from the prompt
  2. Bset prefix=(hd0,gpt2)/boot/grub, set root=(hd0,gpt2), insmod normal, normal Correct answer
  3. Cset root=/dev/sda2, configfile /boot/grub/grub.cfg, insmod normal, boot
  4. Dset prefix=(hd0,1)/boot/grub, set root=(hd0,1), insmod linux, boot

Answer and explanation: At the rescue prompt GRUB has to be told where its modules are (prefix) and which partition to use (root). Loading the normal module and running 'normal' then reads grub.cfg and shows the menu. GRUB 2 numbers partitions from 1, so (hd0,1) is the first partition, and linux/boot without a loaded kernel does nothing. root (hd0,1) and kernel are GRUB Legacy syntax. GRUB device names are not Linux paths such as /dev/sda2, and the minimal rescue shell lacks configfile until normal is loaded.

Question 4 of 10, 203: Filesystem and Devices

A server without a free partition needs 4 GiB of extra swap on its ext4 root filesystem. Which sequence creates and activates a swap file?

  1. Add if=/dev/zero of=/swapfile bs=1M count=4096; chmod 600 /swapfile; mkswap /swapfile; swapon /swapfile Correct answer
  2. Bdd if=/dev/zero of=/swapfile bs=1M count=4096; mkfs.ext4 /swapfile; swapon -a /swapfile
  3. Cmkswap -s 4G /swapfile; chmod 755 /swapfile; mount -t swap /swapfile /swap; then add the mount to /etc/fstab
  4. Dtouch /swapfile; truncate -s 4G /swapfile; swapon /swapfile; mkswap /swapfile; chmod 644 /swapfile

Answer and explanation: The file is fully allocated with dd (fallocate also works on ext4), restricted to root, given a swap signature with mkswap and enabled with swapon. An fstab entry makes it permanent. A sparse file made with truncate has holes and is rejected, and swapon cannot come before mkswap, while mode 644 leaks memory contents. mkswap has no -s size option, and swap is never mounted. An ext4 filesystem inside the file is not a swap area.

Question 5 of 10, 204: Advanced Storage Device Administration

Multipath SAN LUNs show up twice, as /dev/sdc and /dev/sdg, and LVM warns about duplicate physical volumes. Which lvm.conf change makes LVM scan only the multipath devices and the local system disk?

  1. AIn the devices section, set a filter such as [ "r|^/dev/mapper/.*|", "a|.*|" ] so raw paths are preferred
  2. BIn the global section, set use_lvmetad = 0 so that the duplicate PVs found on both paths are merged into a single device
  3. CIn the activation section, set volume_list = [ "/dev/sdc", "/dev/sdg" ] so both paths are activated
  4. DIn the devices section, set a filter such as [ "a|^/dev/mapper/mpath.*|", "a|^/dev/sda[0-9]*$|", "r|.*|" ] Correct answer

Answer and explanation: An LVM filter accepts (a) or rejects (r) device paths by regular expression, and the first match wins. Accepting the multipath maps and the local disk and rejecting everything else stops LVM from seeing the individual SCSI paths. Newer releases also support a devices file. lvmetad was removed from recent LVM versions and never merged duplicates. Rejecting /dev/mapper while accepting all raw paths does the opposite of the requirement. volume_list names VGs or LVs to activate, not devices.

Question 6 of 10, 205: Networking Configuration

A host shows 'From 192.168.4.17 icmp_seq=1 Destination Host Unreachable' when it pings 192.168.4.30, a neighbor on the same subnet. 192.168.4.17 is the host's own address. What does this most likely mean?

  1. AThe target's firewall dropped the echo request and sent back a host-unreachable reply
  2. BARP for 192.168.4.30 got no reply, so the target is down, disconnected or on another VLAN Correct answer
  3. CThe local DNS server could not resolve the name, so ping failed before it sent any packet at all
  4. DA router on the path rejected the packet, because no route to 192.168.4.0/24 exists

Answer and explanation: When the target is on the local subnet and does not answer ARP, the sending host's own kernel reports Destination Host Unreachable from its own address. A remote router would report from its own address, and the subnet is directly connected. A firewall that drops packets causes silent timeouts, and a reject comes from the target's address with a different code. The ping was to an IP address, so no DNS lookup happened.

Question 7 of 10, 207: Domain Name Server

An administrator is enabling DNSSEC for example.org by hand with BIND tools. Which sequence is correct?

  1. AGenerate one TSIG key with tsig-keygen, sign the zone with it using dnssec-signzone, and publish the TSIG secret as a TXT record in the parent zone
  2. BSign the zone with dnssec-signzone, then create the keys with dnssec-keygen, since the keys are derived from the RRSIG records that signing produces
  3. CGenerate a KSK with dnssec-keygen and copy its private key to the parent registrar, which uses it to sign the zone's records for resolvers
  4. DGenerate a ZSK and a KSK with dnssec-keygen, add their DNSKEY records to the zone, sign it with dnssec-signzone, and give the DS record for the KSK to the parent zone Correct answer

Answer and explanation: DNSSEC uses key pairs, usually a zone-signing key and a key-signing key. The DNSKEY records are published, dnssec-signzone creates the RRSIG and NSEC/NSEC3 records, and the DS digest of the KSK in the parent completes the chain of trust. Modern BIND can automate this with dnssec-policy. TSIG secrets protect transfers and are never published. Keys must exist before signing. Private keys never leave the zone operator, and only the DS record goes to the parent.

Question 8 of 10, 208: HTTP Services

A Squid proxy must require users to log in with names and passwords from an htpasswd-style file before it allows any web access from the LAN. Which squid.conf fragment does this?

  1. Aauth_param digest program /usr/lib64/squid/basic_ncsa_auth, http_access allow all, acl authed proxy_auth REQUIRED
  2. Bacl authed src /etc/squid/passwd, then http_access allow authed, http_access deny all, and auth_param basic realm Squid proxy server
  3. Cacl authed proxy_auth REQUIRED, http_access deny authed, http_access allow all, auth_param basic program basic_ncsa_auth /etc/squid/passwd
  4. Dauth_param basic program <path>/basic_ncsa_auth /etc/squid/passwd, acl authed proxy_auth REQUIRED, http_access allow authed, http_access deny all Correct answer

Answer and explanation: auth_param defines the Basic authentication helper (basic_ncsa_auth reads htpasswd files), the proxy_auth REQUIRED ACL matches any authenticated user, and the http_access rules allow those users and deny everyone else. The helper path depends on the distribution. A src ACL needs addresses, not a password file. Putting 'allow all' before the ACL lets everyone through, and a Basic helper does not suit the digest scheme. Denying authenticated users and allowing all reverses the intent.

Question 9 of 10, 210: Network Client Management

In an OpenLDAP 2.4+ server using the dynamic slapd-config (cn=config) backend, how should configuration changes normally be made?

  1. AWith slapadd while slapd is running, since slapadd writes straight into the live cn=config database
  2. BBy editing the LDIF files under /etc/openldap/slapd.d/ directly with a text editor while slapd runs
  3. CWith ldapmodify, using LDIF against the cn=config tree, usually as root via '-Y EXTERNAL -H ldapi:///' Correct answer
  4. DBy editing slapd.conf and running slaptest, which converts the file into cn=config automatically

Answer and explanation: With slapd-config the configuration is stored as LDAP entries (olc* attributes), so it is changed online through LDAP operations such as ldapmodify, often over the ldapi socket with SASL EXTERNAL as root. The files in slapd.d/ have checksums and must not be edited by hand. slapd.conf is the legacy static format, and slaptest -F can convert it, but that is a migration step, not the normal method. slapadd must not run against a database while slapd is using it.

Question 10 of 10, 212: System Security

An administrator wants to create a modern Ed25519 key pair for SSH logins and install the public key in the authorized_keys file of the account deploy on web01. Which commands do this?

  1. Assh-agent -t ed25519, then ssh-copy-id -i /etc/ssh/ssh_host_ed25519_key deploy@web01
  2. Bssh-keyscan -t ed25519 web01, then ssh-add deploy@web01
  3. Cssh-keygen -t dsa -b 512, then scp ~/.ssh/id_dsa deploy@web01:
  4. Dssh-keygen -t ed25519, then ssh-copy-id deploy@web01 Correct answer

Answer and explanation: ssh-keygen -t ed25519 creates ~/.ssh/id_ed25519 and its .pub file, and ssh-copy-id appends the public key to the remote ~/.ssh/authorized_keys with suitable permissions. DSA keys are obsolete and disabled in current OpenSSH, and copying a private key to the server is wrong. ssh-keyscan collects remote host keys, and ssh-add loads keys into an agent. ssh-agent -t sets a key lifetime, and the host's private key must never be used as a user key.