su and sudo – Substitute or Super?

What does it mean?

Found an interesting thread on reddit where one person described sudo as Super User Do and was corrected by someone else, saying it was Substitute User Do – in the sense that the substitute user is one whom has permission to do root-ish activities.  I know that the sudoers file determines what rights (in most cases, all) the sudo user has available to them, but I honestly never thought about it being “substitute” instead of “super.”  I also thought that “su” simply elevated you to “super user.”

In case you’re new to this, the difference between “su” and “sudo” is that “su” elevates you to root, and stays in that setting until you type “exit” at the bash prompt:

turngren@linux$ su
password: *************
root@linux# command <as root
root@linux# another command <as root
root@linux# exit
turngren@linux$

Sudo, on the other hand, only works for the following command:

turngren@linux$ dnf update
(message that root needs to perform this)
turngren@linux$ sudo dnf update <performs as root
password: ***************
turngren@linux$ lsblk <performed as regular user

So I did some quick googling, and I’m finding plenty of sources that go both ways.  I wonder which is technically correct?

Leave a Reply

Your email address will not be published.