CompTIA Linux+ (XK0-006) practice questions

208 free questions with answers and explanations.

Practice test
  1. 201.A system administrator is auditing user accounts and finds that the default `umask` for a new service user `svcuser` is `0002`. If `svcuser` creates a new directory named `appdata`, what will be the octal permissions of this directory?Services and User Management
  2. 202.A system administrator is setting up a new service account on a Linux system that should only be able to perform specific, non-interactive tasks via cron jobs or other automated processes. The account should not have a password and should not be able to log in interactively. Which of the following `useradd` commands correctly creates such an account named `appsvc`?Services and User Management
  3. 203.A system administrator wants to define a custom `systemd` timer unit named `mytimer.timer` that executes a script `myscript.sh` daily at 2:00 AM. The timer should be persistent across reboots and start automatically. Which of the following `[Timer]` section configurations would correctly achieve this?Services and User Management
  4. 204.A system administrator needs to grant a specific user, `devuser`, read and write access to a directory `/data/shared_configs` that is owned by `root` and has default permissions `rwxr-x---` (750). The administrator wants to achieve this without changing the ownership or the existing group permissions for `developers`. Which command correctly uses Access Control Lists (ACLs) to grant `devuser` the necessary permissions?Services and User Management
  5. 205.A DevOps engineer is implementing a Continuous Integration/Continuous Delivery (CI/CD) pipeline for a new microservice. They need to ensure that after a successful build and passing unit tests, the Docker image for the microservice is pushed to a private Docker registry. Which stage in a typical CI/CD pipeline would this action most appropriately belong to?Automation, Orchestration and Scripting
  6. 206.A developer is writing a Python script that needs to parse a JSON string received from a web API. The JSON string contains user data, including a list of phone numbers. They need to convert this JSON string into a Python dictionary to easily access the data. Which Python module and function should be used for this purpose?Automation, Orchestration and Scripting
  7. 207.A system administrator is troubleshooting a `systemd` service unit that consistently fails to start with an 'exit-code' error. They suspect a problem with the service's environment or dependencies. Which `journalctl` command would be most effective for viewing the logs specifically for this service, including any output during its startup attempt, and filtering for recent entries?Services and User Management
  8. 208.A security auditor is reviewing the `/etc/shadow` file on a critical server to ensure password security policies are being enforced. They encounter the following entry for a user `auditor`: `auditor:$6$salt$hashedpassword:19782:0:90:7:::`. What does the third field (`90`) indicate for the `auditor` user?Services and User Management