-   Linux - Newbie (
-   -   Usage of sudo (

pandunr 05-27-2011 10:46 AM

Usage of sudo
Is it possible accept justification before password for Sudo login

Ex :

Login : ABCDEF
Password: *******
Sudo su - applicationid
Justfication : Sustain
ABCDEF Paswword : ******

Is it possible to configure in Linux as explained above.

Immediate suggestion very much appreciated.

acid_kewpie 05-27-2011 11:06 AM

no. I'd suggest that if you want that level of control letting them only execute a wrapper script via sudo and have that script ask for the input.

MBybee 05-27-2011 11:15 AM

I assume this is for some sort of 'logging'? Like "why did you run sudo"?

I'd agree with acid_kewpie there. I would recommend a wrapper (easily implemented in visudo). Expect a lot of nonsense or non-useful responses :)

acid_kewpie 05-27-2011 12:51 PM

if you do do this, be aware of a number of useful environmental variables, e.g. SUDO_USER etc, which you can use with a script to find out who is using sudo from the inside:

      SUDO_COMMAND    Set to the command run by sudo

      SUDO_USER      Set to the login of the user who invoked sudo

      SUDO_UID        Set to the uid of the user who invoked sudo

      SUDO_GID        Set to the gid of the user who invoked sudo

All times are GMT -5. The time now is 05:43 PM.