Courseiva
User and Group ManagementhardMultiple SelectObjective-mapped

LFCS User and Group Management Practice Question

Which THREE of the following are valid methods to temporarily switch to a different user account without logging out entirely? (Choose three.)

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

sudo -u username -s

Options A, B, and E are correct. `sudo -u username -s` launches a shell as the specified user. `su - username` starts a login shell as that user. `runuser -l username -c 'bash'` runs a command as another user (common in scripts). Option C (`newgrp groupname`) changes the group, not the user. Option D (`login username`) requires a full login, which logs out the current session.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • sudo -u username -s

    Why this is correct

    Launches a shell as the specified user with sudo.

  • su - username

    Why this is correct

    Starts a login shell as the specified user.

  • newgrp groupname

    Why it's wrong here

    Changes the current group ID, not user.

  • login username

    Why it's wrong here

    login requires logging out first and starts a new session.

  • runuser -l username -c 'bash'

    Why this is correct

    runuser runs a command as another user.

About these practice questions

This LFCS question is part of Courseiva's 507-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This LFCS practice question is part of Courseiva's free Linux Foundation certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the LFCS exam.