Wanna get insulted by sudo

Apr 03, 2016

You might have tried many Linux easters eggs for fun, but you are going to love this hack which makes sudosudo insult you.

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

A terminal screen

Now you might be thinking, why would anyone want to take insult? Afterall, nobody likes being insulted. For me, it is just another way to have fun with Linux, and anyway, this is way better than the plain "You entered a wrong password" error message. So let's learn how to do this.

Enable insults in sudo

You can enable the insults feature in sudosudo by modifying the sudosudo configuration file. To open the sudosudo configuration file, launch a terminal and type the following command.

sudo visudo
sudo visudo

It will open /etc/sudoers/etc/sudoers configuration file in the terminal, in vim text editor if you have configured it as your default editor. In distros like Ubuntu, it will be opened in nano. Now you will have to find the section where the defaults are listed. Most probably you will find it at the top. Now find the line that starts with DefaultsDefaults and append the word insultsinsults to the end of the line (any addition to the line is comma separated). If this line is not present then add the following line to the section

Defaults insults
Defaults insults

(Always use visudovisudo as it has a self-check system which will save you from messing up things)

Now save the file. If you are using vim, then use Ctrl+XCtrl+X to save the file and quit the editor and if you are using nano then use Ctrl+XCtrl+X to leave the editor. At the time of quitting, it will ask you if you want to save the changes. To keep the changes, press YY.

Sample sudoers file
Sample sudoers file

Once you have saved the file, go to terminal and type the following command to clear the old password from sudosudo's cache.

sudo -k
sudo -k

That's all. Use any command with sudosudo. Deliberately type a wrong password and enjoy abusing …