4

One of the PC's on my home net has the hostname '3770k', because that's the model of its CPU.

I usually type 'ssh 3' and hit tab to autocomplete the connection.

I just realised I now have two entries starting with a 3: my regular 3770k one and also 35.156.197.162.

It appears when I try ssh, scp and rsync. It traces to Ann Arbor, Michican. I'm in the UK and have never knowingly connected to a PC in Michigan.

Any idea what I've done? Is there a config file I might have accidentaly appended this address to? I've looked in ~/.ssh/config and it isn't there. I haven't accidentally created a file named after the IP. If I try to ping this mystery address I get no reply.

There's a colon after it if I autocomplete it with ssh, so my PC seems to think it's a network location.

  • 4
    It's an Amazon cloud host. Have you used one of those? Check your ~/.ssh/known_hosts file. – Kusalananda Jan 1 '17 at 19:31
8

It appears as if Bash is using the known_hosts file in $HOME/.ssh for its auto-complete under some circumstances.

If you have connected using SSH (i.e. using ssh, rsync, git with SSH, or any other utility that uses SSH) to this host, which is an Amazon cloud host, then it's reasonable that the IP address is written to this file, and picked up by the bash auto-completion sub-system.

If the IP address is in there, you should also be able to figure out the human readable hostname that you used when connecting to the host (it will have the same SSH fingerprint in the file).

  • Bingo! I was messing around with Amazon cloud storage the other day and it is indeed in ~/.ssh/known_hosts – bitofagoob Jan 1 '17 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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