Get name (address) of computer from which from which SSH login was made.
- by amicitas
After logging onto a linux machine via SSH, I would like to be able to retrieve the name of the computer from which the connection was made. Ideally I am looking for some command like hostname or uname but that would retrieve the name of the client instead of the host.
This information must be accessible somewhere, since when I log on I get a message that contains the clinent name from the last login:
Last login: Thu Mar 11 18:42:01 2010 from my.address.com
The reason for wanting to do this is to be able to take different action in my .login file depending on which computer I am using for connection is from.