🔑known_hosts
Also known as known_hosts File, ~/.ssh/known_hosts, Known Hosts
A file on your computer with each server's key. SSH uses it to spot a fake.
Think of it like
Think of it like a guest book of faces. Next time someone comes, you check the book.
Example
Emma's server was rebuilt on purpose. She removes its old line with ssh-keygen -R, then logs in and trusts the new key.
Why it matters
Definition
Example code
console
$ ssh-keygen -R 203.0.113.10
# Host 203.0.113.10 found: line 4
/home/emma/.ssh/known_hosts updated.Common mistake
Key takeaways
- 1Your side. Lives in your .ssh folder.
- 2One line per server. Address and host key.
- 3Remove one line. Use ssh-keygen -R.