Sudoers list?

Janne Jokitalo janne.jokitalo at dnainternet.net
Tue Apr 4 19:45:30 UTC 2006


Daniel Carrera wrote:
> Matthew R. Dempsky wrote:
> 
>>> I'm writing a script. How can I find out, from the script, if the
>>> current user is in the sudoers list?
>>
>>
>> This may be of help, from sudo(1):
>>
>>         -l  The -l (list) option will list out the allowed (and
>>             forbidden) commands for the user on the current host.
> 
> 
> The problem with that is that you need sudo access to run it. If I knew
> I could run that command I would already have the information I need :P

Yeah, but providing user's password gives the output of:

Sorry, user xxxx may not run sudo on localhost.

...if the user is not in the list.

If I'm not completely mistaken. :)


-- 
Jaska




More information about the ubuntu-users mailing list