For those who like humour, sudo
can be configured to print a random more or less insulting or funny phrase instead of the neutral Sorry, try again.
by adding the line below to /etc/sudoers
(using the command sudo visudo
, not editing manually!):
Defaults insults
Here are some examples:
[sudo] password for bytecommander:
The more you drive -- the dumber you get.
[sudo] password for bytecommander:
I've seen penguins that can type better than that.
[sudo] password for bytecommander:
This mission is too important for me to allow you to jeopardize it.
[sudo] password for bytecommander:
He has fallen in the water!
[sudo] password for bytecommander:
Hold it up to the light --- not a brain in sight!
Now just for fun I'd like to read through all of them, but entering wrong passwords all day is not really the best method (delay after each attempt, only 2 messages per 3 attempts, abort after 3 attempts, ...).
So... where are these insults actually stored? Any plain text file I can directly read? Or hard coded strings in the source code?
How can I get a list of all available sudo
insult messages?
They are in the binary file
(found by:
find /usr/lib/sudo -type f | xargs grep "fallen in the water"
)If you enable source downloads and do
You can find the insults files in the source directory under
The files are
Example of what these files look like:
and so on... they are quite readable.
Make your own insults
You can change sudo insults without recompiling sudo.
See: Adding new sudo insults
Header files with insults
When we look at all the insults we discover an interesting tidbit: saying Broccoli is politically correct, but saying Burrito is not. All the insults are listed below.
ins_2001.h
(2001 Space Odyssey insults):ins_classic.h
(Original Sudo 8 insults):ins_csops.h
(CSOps insults):ins_goons.h
(Goon Show insults):The file
insults.h
contains compiler instructions on which of the above insults to include in the compiled sudo program. Indeed, you could create your own insults file, add the name to insults.h and recompile to have messages like, "What, are you an ArchLinux user?" or "This isn't Windows where errors are commonplace!", etc.Notice the
#ifdef PC_INSULTS
in some of the insult files. This doesn't mean "if you have a personal computer" it means "if you want to be politically correct."Listing all insults to your terminal
For Ubuntu 16.04.6 LTS you can use this:
For other Ubuntu versions the line numbers passed to
head
command might change. Hopefully others can verify for their version.With
we can search which files from package
sudo
contain the worddumber
.The only match is in file
/usr/lib/sudo/sudoers.so
. This is a binary file so we use thestrings
command to only get things that looks like being human readable. As it's a lot we pipe the result intoless
:In
less
we can useto search again for the word "dumber". That gets us right into the insults. Scroll up and down with the cursor keys and quit with q
The above answers are great for offline search. But we are online. So open Debian code search and try one one of the insults here . It instantly tells you it's in
sudo_1.8.12-1/plugins/sudoers/ins_csops.h
. This has the advantage of finding it everywhere be it a configuration file to be deployed in/etc
or whatever. And since it's a .h file, it's visible it's in the source and not something you can modify.To add to the other answers, the insults appear to be in the
.rodata
section of sudoers.so. You can useobjcopy
to somewhat restrict the output, although there will still be a lot of false positives: