1

I've developed a bad habit of constantly sudoing to root. I was wondering if its possible to create an alias that prevents straight sudo but allows sudo -u. Or possibly echoes a warning when using sudo?

Jeff Ferland
  • 20,547
  • 2
  • 62
  • 85

1 Answers1

4

This is a people problem, but...

By default sudo gives a warning when asking for your password ("with great power comes great responsibility etc etc")

You can use a custom sudo lecture file to setup a custom warning.

In /etc/sudoers

Defaults lecture_file=/home/user/lecture lecture=always

Sirex
  • 5,499
  • 2
  • 33
  • 54