Why is it called sudo?
Solution 1
From Wikipedia:
sudo is a program for Unix-like computer operating systems that allows users to run programs with the security privileges of another user (normally the superuser, or root). Its name is a concatenation of "su" (substitute user) and "do", or take action.
Unlike the su command, users typically supply their own password to sudo rather than the root password. After authentication, and if the /usr/local/etc/sudoers (sometimes found at /etc/sudoers) configuration file permits the user access, then the system will invoke the requested command. The sudoers configuration file enables a huge amount of configurability, including but not limited to: enabling root commands only from the invoking terminal; not requiring a password for certain commands; requiring a password per user or group; requiring re-entry of a password every time or never requiring a password at all for a particular command line. It can also be configured to permit passing arguments or multiple commands, and even supports commands with regular expressions.
Its a temporary one-time command with superuser (administrator) privileges without direct root login.
Solution 2
Before sudo, most administrators were logged-in as the root user because it is an easy way to configure your system, as you have all the rights. However, a small mistake, or a wrong internet link and your whole system could be affected or even compromised.
Due to this problem, sudo appeared. The aim was to use administrative privileges only for a short period of time, and only when required. In addition, this would avoid the user logging into another account. This would obviously enhance the system safety.
Under Ubuntu, they choose to enhance the safety of your system. Thus, they decided to follow the ‘sudo’ way. The root user is disabled; there is no need for it and especially no risk that a user logged-in via the X interface with the root user. In addition, they've allowed every command to be launched with sudo for authorized users. The cool thing is that power-users can access the root account.
Drawbacks of sudo
:
- Which commands to you allow via sudo
- You need to write
sudo
before every command requiring administrative privilege - Every so often you need to re-type the password.
What does sudo
mean? Its name is a concatenation of "su" (substitute user) and "do".
Why sudo
not admin
? I think sudo
means admin
for a specific time and only when you need it.
People who are coming from windows environment should understand why it is not admin
:)
References : Site
Picture : xkcd
Solution 3
From Linux.com, a product of the Linux Foundation:
Sudo stands for either "substitute user do" or "super user do" (depending upon how you want to look at it). What sudo does is incredibly important and crucial to many Linux distributions. Effectively, sudo allows a user to run a program as another user (most often the root user).
[Emphasis mine.] Source
Solution 4
Whether "superuser" is what su
originally derived from, it is inaccurate since the username you give it doesn't have to be a superuser. Ditto for executing commands as another user using sudo -u
.
"Substitute user" is more accurate, but sounds clunky. It makes me think of a substitute teacher.
Therefore I prefer to think of su
as simply "switch user" and sudo
thus as "switch user & do".
Solution 5
superuser do
There's a command, su, for becoming the superuser, so you might say
$ su
# apt-get install somehorror
# exit
$
sudo lets you do that in one swoop, and you don't have to remember to renounce your magic powers.
$ sudo apt-get install somehorror
Related videos on Youtube
Comments
-
Mohammad over 1 year
Why do we use
sudo
to perform a terminal command as an administrative? Why isn't itadmin
or something else? Is there a reason forsudo
?-
Admin almost 10 yearsRead
sudo ls
as "superuser, dols
" (and not, it's not silly, mnemonics are important for remembering commands) (and no, probably it means "s witch u ser and do, given thatsu
means switch user. But I find the former nicest ;-)) -
Admin almost 10 yearssuperuser much better than admin :) thank you for replying.
-
Admin almost 10 yearsIt's that sudo voodoo that you do. :)
-
Admin almost 10 yearssudo does much more than just "run stuff as administrator" - which is why "admin or something else" probably would be misleading.
-
Admin almost 10 yearsFun fact: in Italian
sudo
means (I) sweat. I like to interpretsudo X
as sweating for the fear of giving the wrong command and wiping all my data. This helps keeping in mind that you should addsudo
in front of commands only when 1) It is necessary 2) You know what you are doing 3) You have carefully wrote and read the command line to avoid typos (especially bad spaces which are hard to catch and can result in really awful unexpected results). -
Admin almost 10 years@Mohammad you can read my answer also so you clear view about why its sudo , hope it can help others
-
Admin almost 10 yearsNot recommended, but if you don't like its name, you can create a copy of it in the /usr/bin folder. Find wherever the command is (either in /bin or /usr/bin) and copy-paste it with a new name of your choice. (The name you give it will have to be not taken by any other application, for example, you can't rename it "su".) (Of course, you'll need root priveliges to do this.)
-
Admin almost 10 yearsThat's not a good way to rename sudo. If there's an upgrade to the sudo package (say, a security related one), the old copy will still be floating around. And it will be preferred by the user (presumably). Much better to make a symbolic link to a new name.
-
Admin almost 10 yearsDANGER ------ you can use sudo -s to get to the root user, however, you also can do a lot of damage if not very careful.
-
Admin almost 10 years@AndrewFischer: As nomen points out, creating a copy of
/usr/bin/sudo
is a bad way to provide an alternative name for it. Just copying it won't work; you'll have to usesudo chmod
to restore the setuid bit. A symlink would work, but a shell function or alias is a much simpler way to do it. (But by the time you've gone to all that effort, you'll have memorized the name "sudo" anyway.) -
Admin almost 10 years@nomen: A symlink isn't necessary; just create a shell alias or function.
-
-
daviewales almost 10 yearsThe wiki part is correct. The comment about "Mac is Su" is not correct. Macs have both
sudo
, andsu
, just as BSD and Linux do. -
David Richerby almost 10 years
su
("substitute user") allows you to become any user: you can specify a username as an argument. -
Deepak Verma almost 10 yearsActually, the two are not exactly the same, but are similar in most cases. But sudo mainly just allows you to run a program with super user privileges, but keeps your normal environment the same. su actually make you super user, with super user's environment.
-
BeyondProgrammer almost 10 yearsalways tot it is super user do but substitute user sound more right
-
JamesRyan almost 10 yearsso why isn't it called rodo?
-
h3. almost 10 yearsYour “before sudo” paragraph is wrong. There is no difference between
su
andsudo
in this respect, the only difference between the two is which credentials are used. Usingsudo
rather thansu
isn't more secure (in fact, it is somewhat less secure); the main benefit of sudo (and the reason Ubuntu chose it) is simplicity for the user (only one password to remember). -
derobert almost 10 yearsWell, the question was why it is named the way it is, not for backronyms and/or mnemonics, so... [citation needed]
-
Stéphane Chazelas almost 10 yearsAlso the default target user doesn't have to be
root
(though it makes sense for it to be or at least one with uid 0 and it generally is), see therunas_default
insudoers
. -
three-cups almost 10 years@derobert +1 for use of "backronyms" and for keeping the site clean from incorrect answers.
-
Bonn about 9 years@Virusboy Hello, I'm sorry to try in this topic. But I have to know Is it easy to use ubuntu 14.04 with Toshiba M840 i3-3110M. Thank you.
-
Virusboy about 9 yearsIts easy on any pc