Wanna get insulted by sudo

/ / 2 min read / in Linux

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

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

insult

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 sudo by modifying the sudo configuration file. To open the sudo configuration file, launch a terminal and type the following command

sudo visudo

It will open /etc/sudoers configuration file in the terminal, in vim text editor if you have configured it as your default editor. In ubuntu like distros, 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 Defaults and append insults to the end of the line (any addition to the line is comma seperated). If this line is not present then add following line to the section

Defaults insults

(Always use visudo 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+X to save the file and quit the editor and if you are using nano then use Ctrl+X to quit the editor. At the time of quitting, it will ask you if you want to save the changes. To save the changes, press Y.

 

Sudoers Configuration File

Once you have saved the file, go to terminal and type the following command to clear the old password from sudo memory

sudo -k

That’s all. Use any command with sudo. Deliberately type wrong password and enjoy abusing…

Comments