Recall & Review
beginner
What does the
su command do in Linux?The
su command lets you switch from your current user to another user account in the terminal. It stands for "switch user."Click to reveal answer
beginner
How do you switch to the root user using
su?You type
su and press Enter. Then you enter the root user's password when asked. This gives you root access.Click to reveal answer
intermediate
What is the difference between
su and su -?su switches user but keeps your current environment. su - switches user and loads the new user's full environment, like a fresh login.Click to reveal answer
beginner
How do you switch to another user named
alice using su?You type
su alice and press Enter. Then enter Alice's password when prompted.Click to reveal answer
beginner
Why might you use
exit after using su?Typing
exit logs you out of the switched user session and returns you to your original user.Click to reveal answer
What does the command
su - do differently than su?✗ Incorrect
su - switches user and loads the new user's full environment, like a fresh login.Which password do you need to enter when you run
su alice?✗ Incorrect
You must enter the password of the user you want to switch to, in this case, Alice's password.
What happens if you type
su without a username?✗ Incorrect
Typing
su alone switches to the root user by default.How do you return to your original user after using
su?✗ Incorrect
Typing
exit ends the switched user session and returns you to your original user.Why is
su useful in Linux?✗ Incorrect
su lets you switch between user accounts in the terminal.Explain how to switch to the root user using
su and how to return to your original user.Think about logging in as root and then logging out.
You got /3 concepts.
Describe the difference between
su and su - and when you might use each.Consider how environment variables and settings change.
You got /3 concepts.