269

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?

Byte Commander
  • 107,489

6 Answers6

213

They are in the binary file

/usr/lib/sudo/sudoers.so

(found by: find /usr/lib/sudo -type f | xargs grep "fallen in the water")

If you enable source downloads and do

apt source sudo

You can find the insults files in the source directory under

plugins/sudoers

The files are

ins_2001.h
ins_classic.h
ins_csops.h
ins_goons.h
insults.h

Example of what these files look like:

#ifndef SUDOERS_INS_GOONS_H
#define SUDOERS_INS_GOONS_H

/*
 * Insults from the "Goon Show."
 */

    "You silly, twisted boy you.",
    "He has fallen in the water!",
    "We'll all be murdered in our beds!",
    "You can't come in. Our tiger has got flu",

and so on... they are quite readable.

dessert
  • 39,982
Zanna
  • 70,465
  • 34
    Now that Zanna tells us they are in sudoers.so, you can also "read" them using strings instead of the source code. Run this: strings /usr/lib/sudo/sudoers.so – Stéphane Oct 16 '16 at 05:08
  • 3
    @Stéphane That is true, though strings won't tell you if all insults are equal. Reading the actual source could reveal whether certain criteria influence the choice of insult. – kasperd Oct 16 '16 at 21:57
  • 3
    @Stéphane Plus running strings on an executable produces a tediously large number of false positives,. – MariusMatutiae Oct 17 '16 at 10:30
  • @MariusMatutiae, eh? strings understands ELF executable format [hence the buffer overflow reported a few years ago when given a maliciously-crafted executable, which wouldn't have existed if it were using the same logic as for any arbitrary binary file]; what it returns really are, err, strings. :) – Charles Duffy Oct 17 '16 at 21:07
  • 28
  • 10
    I wasn't going to actually do this until I saw Goon Show insults, at which point I couldn't key fast enough – JamesENL Oct 18 '16 at 04:25
  • grep can do recursive searches, e.g. grep -r fallen /usr/lib/sudo – or with -R to also follow symlinks. – dessert Mar 06 '20 at 09:37
92

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

.
    /*
     * HAL insults (paraphrased) from 2001.
     */

    "Just what do you think you're doing Dave?",
    "It can only be attributed to human error.",
    "That's something I cannot allow to happen.",
    "My mind is going. I can feel it.",
    "Sorry about this, I know it's a bit silly.",
    "Take a stress pill and think things over.",
    "This mission is too important for me to allow you to jeopardize it.",
    "I feel much better now.",

ins_classic.h (Original Sudo 8 insults):

    /*
     * Insults from the original sudo(8).
     */

    "Wrong!  You cheating scum!",
#ifdef PC_INSULTS
    "And you call yourself a Rocket Scientist!",
#else
    "No soap, honkie-lips.",
#endif
    "Where did you learn to type?",
    "Are you on drugs?",
    "My pet ferret can type better than you!",
    "You type like i drive.",
    "Do you think like you type?",
    "Your mind just hasn't been the same since the electro-shock, has it?",

ins_csops.h (CSOps insults):

    /*
     * CSOps insults (may be site dependent).
     */

    "Maybe if you used more than just two fingers...",
    "BOB says:  You seem to have forgotten your passwd, enter another!",
    "stty: unknown mode: doofus",
    "I can't hear you -- I'm using the scrambler.",
    "The more you drive -- the dumber you get.",
#ifdef PC_INSULTS
    "Listen, broccoli brains, I don't have time to listen to this trash.",
#else
    "Listen, burrito brains, I don't have time to listen to this trash.",
#endif
    "I've seen penguins that can type better than that.",
    "Have you considered trying to match wits with a rutabaga?",
    "You speak an infinite deal of nothing",

ins_goons.h (Goon Show insults):

.
    /*
     * Insults from the "Goon Show."
     */

    "You silly, twisted boy you.",
    "He has fallen in the water!",
    "We'll all be murdered in our beds!",
    "You can't come in. Our tiger has got flu",
    "I don't wish to know that.",
    "What, what, what, what, what, what, what, what, what, what?",
    "You can't get the wood, you know.",
    "You'll starve!",
    "... and it used to be so popular...",
    "Pauses for audience applause, not a sausage",
    "Hold it up to the light --- not a brain in sight!",
    "Have a gorilla...",
    "There must be cure for it!",
    "There's a lot of it about, you know.",
    "You do that again and see what happens...",
    "Ying Tong Iddle I Po",
    "Harm can come to a young lad like that!",
    "And with that remarks folks, the case of the Crown vs yourself was proven.",
    "Speak English you fool --- there are no subtitles in this scene.",
    "You gotta go owwwww!",
    "I have been called worse.",
    "It's only your word against mine.",
    "I think ... err ... I think ... I think I'll go home",

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:

strings /usr/lib/sudo/sudoers.so | head -n1670 | tail -n49

For other Ubuntu versions the line numbers passed to head command might change. Hopefully others can verify for their version.

Eliah Kagan
  • 117,780
  • 53
    I had no idea "broccoli" was considered more politically correct than "burrito." – fluffy Oct 15 '16 at 23:25
  • 10
    @fluffy I assume it's a reference to people who's national diet included burrito's. I now regret not censoring the code. I should have only used the PC_INSULT options and deleted the other half. On the other hand I don't like censorship of history like has happened with Tom Sawyer and books like that. Since these insults are from 2004 I would be guilty of censoring history had I removed the #ifdef sections. – WinEunuuchs2Unix Oct 15 '16 at 23:33
  • 8
    Don't worry too much about "censoring history" when talking about what terms we should use now. I can think of many many words that I used 40 years ago that were racially insulting, sexist, etc. I'm happy to refer to them in their historical context but thank god society has moved forward and recognzed the harm in many of these term. Yes please rant about politically correct if you want. Try being in a poor minority hurt by words first please. – Michael Durrant Oct 16 '16 at 11:22
  • 5
    There is no end to PC correctness. Any word can be considered offensive, and broccoli would not be PC in Peru for example... Burrito is an evident racial slur though. – Shautieh Oct 17 '16 at 03:04
  • 22
    Most people outside the US and probably some in the US would not see this as "an evident racial slur". To me, it's funny that whoever wrote this list of deliberate insults (that's the feature name!) actually cared about specific people getting really offended... there's no end to it, and if you are really concerned, don't enable this feature...?! – laugh salutes Monica C Oct 17 '16 at 10:51
  • @MichaelDurrant Technically I am a poor minority. It was not my intention to insult others like myself. – WinEunuuchs2Unix Mar 23 '24 at 00:05
  • @Shautieh It is a quite limited set of words. Using the argument "all words can be considered offensive" is a typical exaggeration used to try and make a point. However it is a very weak argument. Yes, words that are offensive are specific to a culture and a place and a time in history. None of that means we ignore the issue and just label anything we don't like as PC. Assuming we care about the impact of words on others. If, not, labeling PC is the way to go – Michael Durrant Mar 23 '24 at 12:39
85

With

dpkg -L sudo | xargs grep dumber

we can search which files from package sudo contain the word dumber.

The only match is in file /usr/lib/sudo/sudoers.so. This is a binary file so we use the strings command to only get things that looks like being human readable. As it's a lot we pipe the result into less:

strings /usr/lib/sudo/sudoers.so | less

In less we can use

/dumber

to 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

13

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.

chx
  • 697
8

To add to the other answers, the insults appear to be in the .rodata section of sudoers.so. You can use objcopy to somewhat restrict the output, although there will still be a lot of false positives:

$ objcopy /usr/lib/sudo/sudoers.so /dev/null --dump-section .rodata=/dev/stdout | strings | head
/build/sudo-g3ghsu/sudo-1.8.16/plugins/sudoers/auth/sudo_auth.c
invalid authentication methods
Invalid authentication methods compiled into sudo!  You may not mix standalone and non-standalone authentication.
There are no authentication methods compiled into sudo!  If you want to turn off authentication, use the --disable-authentication configure option.
Unable to initialize authentication methods.
Just what do you think you're doing Dave?
It can only be attributed to human error.
That's something I cannot allow to happen.
My mind is going. I can feel it.
Sorry about this, I know it's a bit silly.
$ 
Digital Trauma
  • 2,445
  • 15
  • 24
  • If you can tolerate lots of false positives, why not just use strings instead of objcopy? :) – Ruslan Oct 22 '16 at 14:18
  • @Ruslan: It already is objcopy | strings, to only scan the .rodata section of the text segment. What reduces false positives is increasing the minimum string length from the default 4 up to something like 10: strings -n10. And pipe into less, not head, IMO. All the insults seem to be contiguous, BTW. – Peter Cordes Oct 23 '16 at 10:49
  • Ah, I didn't scroll the code, to see strings was already used. – Ruslan Oct 23 '16 at 14:02
0

If you'd like to check the source code...

https://github.com/sudo-project/sudo/tree/main/plugins/sudoers

Check all the files starting with ins_

Majal
  • 7,711