15

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.

1
  • 1
    You can't add any insults to sudo without editing the source.
    – Mel Boyce
    Jun 24, 2013 at 11:52

3 Answers 3

13

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.

0
4

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

  1. One for boring systems where sudo is compiled without insults, here I use badpass_message to hardcode a single custom insult which appears in every bad password message

  2. A directive for the fun systems where insults is supported on sudo

You must enable either insults or badpass_message, enabling both falls back to insults (at least on Debian).

1

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.

2
  • 1
    Could you add some of the specifics here to your answer? Would make your answer much stronger.
    – slm
    Jun 23, 2013 at 23:51
  • 2
    @Aurigae wasn't asking how to enable the insults, but how to add a custom one...
    – Calimo
    Dec 11, 2013 at 15:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .