Is it possible to get the users ip address, domain name, or host-name of an established ssh connection in the shell? For example, when I connect over ssh the first printed line says something like this:
Last Login: Sat Fri 17 19:00:00 2012 from some.website.net
Is there an environment variable created or a way to access
some.website.net or the ip address of the connected client. Preferably I would want
some.website.net, but I might be able to make do with an ip address.
For your information, I plan to use this in order to automatically select the appropriate .tmux.conf file so that the statusline is less busy and can accommodate a smaller resolution screen i.e. a smartphone screen.
-- further details:
I am particularly interested in using this on an OSX computer, but it would be nice to have an OS independent solution.