/etc/sudoers - Insults - How to add a list of insults?

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.

  • https://gist.github.com/tonejito/235feb4f1d299fd82ad513289b4704ee

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).

Tags:

Linux

Sudo