If I use a login shell to login as root
then ‘who’ or ‘users’ commands
will show an entry for the root user.
However If I login with user1 and then use:
'su - root'
Then the ‘who’ and ‘users’ command will not show an entry for root.
Is there a way to find out whether there is a logged-in user in my system that has currently switched to root (or to any other account)?
Thanx to Davide Berra’s answer, I think I have found what I was looking for.
The output is something like: