Keeping the fancy sudo warning forever

Create a file inside /etc/sudoers.d/ You can use this command

sudo nano /etc/sudoers.d/privacy

Now paste this line into the file.

Defaults        lecture = always

Now close Terminal/Konsole, Reopen it and try to do something with sudo.


To re-set an account to see the warning once more, delete the sudo records for that user.

root>  rm  /var/lib/sudo/<username>/*
root>  rmdir /var/lib/sudo/<username>

To add to +Michael JAMES his statement, locations might vary. On Fedora,

rpm -ql sudo

Shows a directory called:

/var/db/sudo

In this directory i found another directory called 'lectured' followed by my name. Removing my name from this directory show the warning again.

Edit: This is a one time solution to reset showing the message. You could of course use crontab to empty the directory so that the message is printed on a more regular basis.

Tags:

Linux

Sudo