- If I'm on a desktop 22.04 system, and open a terminal,
who,w, andlast -f /var/run/utmpall report that nobody is logged in. - If I
sudothose 3 commands they all report that I'm logged in. - If I
sshto a remote 22.04 system, these 3 commands correctly report anyone connected overssh, whether or not the commands aresudo'ed.
So what's the story here? There's nothing in the man pages about this, and man who unhelpfully states that "The who utility shall list various pieces of information about accessible users. The domain of accessibility is implementation-defined."