Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was wondering if it is somehow possible to lookup the ip of a machine I ssh'd into from. This is the scenario, I'm at home, I've VPN'd into a server that I ssh into constantly in the office but now I want to ssh into the machine that I use locally.

If that doesn't make sense hopefully this will. In the office I use my desktop a *nix box to ssh into a server. Now that I'm at home I want to ssh into that *nix box through the server but I don't know the IP of that local box, is there a log somewhere that might keep track of that sort of information.

share|improve this question
up vote 8 down vote accepted

you can use the last command to figure out all the connections and where from. append the -a flag so the host/ip doesn't get cut off.

last -a
share|improve this answer
That's fantastic thanks! – Mark D Aug 28 '11 at 2:30
Don't thank, upvote and/or accept. – rozcietrzewiacz Aug 28 '11 at 2:35

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.