kids encyclopedia robot

sudo facts for kids

Kids Encyclopedia Facts
sudo
Sudo logo (2019).png
Sudo on Linux (Fedora).png
The sudo command in a terminal
Original author(s) Robert Coggeshall, Cliff Spencer
Developer(s) Todd C. Miller
Initial release c. 1980
Stable release
1.9.17p1 Edit this on Wikidata / 30 June 2025; 56 days ago (30 June 2025)
Written in C
Operating system Unix-like
Type Privilege authorization
License ISC-style

sudo is a special command used on computers that run Unix-like operating systems. Think of it as a "magic word" that lets a user run a program with the powers of another user. Most often, it lets you act like the "superuser," who is like the boss of the computer.

The name sudo first meant "superuser do." This was because it mainly helped users do things only the superuser could. Now, it's also understood as "substitute user, do." This is because sudo can let you run commands as other users too, not just the superuser.

When you use sudo, you usually type your own password. This is different from another command called su, where you might need the superuser's password. After you type your password, the computer checks a special rule book. This rule book, usually found at /etc/sudoers, decides if you are allowed to run the command. This rule book can be very detailed. It can say which commands you can run, if you need a password every time, or even if you never need one for certain tasks.

History of Sudo

The first version of sudo was created around 1980. Robert Coggeshall and Cliff Spencer developed it at the University at Buffalo. Later, Robert Coggeshall brought it to the University of Colorado Boulder.

Between 1986 and 1993, the program was greatly improved. Many people from the University of Colorado Boulder helped, including Todd C. Miller. Since 1994, Todd C. Miller has been in charge of keeping sudo updated. It has been available for everyone to use since 1999.

The sudo logo is a fun reference to a popular online comic. In the comic, someone orders a sandwich by saying "sudo make me a sandwich."

How Sudo Works

Sudo warning
Warning when first using sudo

When you use sudo, you enter your own password. This is a key safety feature. It means you don't need to know the superuser's password. This helps keep the superuser's password a secret. To use sudo, you must be part of a special group on the computer. These groups are often called wheel or sudo.

After you type your password and the computer checks its rules, your command runs. sudo also gives you a short "grace period," usually about 5 minutes. During this time, you can run more commands with special powers without typing your password again. This is handy if you have many tasks to do.

For safety, sudo can keep a record of every command you run. If someone tries to use sudo without permission, the computer will tell them. It also records the attempt. Sometimes, the main computer administrator will even get an email about it.

Setting Up Sudo

The main rule book for sudo is a file called /etc/sudoers. This file lists which users or groups can run commands with special powers. It also says which commands they can use. You should always edit this file using a special command called sudo visudo. This command helps prevent mistakes and checks for errors.

The sudo rule book has many options. You can set it so some commands don't need a password. You can also change who can use sudo. There's even a fun "easter egg" you can turn on. If you type the wrong password, it will show you a funny insult!

Sudo's Importance

sudo has become very important for managing computers. In many Linux distributions and Apple's macOS, it's the main way to do administrative tasks. This makes it safer to log what administrators do. It also helps prevent some security problems.

Other Tools Like Sudo

  • visudo: This is a tool that helps you safely edit the sudo rule book. It stops more than one person from editing at the same time. It also checks your changes for errors.
  • sudoedit: This is a special way to use sudo. It lets you edit files that usually need special powers to change.
  • Microsoft sudo: In February 2024, Microsoft released its own tool called sudo for Microsoft Windows. It lets you run powerful commands from a regular command window. It works differently from the Unix version, but it does a similar job.
  • doas: This is another tool that does a similar job to sudo. It was created for OpenBSD operating systems.
  • gosu: This tool is popular in special computer setups called "containers." It's like sudo but works better in those environments.

See also

Kids robot.svg In Spanish: Sudo para niños

  • chroot
  • doas
  • runas
  • Comparison of privilege authorization features