Last updated:

Fun with sassy sudo

Sudo is often used in system administration but is otherwise a pretty boring tool. If you mistype your password, you get to see the following message:

[sudo] password for user:
Sorry, try again.

Only recently I discovered that there exists an easter egg that permits sudo to randomly insult users upon failed password attempts. This is by default disabled. However, if you explicitly enable it and mess up your password, sudo may print:

[sudo] password for user:
Wrong!  You cheating scum!


[sudo] password for user:
stty: unknown mode: doofus


[sudo] password for user:
You type like i drive.

How to enable this

If you would like to give your sudo a bit of sass, you can enable this easter egg by editing /etc/sudoers (using visudo as root) and adding the following line:

Defaults insults

As always with anything related to sudo, take extra care when modifying the contents of the file otherwise you may end up locking yourself out of root access.

If you are curious like me and do not want to wait until a failed password attempt, you can find all insulting messages embedded inside the /usr/lib/sudo/ binary. They can be displayed along with all other strings using the strings tool:

$ strings /usr/lib/sudo/ | less

Hope this little tip makes your sudoing a bit more fun!