You mentioned these system adminstration functions
managing packages, editing config files, installing a program from source
as things that
anything a regular user does
In a typical multiuser system these are not ordinary user actions; a systems administrator would worry about this. Ordinary users (not “under privileged”) can then use the system without worrying about its upkeep.
On a home system, yes, you end up having to administer the system as well as using it.
Is it really such a hardship to use
sudo? Remember that if it’s just your system there’s no reason why you can’t either pop into a
root shell (
sudo -s – see this post for an overview of various means of getting a root shell) and/or configure
sudo not to prompt for a password.
Sudo/Root is used whenever you are doing something that a standard user should not have the capability of doing for risk of damaging/changing the system configuration in a way that the Administrator of the system would not normally allow.
whether I’m managing packages, editing config files, installing a
program from source, or what have you.
All of those are technically admin functions, and can drastically damage your system if something incorrect is done. In a corporate environment, as a Sysadmin, they are things I would NOT let my user do without my express knowledge, hence sudo.
For example, if a package/config file could be modified without elevated privileges, then it would be extremely simple for an outside source to simply execute remote code that could break/compromise your system. By forcing those actions to require root access, it forces you as the user to make the decision on whether or not those actions take place.
It is very similar to
UAC with windows, it is actually where windows got the idea for
The quote you receive the first time you use sudo is very fitting, and very important:
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility.
Especially #2, Think before you type. That is an important reason sudo exists, when you type a command and it kicks back “must be root to perform this action” it forces you to stop and THINK about what you are actually doing.
Also, I’ve seen some people display commands that require
sudo. Do they have their system configured in such a way that
sudois not required?
You have to execute those commands as superuser, but you don’t have to execute them using
sudo. You could for example instead use
doas (OpenBSDs replacement for
sudo), or you could simply login as root.
So if they display their commands here without
sudo than they assume that the reader will just use his favorite way of executing those commands as superuser.
It most certainly doesn’t mean that they can execute those commands as a normal user.