2

The title says it all. How can I configure sudo to prompt for password and show the executed command?

Rationale: if something gets aliased in the shell or I end up executing a function sudo instead of the program, I would still like to see the actual sudo (i.e. /usr/bin/sudo on Ubuntu) is going to execute before I do it. This is mostly for security reasons, i.e. I would configure this only for certain types of impersonation via sudo.

Bonus points: if this can be configured, is it also possible to use it with NOPASSWD: inside /etc/sudoers?

1
  • It appears that the default action is to write the command to /var/log/auth.log. So you could write a bash function to parse the last sudo command by your UID. Downside is that you have to be a member of the adm group to view the auth.log file. Probably an enhancement request to the package maintainer. Jun 11, 2013 at 2:38

0

You must log in to answer this question.

Browse other questions tagged .