Checking for a remote login

At a command prompt window execute hostname:

% ./hostname

You are remotely logged in if the hostname is anything other than the machine where you are sitting.