- This page was last modified on 9 August 2025, at 21:13. Suggest an edit.
sudo facts for kids
![]() |
|
![]() The
command in a terminal |
|
Original author(s) | Robert Coggeshall, Cliff Spencer |
---|---|
Developer(s) | Todd C. Miller |
Initial release | c. 1980 |
Stable release | |
Written in | C |
Operating system | Unix-like |
Type | Privilege authorization |
License | ISC-style |
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.sudo
The name
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.sudo
When you use
, you usually type your own password. This is different from another command called sudo
, 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 su
/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.
Contents
History of Sudo
The first version of
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.sudo
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
updated. It has been available for everyone to use since 1999.sudo
The
logo is a fun reference to a popular online comic. In the comic, someone orders a sandwich by saying "sudo make me a sandwich."sudo
How Sudo Works
When you use
, 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.sudo
After you type your password and the computer checks its rules, your command runs.
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.sudo
For safety,
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.sudo
Setting Up Sudo
The main rule book for
is a file called sudo
/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
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
Sudo's Importance
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.sudo
Other Tools Like Sudo
- visudo: This is a tool that helps you safely edit the
rule book. It stops more than one person from editing at the same time. It also checks your changes for errors.sudo
- sudoedit: This is a special way to use
. It lets you edit files that usually need special powers to change.sudo
- Microsoft sudo: In February 2024, Microsoft released its own tool called
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.sudo
- doas: This is another tool that does a similar job to
. It was created for OpenBSD operating systems.sudo
- gosu: This tool is popular in special computer setups called "containers." It's like
but works better in those environments.sudo
See also
In Spanish: Sudo para niños
- chroot
- doas
- runas
- Comparison of privilege authorization features