Skip to main content

Unit 3 路 Linux^2 路 Lesson 28 of 34

Simon Says

sudo

Remember the root directory? Well, there's also a root user, and root is basically the admin of the entire system. Root can read, change, or delete literally anything.

Normal users (like you) can't do everything though. If you try to mess with an important system file, Linux will slap you with a good ol' Permission denied and that's the end of that.

Unless you say the magic word. 馃獎

[user@linux]$ sudo cat /etc/shadow

sudo (super user do) runs one single command as root. It'll usually ask for your password first, just to make sure it's actually you.

Who gets to use it?

Only users who are allowed to use sudo (usually people in the sudo or wheel group) can actually use it. If you're not on the list, Linux will tell you the incident will be reported.

(Yes, that's what it actually says. No, nobody is coming for you.)

With great power...

...comes great responsibility. sudo rm -rf / is the Linux version of deleting your entire computer.

鈿狅笍 Don't run it. Seriously. Not even as a joke.


Your turn

There's a flag locked away at /opt/vault/flag.txt that only root can read. Root trusts you with this one file though. Say the magic word!

Capture-the-flag challenge

Put the lesson to work on a challenge and submit the flag you find. Create a free account to do this part.

Do this lesson for real

With a free account you get the terminal, the challenges and the checks that go with every lesson in Intro to Linux, and your progress is saved as you go. CyberAcad is a 501(c)(3) nonprofit, so there is nothing to pay.