SSH known host file should store port as well as host

Bob Proulx bob at
Sat Apr 2 11:19:42 EST 2005

Darren Tucker wrote:
> maximander wrote:
> >Hello all, i just discovered that the known hosts file seems to only
> >store the server finger prints for distinct *hostnames/IPs*, not
> >hostnames/IPs and ports, meaning i can't ssh to a multiple boxes on
> >the same host even if they have different ports. Every client other
> >than the one shipped with openSSH seems to work fine, presumably
> >because they store fingerprints by host:port combinations rather than
> >only by host. Would it be possible to modify the openSSH client to
> >also store fingerprints by distinct host *and* port?
> See
> In the mean time, check out the CheckHostIP and HostKeyAlias options in 
> the ssh_config(5) man page.

To give a concrete example for the original poster.  I have a similar
situation and use the following stamp.

  Host foo
    CheckHostIP no
    Port 2020


More information about the openssh-unix-dev mailing list