I intend to play with the linux insults and add a few. However, i only could figure how to add a single insult but not a list or the location of the file that contains the insults.
3 Answers
To edit the list of insults, you will need to edit the source and recompile.
The insults are stored in plugins/sudoers/ins_*.h
(4 files). If you add a new file, you will need to add its definition to plugins/sudoers/insults.h
. That's it.
For me on the Debian side, I ended up writing a sudoers.d directive to achieve the result, because adding a list of custom insults requires recompilation of sudo
.
In my custom config I use two directives
One for boring systems where
sudo
is compiled withoutinsults
, here I usebadpass_message
to hardcode a single custom insult which appears in every bad password messageA directive for the fun systems where
insults
is supported onsudo
You must enable either insults
or badpass_message
, enabling both falls back to insults
(at least on Debian).
I'm not sure as I have not used this funny(?) feature before but I have find this sudoers insults help and Insult me, sudo!!! and other references that suggest that this "feature" have to be enabled compiling sudo
from sources.
I guest that (since it's fun but useless) that many *nix do not include it at all and if they do that list is hardcoded into the sudo
executable.
To obtain this you have to edit /etc/sudoers
(using visudo
) and add this directive:
Defaults insults
On OSX 10.8.4 (sudo version 1.7.4p6) you can check the active Defaults
using :
$ sudo -l | grep insult
XAUTHORIZATION XAUTHORITY", env_keep+="EDITOR VISUAL", env_keep+="HOME MAIL", insults
Then you can try it using:
$ sudo -K
$ sudo ls
and if you write a wrong password you'll see the "insult"
But I have tested all this on OSX 10.8.4 and it do not work, you get the standard Sorry, try again.
message.
I have searched the output of
$ sudo strings `which sudo`
but ther are no such strings.
NOTE: I'll test it on other *nix (as soon as I can) and report.