Make Sudo Insult User For Each Incorrect Password Attempt

You can have lots of fun in the Linux terminal. And I am not talking about those funny commands to run a train in Linux terminal.

I am talking about little tweaks in the terminal that will lighten up your mood. In a previous article, you learnt how to increase sudo timeout in Linux terminal. In today’s fun post, I’ll show you how you can make sudo to insult you (or other users) when incorrect password is attempted with sudo command.

Confused what I am talking about? Here, take a look at this gif to get a gist of how sudo can insult you for typing in the incorrect password.

sudo insults in Linux terminal

Now, why would you do that and take insults? After all, insults are not going to brighten up your day, is it?

To me, this little tweak is funny and is better than the plain old “incorrect password” error message. Moreover, I can show it off to my friends (in this case you, via It’s FOSS) to amuse them. I am pretty sure you can come up with your own reason to use this tweak.

Enable insults in sudo

You can enable insults in sudo by adding the following line in sudo configuration:

Defaults 	insults

Let’s see how to do that. Open a terminal and use the following command:

sudo visudo

This should open the configuration file in nano. Yeah, I know that traditionally ‘visudo’ should open the /etc/sudoers file in Vi editor, but Ubuntu and Ubuntu based Linux distribution will open it in nano editor. Since we are talking about Vi, here is a cheat sheet for Vi editor that could come handy if you decide to use Vi.

Coming back to editing the sudeors file, you need to find the section where Defaults are listed. Luckily, it is in the beginning itself. Just add “Defaults insults” line to it, like this:

edit the sudoers file to insult you

If you are using nano, use Ctrl+X to quit the editor. At the time of quitting, it will ask you if you want to save the changes or not. To save the changes, press Y.

Once you have saved the changes in sudoers file, open a terminal and use any command with sudo. Deliberately type wrong passwords and enjoy the abuses :)

Speaking of password, I hope you know how easy it is to change the sudo password in Ubuntu.

sudo could be nasty. See, it even threatens me of consequences if I type incorrect password again. LOL.

sudo insults funny Linux command

If you like this terminal hack, check out other terminal tricks posts as well. If you have other such fun tweaks and hacks, do share it in the comment box below.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world


Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.