All Linux users have had to deal at some point with these two commands: [ sudo ] and [ su ]. We would be able to get root privileges as the administrator by running them in the console, right? I’m sure you all know what I am talking about.
But… have you ever wondered what they really mean? What is there beyond these letters? The answer is very simple:
sudo = Substitute User DO
su = Substitute User
Although some sectors indicate that it comes from SuperUser, its real meaning is actually mentioned above.
A brief history[ sudo ] is a computer program that allows the user of a system to access the security privileges of another user, who is normally the administrator (or root user). It was originally written in 1980 by Bob Coggeshall and Cliff Spencer, of the University State of New York. It was modified and maintained by different programmers by 1996, and from that year until now it is been maintained by Todd Miller. It has currently a BSD license.
Which is the difference between [ sudo ] and [ su ]?
With [ sudo ] we are only allowed to run a command or function in the console. Once it has been run, if you want to run another you have to re-write sudo and re-enter your password.
With [ su ] that limitation disappears. Once it has been run and your password written, you stay as root user until you decide to log out. You can, therefore, run everything you need in that period. To log out, you must run the command exit.
How do we know if we are with our user or as root?
In the console, we can know which kind of user we are by looking at these symbols:
- # = you are as root or administrator.
- $ = you are as your user and you can not run commands as root.
Long live Open-Source Software!