When you need to run Linux commands with elevated privileges, sudo is the tried and true method to run commands as another user (such as root). In this introductory tutorial, we’ll take a look at some of the inner-workings of sudo.
When you need to run Linux commands with elevated privileges, sudo is the tried and true method to run commands as another user (such as root). In this introductory tutorial, we’ll take a look at some of the inner-workings of sudo.
Great video - I finally got around to tinkering with my
/etc/sudoers
file.To avoid confusion if you get a syntax error, I’ll recommend that you define the following function in your
~/.bashrc
(or another file sourced from~/.bashrc
).Now this has 2 advantages:
editsudo
ensures to runsudo visudo
(so it’s shorter).editsudo
prints a help text first, so that if you exits out with an error you have the relevant info right above.That’s a really good suggestion!
I rarely use sudo, unless I’m sure it’s just for one quick command. At least on my system, sudo requires a root password. Some distros don’t have the root account enabled and so sudo uses the user password. To me, it’s just too Windows like (Do you want to allow (xxxx) to make changes to your system?) Well Yes, of course! Just asking for problems. That’s just my opinion. And we all know what opinions are like!