Limited-Time Offer: Enjoy 50% Savings! Coupon code: 50OFF Use it at checkout
Skip to content

Free LPI LPIC-1 System Administrator Exam 102, Part 2 of 2, (version 5.0) 102-500 Exam Questions

Last updated: · 10 practice questions with answers and explanations

Page: 1 / 16 Total 234 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Topic 105: Shells and Shell Scripting

Skill tested: Configures Bash login and interactive-shell startup files to set user-specific environment variables.

A support team needs a user-specific tool directory added to PATH for both graphical logins and interactive Bash shells. The user's login shell is Bash, and the directory must appear only once in PATH even when nested interactive shells are started. The organization does not permit changing global startup files, and non-interactive scripts should not inherit unrelated interactive configuration. Which approach best meets these requirements?

Correct Answer: C. Put a guarded PATH update in ~/.profile, and have ~/.bashrc source ~/.profile only when Bash is interactive and the shell is not a login shell.
Explanation:

A login Bash shell reads an appropriate login profile, while interactive non-login Bash shells read ~/.bashrc. A guarded update in ~/.profile establishes the path for login sessions; sourcing that profile from interactive non-login shells provides the same setting there. Checking whether the directory is already present prevents duplicate entries. A sources interactive configuration from scripts, B duplicates the update in two files, and D changes global configuration despite the restriction and does not properly configure PATH.

Question 2

New Single answer

Topic: Topic 106: User Interfaces and Desktops

Skill tested: Diagnoses X11 authorization and DISPLAY settings for an application running on a remote host.

A Linux workstation user connects to a remote server over SSH and starts a graphical administration utility. The utility reports that it cannot open the display. The user must run the application on the server but display its window on the workstation; granting access to every local client is prohibited, and administrators do not want to manually copy X authorization cookies. Which action is the most appropriate first step, assuming the SSH client and server support the required feature?

Correct Answer: C. Enable SSH X11 forwarding on the connection and confirm that the remote DISPLAY value was set by SSH.
Explanation:

SSH X11 forwarding configures the remote DISPLAY and uses SSH-managed X authorization, allowing the application to use the workstation's X server without broadly opening access. Setting DISPLAY manually does not provide authorization, and `xhost +` weakens access control. Copying an authority file is unnecessary and may expose credentials; `:0` usually refers to a display local to the remote host. A display manager or Wayland session does not address this SSH forwarding scenario.

Question 3

New Single answer

Topic: Topic 107: Administrative Tasks

Skill tested: Schedules recurring administrative commands with a correctly configured per-user cron entry.

A small server runs a daily report as a dedicated service account. The report must execute at 02:15 every day, including after reboots, and its output should be retained for later review. The script works when run interactively, but it currently relies on the account's interactive PATH and current working directory. The administrator wants the smallest reliable change using standard cron facilities, without installing a separate scheduler. What is the best implementation?

Correct Answer: B. Add a crontab entry that invokes the script by absolute path, sets required environment values or uses absolute command paths, and redirects output to a log.
Explanation:

A per-user crontab provides recurring execution and survives reboots because cron evaluates the schedule continuously. Cron jobs have a limited environment, so absolute paths and explicit required environment settings avoid dependence on an interactive shell or working directory; redirection retains output. `at` schedules a one-time job, ~/.bashrc runs for interactive shell startup rather than a daily schedule, and files in /etc/cron.d require a user field in each entry.

Question 4

New Multiple answers

Topic: Topic 108: Essential System Services

Skill tested: Configures rsyslog to forward selected facility and severity messages to a central log host.

A company is centralizing logs from several Linux servers. One server must continue writing its normal local logs while also forwarding all authentication facility messages at notice severity and higher to `loghub.example.net`. The central host accepts traditional syslog over UDP on port 514, and no TLS configuration is available in this environment. Which two rsyslog configuration actions satisfy the request? Select TWO.

Correct Answer: A. Add a selector such as `authpriv.notice @loghub.example.net` to the rsyslog configuration.; E. Use a single `@` before the destination to select UDP forwarding to the remote syslog host.
Explanation:

Rsyslog selectors combine a facility and minimum severity, so `authpriv.notice` selects notice and more severe messages from that facility. A single `@` indicates UDP forwarding; `@@` selects TCP. Adding the forwarding rule does not inherently replace local rules, so local logging can continue. Replacing all local rules would violate the requirement, and disabling them is unnecessary.

Question 5

New Single answer

Topic: Topic 109: Networking Fundamentals

Skill tested: Calculates IPv4 subnet boundaries and usable host capacity from CIDR notation.

A network team assigns a small isolated IPv4 subnet to a group of lab machines. The allocation is 192.0.2.64/27, and the team must reserve the subnet's network and broadcast addresses rather than assign them to hosts. The addresses come from the documentation-only TEST-NET-1 range, so public routability is not a concern for this exercise. What is the largest number of ordinary host addresses available within the subnet?

Correct Answer: A. 30
Explanation:

A /27 leaves five host bits, giving 2^5 = 32 total addresses. Under ordinary IPv4 subnetting, the network and broadcast addresses are reserved, leaving 30 assignable host addresses. A /28 would provide 14 usable addresses, 32 incorrectly counts the reserved addresses as hosts, and 62 corresponds to a /26. The documentation address range does not change the subnet arithmetic.

Question 6

New Single answer

Topic: Topic 109: Networking Fundamentals

Skill tested: Selects appropriate persistent IPv4 settings and verifies connectivity using standard network tools.

A workstation currently receives its IPv4 address and DNS servers through DHCP. Its network interface must retain this behavior after reboot, while the administrator needs to diagnose why it cannot reach an external IP address. This machine uses NetworkManager, and no distribution-specific legacy network scripts are installed. The administrator wants to make the smallest persistent change before testing whether the gateway is the fault. Which choice is best?

Correct Answer: D. Change the NetworkManager connection's IPv4 method to automatic, activate the connection, and test the gateway with `ping`.
Explanation:

NetworkManager's automatic IPv4 method uses DHCP and can be stored in the connection profile for use after reboot. Once active, testing the gateway with `ping` helps determine whether local routing connectivity exists. `/etc/hosts` maps names to addresses but does not configure an interface, and `ifconfig` changes are not a reliable persistent configuration here. DNS configuration cannot specify a network gateway, and `host` tests name resolution rather than IP reachability.

Question 7

New Multiple answers

Topic: Topic 110: Security

Skill tested: Audits SUID and SGID files and applies least-privilege controls to administrative access.

During a host security review, an administrator must identify files with SUID or SGID bits on local filesystems and ensure that a support account can restart one approved service without receiving unrestricted root access. The account must not be able to edit the sudo policy itself. Which two actions best satisfy these requirements? Select TWO.

Correct Answer: B. Add a narrowly scoped sudoers rule permitting the specific service-control command, then validate the policy with `visudo`.; E. Use `find` with the appropriate permission predicates and filesystem boundaries to inventory SUID and SGID files.
Explanation:

A filesystem search using SUID and SGID permission tests inventories privileged executables; limiting the search to relevant local filesystems avoids unintended traversal into mounted filesystems. A least-privilege sudoers entry can authorize only the needed service command, and `visudo` checks syntax before saving. Unrestricted sudo violates the stated access boundary. A nologin shell prevents ordinary interactive access rather than granting a useful restricted command, while blindly removing special bits may break legitimate programs.

Question 8

New Single answer

Topic: Topic 108: Essential System Services

Skill tested: Uses system time tools to set the system timezone and maintain synchronized clock operation.

A server was installed in UTC and is correctly synchronized with an NTP source. A monitoring application, however, requires the system's configured local timezone to be Europe/Paris and expects the change to persist across reboot. The operations team must not manually shift the clock or disable synchronization. Which action is most appropriate?

Correct Answer: B. Set the system timezone to Europe/Paris with `timedatectl` while leaving time synchronization enabled.
Explanation:

The timezone setting controls how the system presents and interprets local time; it does not require manually changing the underlying synchronized clock. `timedatectl` can set the persistent timezone while synchronization remains enabled. Manually shifting the clock creates incorrect time, and NTP sources provide time references rather than a per-host timezone. Switching the hardware clock to local time and disabling synchronization sacrifices reliable timekeeping and is unnecessary.

Question 9

New Single answer

Topic: Topic 107: Administrative Tasks

Skill tested: Manages account expiration and password aging with chage and verifies account data.

A contractor's account must remain usable through the end of the month, then become unavailable without deleting its files or changing its password. The account should also be checked to confirm the configured expiration date. The administrator wants a reversible account-level change and must distinguish account expiration from password aging. Which approach is best?

Correct Answer: D. Set the account expiration date with `chage`, then inspect the account aging information with `chage -l`.
Explanation:

`chage` manages account aging information, including the account expiration date; `chage -l` displays the resulting settings for verification. Expiration disables account use after the specified date without removing its files. Password maximum age controls when a password must be changed, not when the account itself expires. Deleting the user is destructive, while locking a password has no scheduled expiration date and may not block every authentication method.

Question 10

New Multiple answers

Topic: Topic 105: Shells and Shell Scripting

Skill tested: Applies Bash conditional tests and positional parameters to validate script input safely.

An operations script accepts one pathname and must exit with a usage message unless exactly one argument is supplied and that argument names an existing regular file. It must behave predictably when the pathname contains spaces or begins with a hyphen. The script runs under Bash, and the team wants to avoid external utilities for this validation. Which two implementation practices are appropriate? Select TWO.

Correct Answer: D. Check that `$#` equals one before attempting to validate the pathname.; E. Use a quoted reference such as `[[ -f "$1" ]]` to test for an existing regular file.
Explanation:

`$#` reports the number of positional parameters, so checking it first enforces the one-argument interface. Quoting `$1` prevents word splitting and pathname expansion, and `[[ -f "$1" ]]` performs Bash's regular-file test without an external command; a leading hyphen is not interpreted as an option by this conditional test. Unquoted expansion is unsafe for spaces, `eval` introduces code-execution risks, and `-d` checks for a directory rather than a regular file.