Get name (address) of computer from which from which SSH login was made.
Posted
by amicitas
on Super User
See other posts from Super User
or by amicitas
Published on 2010-03-12T09:21:45Z
Indexed on
2010/03/12
9:27 UTC
Read the original article
Hit count: 188
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.
© Super User or respective owner