Curated

Services and User Management

0 votes

All cards133

  1. In a crontab entry, the schedule */15 * * * * runs the job every ___ minutes.

    15

  2. What term describes a state where two packages cannot be installed together because they provide the same files or capability?

    A package conflict. Package managers like dnf and apt refuse the transaction, and you must remove or replace one of the packages, for example with dnf swap.

  3. Which dnf command removes a package along with dependencies no longer needed by other packages?

    dnf remove <package>. With the default clean_requirements_on_remove=True, it also drops dependencies that were installed only for that package. dnf autoremove separately cleans up other unneeded leftovers. On apt systems, apt remove keeps them until you run apt autoremove.

  4. The rpm --checksig command verifies a package file's signature by comparing it against the vendor's private key stored in the local RPM database.

    Signature verification uses the vendor's public key, which is imported into the RPM database (for example with rpm --import). The private key stays with the vendor, who uses it to sign packages. Using a private key to verify would defeat the trust model.

  5. Which command stops apt from upgrading an installed package until the hold is removed?

    apt-mark hold flags the package so apt skips it during upgrades. unhold does the opposite by releasing the hold, and manual only changes the install-reason flag.

  6. Which update-alternatives option interactively selects the active alternative for a command?

    The --config option lists registered alternatives for a name and prompts you to choose one. The --install option only registers a new alternative, and --query only displays information.

  7. After editing /etc/ssh/sshd_config, running sshd ___ checks the file for syntax errors without restarting the service.

    -t

  8. In Snap, the term for the isolation level that restricts a packaged application's access to the host system's files and resources is ___.

    confinement

  9. Which file does the ISC DHCP server read to define subnets, address ranges and lease options?

    dhcpd.conf holds the subnet, range and option declarations for the ISC DHCP server. dhclient.conf configures the DHCP client, not the server.

  10. Which systemd unit type groups other units to represent a system state, such as multi-user.target?

    A .target unit groups units and acts as a synchronization point or system state. A .slice unit organizes processes in a cgroup hierarchy for resource control, not for system states.

  11. The systemd-analyze blame command lists running units ordered by the time each took to initialize during boot, with the slowest units shown first.

    systemd-analyze blame prints the initialization time of each unit, sorted from longest to shortest, which helps find services that slow boot. It does not show unit dependencies; systemd-analyze critical-chain does that, tracing the chain of units that delayed boot completion.

  12. Running systemctl daemon-reload after editing a unit file restarts every service whose unit file was changed so that the new settings take effect.

    daemon-reload only makes systemd re-read unit files and regenerate its dependency tree; it does not restart any running service. A changed service must still be restarted, for example with systemctl restart, before the new settings apply to the running process.

  13. Which tool is the low-level OCI-compliant runtime that actually creates and runs containers?

    runC is the reference OCI runtime that spawns containers from a bundle and a config. containerd is a higher-level runtime that manages images and container lifecycle, and it calls runC to do the work.

  14. Which command downloads an image from a registry without starting a container?

    docker pull (or podman pull) downloads the image to local storage. Add a tag, such as nginx:1.25, to fetch a specific version instead of the default latest.

  15. Dockerfile instruction that sets the default command arguments, which can be overridden at docker run

    CMD. It supplies defaults that arguments given after the image name replace, whereas ENTRYPOINT defines the fixed executable and is only replaced with --entrypoint.

  16. The -e option of the docker run command sets an environment variable inside the container only after the container has been started with docker exec.

    The -e option of docker run sets environment variables at container creation, so they are available to the main process from the start. It is not tied to docker exec, although docker exec also accepts -e for the command it launches.

  17. When a bind-mounted host directory is mounted with the :Z suffix in Podman, the directory is relabeled with a shared content label that lets multiple containers read and write it.

    The :Z suffix applies a private, unshared label with the container's unique MCS categories, so only that container can access the content. The lowercase :z suffix applies the shared label that lets multiple containers use the directory.

  18. A container attached to the host network driver receives its own isolated network namespace and a private IP address from the engine's default bridge subnet.

    With the host driver, the container shares the host's network namespace and uses the host's interfaces and IP address directly, with no isolation. A private address from a bridge subnet is what the bridge driver provides, so the two are easy to confuse.

  19. Docker starts a container with all Linux capabilities and access to host devices, removing most isolation, when it is run with the ___ flag.

    --privileged

  20. Which utility searches a prebuilt database of file paths instead of walking the filesystem?

    locate. Its results can be stale until the database is refreshed with updatedb, while find reads the live filesystem.

  21. Which command removes an empty directory but refuses to delete one containing files?

    rmdir. It fails with "Directory not empty" if any contents remain, whereas rm -r removes a directory and everything inside it.

  22. A hard link and the original filename both point to the same ___ number, so the file data remains available until every name is removed.

    inode

  23. To create a system group whose GID comes from the system range, run groupadd with the ___ option.

    -r

  24. The groupdel command refuses to remove a group while it is still the ___ group of any existing user account.

    primary

  25. A regular user changes their own login shell to one listed in /etc/shells by running the ___ command.

    chsh

  26. Running chage -E ___ username disables the account immediately by setting its expiration date to the epoch, January 1, 1970.

    0

  27. The ___ directive in /etc/login.defs sets the default number of days before password expiration that a user starts receiving warnings.

    PASS_WARN_AGE

  28. Which command reports per-process CPU usage at repeating intervals, such as every 2 seconds?

    pidstat 2 prints CPU usage for each process at the given interval. mpstat also samples at intervals, but it reports per-processor statistics, not per-process.

  29. A shell with PID 2048 starts the command sleep 300 directly, so the sleep process shows a PPID of ___.

    2048

  30. A process suspended by pressing Ctrl+Z in the terminal shows the ps STAT code ___.

    T

  31. When nice is run with no -n option, it raises the niceness of the launched command by ___ from the inherited value.

    10

  32. Running kill -9 followed by a process ID sends SIGTERM, which the process can catch to perform cleanup before exiting.

    Signal 9 is SIGKILL, which cannot be caught, blocked or ignored, so the process gets no chance to clean up. SIGTERM is signal 15 and is the default sent by kill; it is the signal a process can handle gracefully.

  33. When building software from a source tarball with the standard autotools workflow, running ./configure checks the system for required libraries and tools and generates the Makefile that make then uses to compile the code.

    The configure script detects dependencies and build settings and produces the Makefile; make compiles and make install copies the results into place. Running make install before configure fails because no Makefile exists yet.

  34. The command npm install -g typescript installs the package into the current project's node_modules directory and records it in that project's package.json file.

    The -g flag installs the package globally, in a system-wide or user-level prefix, not in the project's node_modules directory. Running npm install typescript without -g installs it locally and records it in package.json.

  35. Which dnf option temporarily enables a disabled repository for a single transaction without editing its .repo file?

    The --enablerepo=repo_id option turns on the named repository for that one dnf command only, and the .repo file stays unchanged. --nogpgcheck only skips signature verification and does not enable any repository.

  36. Setting enabled=___ in a repository's .repo file makes dnf skip that repository during updates unless it is enabled on the command line.

    0

  37. To return a link group to automatic mode so the highest-priority alternative is used again, run update-alternatives with the ___ option.

    --auto

  38. Which command clears the DNS cache maintained by systemd-resolved?

    resolvectl flush-caches empties all of systemd-resolved's cached DNS records. resolvectl statistics only displays cache and transaction counters without clearing the cache.

  39. Which systemctl command enables a service at boot and starts it immediately in one step?

    The --now option makes enable also start the unit right away. --runtime only makes the enablement temporary (cleared at reboot) and does not start the unit.

  40. Docker Engine relies on the high-level runtime daemon named ___ to pull images and manage container lifecycles, and that daemon in turn calls runC to create the containers.

    containerd

  41. Running docker image prune without any options removes only dangling images, meaning untagged images that are not referenced by another image.

    By default, docker image prune deletes only dangling images, which have no tag and are not used as a parent layer by a tagged image. Tagged images that no container uses are removed only when the -a option is added, so a tagged image is not deleted by the plain command.

  42. Which command returns low-level JSON details, such as mounts and network settings, for a container named web?

    docker inspect prints the full JSON configuration and state of a container, including mounts, environment variables and networks. docker top only lists the processes running inside it.

  43. Which command creates a new named Podman volume called dbdata?

    The volume subcommand with create makes a named volume, as in podman volume create dbdata. The podman create command builds a container, not a volume, and volume mount only mounts an existing volume on the host.

  44. Which command creates a user-defined bridge network named appnet?

    docker network create makes a new network, and bridge is its default driver. connect only attaches an existing container to an existing network.

  45. The sdiff command displays two files side by side in columns and marks each differing line with a symbol such as < , > or | between the columns.

    sdiff produces a side-by-side comparison, using < for lines only in the first file, > for lines only in the second, and | for lines that differ. Plain diff instead prints a sequential list of changes (such as 3c3) and does not show the files in columns.

  46. The stat command identifies a file's type by examining its contents and matching them against magic patterns, such as reporting that a file is an ELF 64-bit executable.

    Identifying a file's type from its contents and magic patterns is the job of the file command. The stat command displays inode metadata such as size, permissions, ownership, link count, inode number and the access, modify and change timestamps.

  47. To make strace write its output to a file named trace.log instead of the terminal, add the ___ option followed by the file name.

    -o

  48. Which signal does nohup make a command ignore so it survives terminal closure?

    nohup makes the command ignore SIGHUP, which the shell sends when the terminal closes. SIGTERM is not ignored, and SIGKILL cannot be ignored by any process.

  49. Which command resumes a suspended job in the background?

    bg resumes a stopped job in the background so it keeps running while the shell stays usable. fg also resumes a stopped job, but it brings it to the foreground.

  50. Which command on Debian-based systems repairs broken dependencies by fetching and installing missing packages?

    apt install -f (--fix-broken) installs missing dependencies and corrects a broken package state. dpkg --configure -a only finishes configuring already-unpacked packages and fetches nothing.