Open In App

When sudo insults you!!

Improve
Improve
Like Article
Like
Save
Share
Report

An interesting sudo feature is the ability to insult you (not literally) when you type a wrong password and it has some really funny phrases to insult you. You can define sudoers insults option or several others in the file below. It is set under defaults entries section.
Start by opening the file /etc/sudoers using below command:

$ sudo visudo

Go to the defaults section and add the following line:

 Defaults insults

Below is a sample of /etc/sudoers file on my system showing defaults entries:

1
From the screenshot above, you can see that there are many other defaults defined such as send mail to root when each time a user enters a bad password, set a secure path, configure a custom sudo log file and more. Save the file and close it. Open a new terminal window and run any command with sudo and type a wrong password.
Here i’m running

sudo apt-get update

2
When you configure the insults parameter, it disables the badpass_message parameter which prints a specific message on the command line (the default message is “sorry, try again”) in case a user enters a wrong password.

To modify the message, add the badpass_message parameter to the /etc/sudoers file as shown below.

4

Save the file and close it, then invoke sudo and see how it works, the message you set as the value of badpass_message will be printed every time you or any system user types a wrong password.

3

 


Last Updated : 13 Sep, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads