Take the tour ×  I am trying to run a script that connects to a
ssh server over two different ports (one normal and one over a
known non-default port). But the ssh server is given back two
different fingerprints which breaks my script.  Is there a way
to avoid this (having two different entries in 'known_hosts' for
different ports)? Or the only way out is to talk to the admin?
PS: Nothing hacky - just trying to get Gerrit to run on my local
desktop instead of a server.  share|improve this question add
comment  1 Answer  up vote 0 down vote accepted  The problem
occurs when you have two different adapters - one working as NAT
and other working as a normal adapter.  This happened to me when
I was using ssh from two different ports on a virtual machine.
The VM was configured with NAT and Bridged adapter.  When I
tried to ssh on default port, NAT was being used, giving me a
different fingerprint than when I trying to ssh via non-default
port (for which bridged adapter was getting used).  HTH for
those who run in