Challenge - 5 Problems
Sudo Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of this sudo command?
You run the command
sudo -l as a normal user. What does this command show?Linux CLI
sudo -l
Attempts:
2 left
💡 Hint
Think about what 'sudo -l' is used for in daily tasks.
✗ Incorrect
The command 'sudo -l' lists the commands that the current user is allowed to run with sudo privileges, often without needing to enter a password.
💻 Command Output
intermediate2:00remaining
What happens when you run this sudo command?
What is the output or effect of running
sudo echo 'Hello' in a terminal?Linux CLI
sudo echo 'Hello'Attempts:
2 left
💡 Hint
Consider how sudo affects simple commands like echo.
✗ Incorrect
The command runs echo with sudo, so it prints 'Hello' to the terminal as expected.
🔧 Debug
advanced2:00remaining
Why does this sudo command fail?
You try to run
sudo cat /etc/shadow but get a 'Permission denied' error. What is the most likely reason?Linux CLI
sudo cat /etc/shadow
Attempts:
2 left
💡 Hint
Think about user permissions and sudo access.
✗ Incorrect
If your user is not allowed to use sudo, running sudo commands will fail with permission errors even if the command is correct.
🧠 Conceptual
advanced2:00remaining
What does the sudoers file control?
Which of the following best describes the purpose of the sudoers file?
Attempts:
2 left
💡 Hint
Think about how sudo controls access.
✗ Incorrect
The sudoers file controls who can run sudo and what commands they can run with elevated privileges.
🚀 Application
expert2:00remaining
How to run a command as another user with sudo?
You want to run the command
whoami as the user 'alice' using sudo. Which command will do this correctly?Attempts:
2 left
💡 Hint
Look for the correct sudo option to specify a different user.
✗ Incorrect
The option '-u' followed by the username runs the command as that user.