Would it be possible that when a normal user logs in to root via
su command an email notification will be sent?
|show 2 more comments|
A solution would be creating a script which sends an email and executes a shell:
Be sure to protect this script against any access from unprivileged users (see the lower part of this answer)!
Then force privileged user joe to execute the script via restrictive
An example for
Now joe can call
However, be aware that once joe gets the root shell he owns your system, i.e. nothing keeps him from modifying your script, the sudoers file, and so on.