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 learned how to increase sudo timeout in Linux terminal. In today’s fun post, I’ll show you how you can make sudo insult you (or other users) when an incorrect password is attempted with the sudo command.
Confused what I am talking about? Here, take a look at this example to get a gist of how sudo can insult you for typing in the incorrect password.
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 the 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 distributions will open it in nano editor. Since we are talking about Vi, here is a cheat sheet for Vi editor that could come in handy if you decide to use Vi.
Or you can use the command below to open it in nano:
sudo EDITOR=nano visudo
Coming back to editing the sudoers file, you need to find the section where Defaults are listed. Luckily, it is in the beginning itself. Just add a “Defaults insults” line to it, like this:
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 and then press Enter.
Here's a replay of the above process.
Once you have saved the changes in the sudoers file, open a terminal and use any command with sudo. Deliberately type wrong passwords and enjoy the abuses :)
In the end...
Speaking of incorrect passwords, I hope you know how to change the sudo password in Ubuntu.
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 them in the comment box below.