> ## Documentation Index
> Fetch the complete documentation index at: https://linux-plus.ipoint-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Domain 2 Review Quiz

> 22 practice questions for Domain 2. Administering Users and Groups.

22 practice questions covering **Administering Users and Groups**. Read the question, take answers from the room, then reveal.

<div className="quiz" data-total="22">
  <div className="quiz__q" data-n="1" data-answer="D">
    <p className="quiz__stem">
      { "A systems administrator is preparing a Linux system for application setup. The administrator needs to create an environment variable with a persistent value in one of the user accounts. Which of the following commands should the administrator use for this task?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "export \"VAR=$VAR:value\" \u003e\u003e ~/.ssh/profile" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "export VAR=value" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "VAR=value" }</span></li>
      <li className="quiz__choice" data-letter="D" data-correct="1"><span className="quiz__letter">D</span><span className="quiz__text">{ "echo \"export VAR=value\" \u003e\u003e ~/.bashrc" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: D</p>

      <p className="quiz__why">
        { "Adding export VAR=value to ~/.bashrc ensures the environment variable is set persistently for the user. The variable will load automatically in every new shell session." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="2" data-answer="C">
    <p className="quiz__stem">
      { "A Linux user frequently tests shell scripts located in the /home/user/scripts directory. Which of the following commands allows the user to run the program by invoking only the script name?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "export SHELL=$SHELL=/home/user/scripts" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "export TERM=$TERM=/home/user/scripts" }</span></li>
      <li className="quiz__choice" data-letter="C" data-correct="1"><span className="quiz__letter">C</span><span className="quiz__text">{ "export PATH=$PATH:/home/user/scripts" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "export alias /home/user/scripts='/bin'" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: C</p>

      <p className="quiz__why">
        { "By appending /home/user/scripts to the PATH environment variable, the user can execute scripts from that directory by simply typing the script name without specifying the full path." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="3" data-answer="B">
    <p className="quiz__stem">
      { "Which of the following is the main reason for setting up password expiry policies?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "To avoid using the same passwords repeatedly" }</span></li>
      <li className="quiz__choice" data-letter="B" data-correct="1"><span className="quiz__letter">B</span><span className="quiz__text">{ "To mitigate the use of exposed passwords" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "To force usage of passwordless authentication" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "To increase password strength and complexity" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: B</p>

      <p className="quiz__why">
        { "Password expiry policies ensure that even if a password has been compromised, its period of validity is limited, reducing the risk of long-term unauthorized access." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="4" data-answer="DF">
    <p className="quiz__stem">
      { "An administrator must secure an account for a user who is going on extended leave. Which of the following steps should the administrator take? (Choose two)." }
    </p>

    <p className="quiz__hint">Choose two.</p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "Set the user’s files to immutable." }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "Instruct the user to log in once per week." }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "Delete the user’s /home folder." }</span></li>
      <li className="quiz__choice" data-letter="D" data-correct="1"><span className="quiz__letter">D</span><span className="quiz__text">{ "Run the command passwd -l user." }</span></li>
      <li className="quiz__choice" data-letter="E"><span className="quiz__letter">E</span><span className="quiz__text">{ "Change the date on the /home folder to that of the expected return date." }</span></li>
      <li className="quiz__choice" data-letter="F" data-correct="1"><span className="quiz__letter">F</span><span className="quiz__text">{ "Change the user’s shell to /sbin/nologin." }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: DF</p>

      <p className="quiz__why">
        { "passwd -l user locks the user’s account by disabling the password, preventing logins. Change the user’s shell to /sbin/nologin ensures the account cannot be used for interactive logins, further securing it." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="5" data-answer="C">
    <p className="quiz__stem">
      { "A Linux administrator is updating the group membership by executing the following commands: However, the group membership is not changing. Which of the following explains this issue?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "Executing usermod with sudo is not permitted." }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "Users cannot be added to the wheel group with the usermod command." }</span></li>
      <li className="quiz__choice" data-letter="C" data-correct="1"><span className="quiz__letter">C</span><span className="quiz__text">{ "The command groups was run with sudo privileges." }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "The options wheel and admin are transposed." }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: C</p>

      <p className="quiz__why">
        { "Running groups with sudo shows the groups for the root user, not for the admin user. That’s why the output only shows root. Without sudo, groups admin (or re-login) would correctly show the updated group membership, including wheel." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="6" data-answer="A">
    <p className="quiz__stem">
      { "An administrator needs to verify the user ID, home directory, and assigned shell for the user named “accounting.” Which of the following commands should the administrator use to retrieve this information?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A" data-correct="1"><span className="quiz__letter">A</span><span className="quiz__text">{ "qetent passwd accounting" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "id accounting" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "grep accounting /etc/shadow" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "who accounting" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: A</p>

      <p className="quiz__why">
        { "The getent passwd accounting command retrieves the user’s entry from the system’s password database, showing fields such as username, UID, GID, home directory, and assigned shell." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="7" data-answer="C">
    <p className="quiz__stem">
      { "A Linux administrator wants to add a user to the Docker group without changing their primary group. Which of the following commands should the administrator use to complete this task?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "sudo groupmod docker user" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "sudo usermod -g docker user" }</span></li>
      <li className="quiz__choice" data-letter="C" data-correct="1"><span className="quiz__letter">C</span><span className="quiz__text">{ "sudo usermod -aG docker user" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "sudo groupmod -G docker user" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: C</p>

      <p className="quiz__why">
        { "The usermod -aG command appends (-a) the user to a supplementary group (-G) without changing their primary group. This is the correct way to add a user to the docker group." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="8" data-answer="C">
    <p className="quiz__stem">
      { "Which of the following is a reason multiple password changes on the same day are not allowed?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "To avoid brute-forced password attacks by making them too long to perform" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "To increase password complexity and the system’s security" }</span></li>
      <li className="quiz__choice" data-letter="C" data-correct="1"><span className="quiz__letter">C</span><span className="quiz__text">{ "To stop users from circulating through the password history to return to the originally used password" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "To enforce using multifactor authentication with stronger encryption algorithms instead of passwords" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: C</p>

      <p className="quiz__why">
        { "Restricting multiple password changes in one day prevents users from cycling through password changes just to reuse an old password, thereby enforcing stronger security practices." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="9" data-answer="D">
    <p className="quiz__stem">
      { "A Linux administrator wants to make the ENABLE_AUTH variable set to 1 and available to the environment of subsequently executed commands. Which of the following should the administrator use for this task?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "let ENABLE_AUTH=1" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "ENABLE_AUTH=1" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "ENABLE_AUTH=$(echo $ENABLE_AUTH)" }</span></li>
      <li className="quiz__choice" data-letter="D" data-correct="1"><span className="quiz__letter">D</span><span className="quiz__text">{ "export ENABLE_AUTH=1" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: D</p>

      <p className="quiz__why">
        { "The export command sets an environment variable and makes it available to subsequently executed commands and child processes, ensuring ENABLE_AUTH=1 is recognized system- wide in that shell session." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="10" data-answer="A">
    <p className="quiz__stem">
      { "A systems administrator changed the file permissions on the myfile file: $ sudo chmod g+w myfile $ ls -l myfile -rwxrwxr-x 1 admin editors C 2022-10-13 10:45 myfile Then the administrator added an existing user test to the editors group: $ sudo usermod -aG editors test However, the user test is still unable to edit the file. Which of the following solutions will fix this issue?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A" data-correct="1"><span className="quiz__letter">A</span><span className="quiz__text">{ "The user test needs to log out and log back in before editing the myfile file." }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "The file is only writable by the root user, and the user test needs root permissions." }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "The group for the user test needs to be reloaded by running sudo source /etc/group." }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "In order to edit the file, additional permissions are required that the user test does not have." }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: A</p>

      <p className="quiz__why">
        { "Group membership is only applied at login time. Having added “test” to the editors group, they must log out and log back in before the new group permissions take effect." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="11" data-answer="A">
    <p className="quiz__stem">
      { "A Linux systems administrator is resolving a privileged access issue for users who are members of an admin group. Which of the following configuration files should the administrator update so the users in the admin group will have root privileged access to the Linux system?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A" data-correct="1"><span className="quiz__letter">A</span><span className="quiz__text">{ "/etc/sudoers" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "/etc/login.defs" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "/etc/group" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "/etc/shadow" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: A</p>

      <p className="quiz__why">
        { "The /etc/sudoers file controls which users and groups can elevate privileges via sudo. By adding a line such as %admin ALL=(ALL) ALL to /etc/sudoers, members of the admin group gain root-level access." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="12" data-answer="B">
    <p className="quiz__stem">
      { "A systems administrator needs to report the IP addresses of the users currently connected to the server. Which of the following commands should the administrator use to find the required information?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "$ whois @localhost" }</span></li>
      <li className="quiz__choice" data-letter="B" data-correct="1"><span className="quiz__letter">B</span><span className="quiz__text">{ "$ w -i" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "$ cat /etc/hosts" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "$ who -l" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: B</p>

      <p className="quiz__why">
        { "This command displays information about currently logged-in users and includes the IP addresses they are connected from, making it suitable for reporting active user connections." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="13" data-answer="A">
    <p className="quiz__stem">
      { "A systems administrator must provide privileged access to a specific user in a Linux system. Which of the following commands should the administrator use?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A" data-correct="1"><span className="quiz__letter">A</span><span className="quiz__text">{ "usermod -aG sudo username" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "echo username \u003e\u003e /etc/sudoers.d/privileged" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "visudo username" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "sed -i 's/username/root/' /etc/passwd" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: A</p>

      <p className="quiz__why">
        { "Adding the user to the sudo group grants privileged access by allowing the user to execute commands with elevated permissions through sudo, which is the standard and supported method on Linux systems." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="14" data-answer="A">
    <p className="quiz__stem">
      { "While reviewing local accounts on a server, a Linux administrator discovers that multiple users have not changed their passwords in more than a year. Which of the following commands should the administrator execute to bring the users' accounts into compliance with the 90-day guideline?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A" data-correct="1"><span className="quiz__letter">A</span><span className="quiz__text">{ "chage -M 90" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "usermod -aG 90" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "passwd -d 90" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "loginctl -H 90" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: A</p>

      <p className="quiz__why">
        { "The chage command is used to manage password aging policies, and setting the maximum password age to 90 days enforces the required password change interval for user accounts." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="15" data-answer="D">
    <p className="quiz__stem">
      { "Which of the following is the best way to create a non-interactive account in a Linux system?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "With no elevated privileges" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "By using adduser with no password" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "With no home directory" }</span></li>
      <li className="quiz__choice" data-letter="D" data-correct="1"><span className="quiz__letter">D</span><span className="quiz__text">{ "With the shell set to /sbin/nologin" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: D</p>

      <p className="quiz__why">
        { "Setting the user’s shell to /sbin/nologin prevents interactive logins while still allowing the account to exist for services or background processes, which is the standard method for creating non- interactive accounts." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="16" data-answer="A">
    <p className="quiz__stem">
      { "An administrator receives a report that a user is unable to execute the run report utility that is used to generate weekly reports. The administrator logs in as the user to verify the issue, runs the following commands, and receives the following output: Which of the following best describes the issue and how to resolve it?" }
    </p>

    <pre className="quiz__exhibit">
      <code>
        { "$ runreports\nbash: runreports: command not found\n$ ls -l /usr/local/bin/runreports\n-rwxr-xr-x. 1 root root 1289 Aug 14 09:12 /usr/local/bin/runreports\n$ echo $PATH\n/usr/local/sbin:/usr/sbin:/home/user/.local/bin:/home/user/bin" }
      </code>
    </pre>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A" data-correct="1"><span className="quiz__letter">A</span><span className="quiz__text">{ "The runreports utility is not in the user's PATH. The administrator should modify the .bash_profile file." }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "The runreports utility is a shell script, but not owned by the user, and is therefore unable to be run. The administrator should use the chown command." }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "The user does not have the correct SELinux context to use the runreports utility. The administrator should modify the SELinux template." }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "The runreports utility does not have execute permissions for the user. The administrator should add execute permissions for the user." }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: A</p>

      <p className="quiz__why">
        { "The runreports script exists in /usr/local/bin and has execute permissions, but /usr/local/bin is missing from the user’s PATH. Because the shell cannot find the command by name, adding /usr/local/bin to the user’s shell startup configuration resolves the issue." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="17" data-answer="B">
    <p className="quiz__stem">
      { "A small group of remote users needs permission to run some administrative commands on a Linux server. Which of the following approaches is the best way to address this request?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "Set the sticky bit in all binaries requested for use by this group of users." }</span></li>
      <li className="quiz__choice" data-letter="B" data-correct="1"><span className="quiz__letter">B</span><span className="quiz__text">{ "Request a list of utilities they need to use with elevated privileges, and add the appropriate rules." }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "Set the configuration parameter PermitRootLogin on sshd_config to \"yes\" and share the root password with this group of users." }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "Create a Linux group, add the users, and configure this group on /etc/sudoers to use sudo, thus allowing them to switch to root user." }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: B</p>

      <p className="quiz__why">
        { "The best approach is to follow least privilege by identifying the specific administrative commands the users need and creating sudo rules that allow only those commands with elevated privileges." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="18" data-answer="C">
    <p className="quiz__stem">
      { "A Linux administrator installed a new program inside $HOME/.local/bin and is trying to execute it without using an absolute path. Which of the following should the administrator use for this task?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "export PATH=PATH:$HOME/.local/bin" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "export $PATH=PATH:$HOME/.local/bin" }</span></li>
      <li className="quiz__choice" data-letter="C" data-correct="1"><span className="quiz__letter">C</span><span className="quiz__text">{ "export PATH=$PATH:$HOME/.local/bin" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "export $PATH-$PATH:$HOME/.local/bin" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: C</p>

      <p className="quiz__why">
        { "The PATH variable must be updated by appending the new directory to the existing value. Using $PATH preserves the current search paths, and adding $HOME/.local/bin allows the shell to find executables in that directory without requiring an absolute path." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="19" data-answer="D">
    <p className="quiz__stem">
      { "A systems administrator is reconfiguring existing user accounts in a Linux system. Which of the following commands should the administrator use to include \"myuser\" in the finance group?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "groupadd finance myuser" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "groupmod finance myuser" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "useradd -g finance myuser" }</span></li>
      <li className="quiz__choice" data-letter="D" data-correct="1"><span className="quiz__letter">D</span><span className="quiz__text">{ "usermod -aG finance myuser" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: D</p>

      <p className="quiz__why">
        { "To add an existing user (myuser) to an existing group (finance) without removing them from other groups, the correct command is usermod -aG finance myuser. The -aG option appends the user to the supplementary group(s) specified." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="20" data-answer="C">
    <p className="quiz__stem">
      { "A user receives the following message when attempting to log in to a Linux workstation with the account named \"developer\": This account is currently not available A Linux administrator, who is working on the issue for the user, runs a few commands and receives the following output: Output 1: # grep -i developer /etc/passwd developer:x:1000:1000:Dev User:/home/developer:/sbin/nologin Output 2: # faillock —-user developer developer: When Type Source Valid # Output 3: # passwd -S developer developer PS 2022-03-09 0 99999 7 -l (Password set, unknown crypt variant.) Output 4: Which of the following commands can the administrator use to resolve the login issue for the account named \"developer\"?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "passwd -u developer" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "chage -M -l developer" }</span></li>
      <li className="quiz__choice" data-letter="C" data-correct="1"><span className="quiz__letter">C</span><span className="quiz__text">{ "usermod developer -s /bin/bash" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "faillock --user developer --reset" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: C</p>

      <p className="quiz__why">
        { "The account’s login shell is set to /sbin/nologin (which prevents interactive logins). Using usermod -s /bin/bash developer changes the shell to a valid login shell (/bin/bash), allowing the user to log in." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="21" data-answer="A">
    <p className="quiz__stem">
      { "Before a Linux administrator restarts a system using systemd, the administrator wants to know if any of the server users are currently logged in. Which of the following commands should the administrator use to verify that the server is not being used?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A" data-correct="1"><span className="quiz__letter">A</span><span className="quiz__text">{ "loginctl list-sessions" }</span></li>
      <li className="quiz__choice" data-letter="B"><span className="quiz__letter">B</span><span className="quiz__text">{ "journalctl -u" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "systemctl status user-sessions" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "systemd --user" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: A</p>

      <p className="quiz__why">
        { "loginctl list-sessions shows all active user sessions on a systemd-based host, allowing the administrator to confirm whether any users are currently logged in." }
      </p>
    </div>
  </div>

  <div className="quiz__q" data-n="22" data-answer="B">
    <p className="quiz__stem">
      { "A systems administrator wants to execute /usr/local/bin/script.sh from the user1 account. Which of the following commands will accomplish this task?" }
    </p>

    <ul className="quiz__choices">
      <li className="quiz__choice" data-letter="A"><span className="quiz__letter">A</span><span className="quiz__text">{ "su -c user1 /usr/local/bin/script.sh" }</span></li>
      <li className="quiz__choice" data-letter="B" data-correct="1"><span className="quiz__letter">B</span><span className="quiz__text">{ "su - user1 /usr/local/bin/script.sh" }</span></li>
      <li className="quiz__choice" data-letter="C"><span className="quiz__letter">C</span><span className="quiz__text">{ "sudo user1 /usr/local/bin/script.sh" }</span></li>
      <li className="quiz__choice" data-letter="D"><span className="quiz__letter">D</span><span className="quiz__text">{ "sudo -1 user1 /usr/local/bin/script.sh" }</span></li>
    </ul>

    <div className="quiz__reveal">
      <p className="quiz__verdict" />

      <p className="quiz__answer">Answer: B</p>

      <p className="quiz__why">
        { "The su - user1 /usr/local/bin/script.sh command switches to the user1 account with a login shell (the -), and passes the script path so that it runs under user1’s identity. The other options either misuse the -c flag or invoke sudo incorrectly." }
      </p>
    </div>
  </div>
</div>
