0
0
Linux CLIscripting~5 mins

sudo for elevated privileges in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the sudo command do in Linux?

sudo lets a user run commands with the security privileges of another user, usually the superuser (root). It is used to perform tasks that require higher permissions.

Click to reveal answer
beginner
Why should you be careful when using sudo?

Using sudo gives you powerful access that can change or damage system files. Mistakes can cause system problems or security risks.

Click to reveal answer
beginner
How do you run a command with sudo?

Simply type sudo before the command. For example, sudo apt update runs the update command with elevated privileges.

Click to reveal answer
beginner
What happens if you enter the wrong password when using sudo?

The command will not run. sudo asks for your user password to confirm your identity. If wrong, it denies access.

Click to reveal answer
intermediate
What is the difference between su and sudo?

su switches the user to another user account (often root) and requires that user's password. sudo runs a single command with elevated rights using your own password.

Click to reveal answer
What is the main purpose of the sudo command?
AChange file permissions
BSwitch to a different user account permanently
CList files in a directory
DRun commands with higher privileges
Which password does sudo ask for when you run a command?
ARoot user password
BNo password is required
CYour own user password
DThe password of the last logged-in user
What happens if you enter the wrong password when using sudo?
AAccess is denied and the command does not run
BYou get logged out
CThe command runs anyway
DThe system restarts
Which command runs a single command with elevated privileges without switching users?
Asu
Bsudo
Cchmod
Dpasswd
Why is it important to use sudo carefully?
AIt can cause system damage if misused
BIt disables the internet
CIt deletes your user account
DIt can slow down your computer
Explain what sudo does and why it is used in Linux.
Think about how you get permission to do special tasks on your computer.
You got /4 concepts.
    Describe the difference between sudo and su commands.
    One lets you do one thing as admin, the other changes who you are.
    You got /4 concepts.