$
Learn Linux handbook
en
XP:0
Quest 138Shapeshifter
+200 XP

Switching Security Contexts (su)

Launch Interactive Terminal for This Quest→No installation required • Runs fully in browser

Concept & Overview

Now that you've created the deployer account, how do you log into it locally to test its environment? In Linux, we use the su (substitute user) command to switch accounts without logging out.

- The su command switches the current terminal shell to that user's session.
- When switched, running whoami will reflect the new user name.
- To return to your original user account session, type exit or press Ctrl+D.

Let's switch contexts. Switch to the deployer user by running su deployer. Once logged in, run whoami to verify you are indeed running as deployer. When you're done, type exit to switch back.

Command Syntax Reference

Command / SyntaxDescription
su deployerSubstitute user session to deployer
whoamiVerify the active user session name
exitExit active user session

Verification Objectives

These conditions will be automatically verified when you run commands inside the interactive terminal simulator:

  • ○
    Switch shell context to deployer using su
  • ○
    Run whoami to confirm you are deployer

Ready to complete Quest 138?

Test your skills live in the browser terminal with an emulated Linux filesystem, real-time command evaluation, and instant step-by-step hints.