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

Free Linux Foundation Certified System Administrator LFCS Exam Questions

Last updated: · 12 practice questions with answers and explanations

Page: 1 / 18 Total 260 questions

Want more questions? Get Premium Access.

Question 1

New Single answer

Topic: Essential Commands

Skill tested: Diagnoses service failures using systemd status and journal logs.

A payment application is managed by the systemd unit `ledger-api.service`. After a configuration deployment, the service repeatedly exits with a nonzero status. The unit is enabled and the host has ample disk space and memory. The operations team needs the first diagnostic action that identifies the failure recorded by systemd without changing the service state or discarding evidence. What should the administrator do?

Correct Answer: C. Run `journalctl -u ledger-api.service -b` and inspect the unit's current-boot messages.
Explanation:

`journalctl -u ledger-api.service -b` filters the systemd journal to messages for this unit from the current boot, providing the relevant error context without altering the service. Restarting may change the state and obscure a transient failure; disabling and enabling affects startup configuration but does not diagnose the cause. `systemctl reset-failed` clears the failed-state indication and failure counters, which is inappropriate before evidence has been collected.

Question 2

New Single answer

Topic: Essential Commands

Skill tested: Identifies application-specific resource limits imposed by systemd unit configuration.

A data-processing service runs under systemd on a host with 64 GiB of RAM. Its process is terminated when its resident memory approaches 2 GiB, while other workloads remain healthy. The application has no internal memory cap configured, and the service unit may include resource controls or overrides. The administrator must determine whether systemd imposes the limit before changing application settings. Which investigation is most appropriate?

Correct Answer: D. Inspect the unit and its effective configuration with `systemctl cat` and `systemctl show`, focusing on memory controls such as `MemoryMax`.
Explanation:

Systemd unit properties and drop-in overrides can impose per-service resource constraints. `systemctl cat` reveals the unit and its drop-ins, while `systemctl show` reports effective properties; memory controls such as `MemoryMax` should be checked against the observed limit. `LimitNOFILE` controls open file descriptors, not memory. Free host memory does not rule out a cgroup-level cap. `OOMScoreAdjust` influences OOM-killer preference; it does not remove memory limits.

Question 3

New Multiple answers

Topic: Essential Commands

Skill tested: Uses Git status, staging, and commit operations to preserve a focused configuration change.

A systems engineer maintains a repository containing production service configuration and deployment scripts. A completed change modifies `conf/api.conf`, while an unrelated diagnostic script in the working tree is still being developed and must not enter the production commit. The repository already has a remote and the engineer is on the correct branch. Which TWO actions create a commit containing only the completed configuration change? Select TWO.

Correct Answer: C. Run `git add conf/api.conf` to stage only the intended file.; D. Review `git status`, then commit the staged change with a descriptive message.
Explanation:

Explicitly staging `conf/api.conf` leaves the unrelated diagnostic script unstaged. Reviewing `git status` verifies the staged set before committing it with a descriptive message. `git add -A` risks including the unrelated work. `git commit -am` automatically stages modifications and deletions of tracked files, not only the named configuration file, so it can include the diagnostic script if tracked. `git reset --hard` would destroy uncommitted work rather than preserve it.

Question 4

New Multiple answers

Topic: Users and Groups

Skill tested: Applies named-user ACL permissions and verifies access-control entries.

A finance team needs a service account named `reporter` to read and traverse `/srv/finance/archive`, but not modify its contents. The directory is owned by another group, and changing its group ownership would disrupt existing access. The system uses a filesystem that supports POSIX ACLs. The administrator also wants newly created files and subdirectories in this directory tree to grant `reporter` the same read-and-traverse access by default. Which TWO actions meet the requirements? Select TWO.

Correct Answer: B. Set a default ACL for `reporter` with read and execute permissions on the directory.; D. Apply an access ACL for `reporter` with read and execute permissions on the existing directory tree.
Explanation:

An access ACL grants the named account read and execute permissions on existing objects; execute on a directory permits traversal, while omitting write prevents modifications. A default ACL on the directory supplies inherited access entries for newly created children, subject to normal creation-mode and ACL rules. Changing ownership or broadening group permissions alters existing access policy. World-writable permissions are unnecessarily permissive and do not meet the least-privilege requirement.

Question 5

New Single answer

Topic: Users and Groups

Skill tested: Configures persistent per-user resource limits through PAM limits configuration.

A multi-user analytics server must prevent a local account named `batchrun` from opening more than 4,096 files per process after login. The limit must apply consistently to sessions that use PAM, survive reboot, and leave other accounts unaffected. The administrator confirms that the shell and workload do not override limits themselves. Which configuration approach is most appropriate?

Correct Answer: D. Add a user-specific `nofile` soft and hard limit for `batchrun` in `/etc/security/limits.conf` or a file under `/etc/security/limits.d/`.
Explanation:

PAM limits configuration supports per-user resource limits for PAM-managed login sessions. A `nofile` entry for `batchrun` can set the requested soft and hard limit without affecting other accounts; the PAM limits module must be enabled in the applicable session stack. `fs.file-max` is a system-wide kernel limit, not an account-specific per-process limit. A shell-local `ulimit` is not persistent or broadly applied, and a global systemd limit would affect more workloads than required.

Question 6

New Single answer

Topic: Networking

Skill tested: Diagnoses name-resolution failures by distinguishing DNS resolution from IP connectivity.

A Linux application server can reach a partner service by its known IPv4 address, and the default route and interface configuration appear correct. Connections using the partner's fully qualified domain name fail, while unrelated local processes can still access the network. The application is configured to use the system resolver and has no private DNS cache. Before changing routes or firewall rules, the administrator needs to isolate whether name resolution is the fault. What is the best next step?

Correct Answer: D. Use `getent hosts` or an equivalent system-resolver lookup for the partner name, then inspect the configured resolver sources if it fails.
Explanation:

A system-resolver lookup such as `getent hosts partner.example` tests name resolution through the same resolver path applications commonly use. If it fails while direct IP access works, inspect resolver configuration and the DNS response path before altering routing or filtering. A host route does not make a name resolve. ARP and NDP map local-link addresses, not names. Direct IP success does not prove that the firewall blocks DNS, so disabling it is not a justified diagnostic step.

Question 7

New Single answer

Topic: Networking

Skill tested: Configures OpenSSH public-key authentication while disabling password-based remote login.

A company requires administrators to connect to Linux servers using individual SSH keys. Password-based SSH login must be disabled to reduce exposure to password guessing, while local console access remains available for recovery. Administrators have already installed their public keys in the appropriate accounts' `authorized_keys` files and have verified key login. Which server configuration and validation sequence is most appropriate?

Correct Answer: C. Set `PasswordAuthentication no`, validate the SSH daemon configuration with `sshd -t`, then reload or restart the daemon.
Explanation:

Disabling `PasswordAuthentication` prevents SSH password authentication while leaving public-key authentication available when configured and permitted. Testing the daemon configuration with `sshd -t` before applying it catches syntax errors that could disrupt remote access; the daemon can then be reloaded or restarted according to the system's service management. Enabling root login or disabling public keys contradicts the requirement. Changing the port does not disable password authentication.

Question 8

New Multiple answers

Topic: Networking

Skill tested: Builds persistent packet-filter rules for forwarding and source NAT of a private subnet.

A gateway routes traffic from a private IPv4 subnet `10.40.0.0/24` to an external network through interface `wan0`. IP forwarding is enabled, and the upstream network routes only the gateway's external address; it has no route for the private subnet. The gateway uses nftables, and the administrator must allow outbound connections from this subnet with return traffic while preventing unsolicited external connections. Which TWO configuration actions are needed? Select TWO.

Correct Answer: B. Add a forward-chain rule that permits traffic from `10.40.0.0/24` out `wan0` and permits established/related return traffic.; C. Add a postrouting source-NAT or masquerade rule for packets from `10.40.0.0/24` leaving `wan0`.
Explanation:

Forward-chain filtering must permit the intended outbound flows and the corresponding established or related return traffic, while leaving unsolicited new inbound forwarding disallowed. Because the upstream has no route to `10.40.0.0/24`, source NAT or masquerading on egress gives remote systems a reachable source address and enables replies to return through the gateway. Destination NAT is for inbound destination translation and is not required. Accepting all traffic removes the security boundary, and disabling forwarding prevents routed transit rather than enabling NAT.

Question 9

New Multiple answers

Topic: Operations Deployment

Skill tested: Schedules recurring commands with systemd timers and verifies timer execution status.

A production host must run `/usr/local/sbin/rotate-report-cache` every day at 02:15. The job should be managed by systemd, have execution and failure records in the journal, and be enabled across reboot. The administrator does not want a continuously running daemon or a user-specific cron entry. Which TWO actions provide the required implementation? Select TWO.

Correct Answer: A. Create a system service unit whose `ExecStart` runs the script, and a matching timer unit with an appropriate daily calendar expression.; D. Enable the timer unit so systemd activates it at boot and schedules the service according to its calendar.
Explanation:

A systemd service unit defines the command execution, and a corresponding timer unit with an `OnCalendar` schedule triggers that service. Enabling the timer makes it start as part of the normal boot target, while service output and status are available through systemd and the journal. Enabling the service itself does not create a daily schedule. `/etc/profile` runs commands in login contexts, not at a fixed time. Starting a timer without enabling it does not make it persistent across reboot.

Question 10

New Single answer

Topic: Operations Deployment

Skill tested: Restores SELinux enforcement by diagnosing denials and correcting file context labels.

After a web application deployment, the service cannot read a newly installed content directory. Unix ownership and mode bits match the previous working directory, and the service is running under its expected SELinux domain. The host is in enforcing mode. Audit records show SELinux denials for reads of the new path, whose labels differ from those on the existing content tree. The organization prohibits disabling SELinux and requires a policy-consistent repair. What should the administrator do first?

Correct Answer: A. Use `restorecon` on the new path after confirming the expected file-context mapping, then retest the service.
Explanation:

The evidence points to incorrect SELinux labels rather than Unix mode bits. After confirming the path's intended context mapping, `restorecon` applies the policy-defined labels, allowing the service to access content according to established policy. Disabling enforcement violates the stated control and hides the underlying issue. Broader Unix permissions do not override SELinux mandatory access controls. Automatically approving all audit denials can create excessive policy and should not replace diagnosis of a labeling error.

Question 11

New Single answer

Topic: Operations Deployment

Skill tested: Installs and validates a package using the configured distribution package manager and repository metadata.

A Linux administrator must install a security utility on a maintained server. The utility is available in an already configured, trusted distribution repository, and the host's package manager is the supported mechanism for managing software. The team needs dependency resolution, a recorded package transaction, and a way to verify the installed package version. Building from source is not permitted because it would bypass the organization's package inventory. Which approach best meets the requirements?

Correct Answer: D. Use the configured package manager to install the named package, then query the package database to verify its installed version.
Explanation:

Installing from the configured trusted repository through the system package manager resolves dependencies and records the transaction in the host's package database. Querying that database verifies what version is installed and preserves the inventory workflow. An arbitrary archive or copied executable bypasses repository trust and package tracking. Compiling and using `make install` also bypasses the required package-management record, even if the resulting program works.

Question 12

New Multiple answers

Topic: Storage

Skill tested: Extends an LVM logical volume and its filesystem while preserving existing data.

A database server stores data on an ext4 filesystem mounted at `/db`, backed by an LVM logical volume. The volume group has sufficient unallocated extents, and an approved backup is current. The application is online, and the filesystem and LVM tools support online growth. The administrator must add 20 GiB of capacity without recreating the filesystem or changing the mount point. Which TWO actions, performed in the correct dependency order, satisfy the requirement? Select TWO.

Correct Answer: A. Grow the ext4 filesystem on the logical volume, for example with `resize2fs` after the LV extension.; D. Extend the logical volume by 20 GiB, for example with `lvextend -L +20G` on the correct LV.
Explanation:

LVM must first expose the additional extents by extending the logical volume. The ext4 filesystem must then be grown to use the larger block device; online growth is supported when the filesystem is mounted and the tools permit it. Formatting with `mkfs` would destroy existing data. Reducing the LV moves in the wrong direction and can cause data loss. An `/etc/fstab` entry controls mounting, not the size of an LV or filesystem.