seagle you should never edit /etc/sudoers directly!
Yes, of course, the use of visudo
is mandatory.
Better yet, do not touch /etc/sudoers
at all, even with visudo
. Instead, place sudo
customization(s) in a simple text file and drop the file into the /etc/sudoers.d
folder. The file may be edited with any text editor.
For example, I use /etc/sudoers.d/60-justsudo
file to customize sudo
behaviour:
$ dt && sudo ls -lh /etc/sudoers.d && echo && sudo cat /etc/sudoers.d/60-justsudo
Current datetime:
2019-10-09 14:45:53
total 4.0K
-rw-r--r-- 1 root root 308 Oct 9 14:38 60-justsudo
#if sudo asks for password, displays asterisks
#while password is being typed in
Defaults pwfeedback
#if sudo asks for password, insults the user
#if a wrong password has been typed in
Defaults insults
#sudo won't ask for password, if the user
#makes part of the wheel group
%wheel ALL=(ALL) NOPASSWD: ALL
$