I'm currently experiencing an issue when connecting to a remote university Ubuntu machine using SSH (I'm using VS Code as the SSH client if it matters). Upon initial connection, it prompts me to trust the device, I do so, and I'm able to connect. However, a day later I try to reconnect and it throws an error stating that the host identity of the machine has changed.

I SSH into the machine using the DNS name. So regardless of it's IP address changing, it should always direct me to the same physical machine. Note, the machine I'm SSH'ing into is a physical desktop machine, not a VM or cluster.

So I'm curious, assuming I'm connecting to the same physical machine. Why would SSH think the remote host has changed? If the IP address of the same physical machine changes, does that result in an identity change?

  • Has the remote machine been updated, reinstalled, or had its SSH service removed and reinstalled? You'll get this if the remote machine's SSH host keys have changed. Have the IP of the machine peviously been used by another machine that you have SSH'd into?
    – Kusalananda
    Dec 24, 2021 at 20:09

1 Answer 1


The short answer is yes. If the machine's IP changes, it'll be an unknown host down the line.

The known hosts are kept in .ssh/known_hosts.

Also note, that known hosts hashing can be enabled in /etc/ssh/ssh_config, so your hosts file might look slightly different from what you're normally used to.

Also you can set CheckHostIP to no in the same config file to disengange IP checking.

Also see: https://serverfault.com/questions/193631/ssh-into-a-box-with-a-frequently-changed-ip/895661#895661

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .