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?
I have not tested this but if bash was interactive you will find a
.bash_history file in their $HOME.
That assumes that they have not logged in - ie only ever sudo.
> Thanks.
>
> -Tom
--
Alain Williams
Linux/GNU Consultant - Mail systems, Web sites, Networking, Programmer, IT Lecturer.
+44 (0) 787 668 0256 https://www.phcomp.co.uk/
Parliament Hill Computers. Registration Information: https://www.phcomp.co.uk/Contact.html
#include <std_disclaimer.h>
Reply to: