who called sudo ?

Raj Kiran Grandhi grajkiran at gmail.com
Sat Mar 15 13:27:08 UTC 2008

dave selby wrote:
> Hi all,
> I am writing an install script that needs to be root, its started with
> sudo install.py
> It needs to know who was the user that executed 'sudo install.py' ...
> any ideas how I get that info from the shell or sudo command ?

import os
print os.environ['SUDO_USER']

Raj Kiran Grandhi
At the source of every error which is blamed on the computer, you will 
find at least two human errors, including the error of blaming it on the 

More information about the ubuntu-users mailing list