DEV Community

Cover image for Log in and Switch Users|RHCSA Exam Questions
Labby for LabEx

Posted on

Log in and Switch Users|RHCSA Exam Questions

Introduction

MindMap

In Linux systems, it's common to have multiple users sharing the same environment. As a system administrator, you need to be proficient in managing user accounts and switching between them. This challenge will test your skills in user management and authentication in a Linux environment.

Environment

LabEx uses Red Hat Universal Base Image 9 (UBI9) to simulate the exam environment. It may not be identical to the actual RHCSA exam environment, but it provides a good representation of the tasks you'll encounter.

There are two users in the environment:

  • labex: A standard user with sudo privileges, password: labex.
  • root: The system administrator, password: redhat.

The challenge features real exam questions, along with explanations, requirements, and automated verification scripts to help you confirm task completion. It effectively simulates the knowledge areas covered in the RHCSA exam.

Switch Users and Create a New Account

This step will guide you through the process of switching between users and creating a new user account.

Tasks

  • Switch to the root user using sudo
  • Create a new user named projectuser
  • Switch to the projectuser account
  • Return to the labex user account

Requirements

  • You are already logged in as the labex user
  • All operations should be performed in the terminal
  • Use the sudo command to switch to the root user
  • Create the projectuser with a home directory in /home/projectuser
  • Set the password for projectuser to project123
  • Use the su command to switch between users
  • Ensure you end up logged in as the labex user

Example

After completing the tasks, you should be able to see the following output when running the who command:

labex    pts/0        2023-08-28 10:00 (:0)
Enter fullscreen mode Exit fullscreen mode

Summary

In this challenge, you practiced essential user management skills in a Linux environment. You learned how to switch between users using sudo and su commands, create a new user account with a specified home directory, and set user passwords. These skills are crucial for system administrators managing multi-user systems, ensuring proper user isolation, and maintaining system security.


πŸš€ Practice Now: Log in and Switch Users


Want to Learn More?

Top comments (0)