Introduction
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 usingsudo
- 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 theroot
user - Create the
projectuser
with a home directory in/home/projectuser
- Set the password for
projectuser
toproject123
- 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)
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?
- π³ Learn the latest Linux Skill Trees
- π Read More Linux Tutorials
- π¬ Join our Discord or tweet us @WeAreLabEx
Top comments (0)