I would like to detect whether the current user session is from an SSH connection - that is, whether the user is physically sitting at the computer that hosts the current terminal or whether he is remotely connected through SSH?
Is there an easy way to do this, preferably through a bash-scriptable method?