Re: Using the bash shell: determine if the root user used 'sudo -i'
On Sat, Aug 26, 2023 at 09:25:10AM -0500, Tom Browder wrote:
> In a previous thread it was shown how to detect a SUDO_USER in a bash
> shell.
> Is there a way to distinguish whether 'sudo -i' was used or not?
> Thanks.
> -Tom
The SUDO_COMMAND environment variable would report /bin/bash in that
instance. Would that be sufficient for your needs?
If not, then what exactly are you trying to accomplish? Please don't say
"I want to know if sudo -i was used" because we already know that. Why
is that a necessary piece of information in your use case? What will you
do with that information? What decision will you make? What action will
you take?
Regards,
-Roberto
--
Roberto C. Sánchez
Reply to: