PDA

View Full Version : [SOLVED] customize sudo message (and others)?



fela
March 19th, 2011, 12:31 AM
Is it possible to customize this message:

user username isn't allowed to execute /bin/somecommand as root on host

I want it to say something like:

Sorry, that command is prohibited. Email sysadmin@myhost.com and ask him to allow /bin/somecommand

I'm guessing these kinds of messages aren't hard-coded into the program, right?

Cheers, Fela

BkkBonanza
March 19th, 2011, 10:55 AM
Try man sudoers - see strings section. It doesn't appear to have a string for when permission is denied but it does have a message (lecture) for first/every use and badpassword, which may be enough for what you need.

fela
March 19th, 2011, 09:15 PM
Try man sudoers - see strings section. It doesn't appear to have a string for when permission is denied but it does have a message (lecture) for first/every use and badpassword, which may be enough for what you need.

Thanks, I managed to make it give a good enough lecture for what I needed :)

earthdan
October 6th, 2011, 12:59 PM
Please explain... I am having same problem.