Known Host keys should be bound to hostname AND port
Currently, it appears that only one host key is stored for each hostname. However, when you have multiple VMs on the same hypervisor, all accessible from the same IP but on different ports, the known host entry for that IP / hostname is modified each time you connect to a different VM.
Example how to reproduce:
VM1 running on hypervisor:12345
VM2 running on hypervisor:22222
- Connect to hypervisor:12345 in Termius
- Check Known Hosts entry of hypervisor. It contains the host key for VM1
- Connect to hypervisor:22222 in Termius
- Termius warns that hypervisor's host key changed
- Confirm warning
- Check Known Hosts entry of hypervisor. It contains the host key for VM2
Proposed solution:
- Store host keys for "$host:$port" instead of "$host". In the example above, I would expect two entries: "hypervisor:12345" and "hypervisor:22222", just like every other SSH client does it.
- Optional: If there is only one entry with port 22 for a host, just show the hostname in the known host list, and omit the port.
