# known_hosts

*noun*

say it: **“NOHN HOHSTS”** **/ˈnoʊn ˈhoʊsts/**

The file where ssh keeps the keys of the servers you've already connected to, so it can recognize them next time.

## What is the **known_hosts** file?

`~/.ssh/known_hosts` is ssh's list of computers you've met: one line for each server you answered yes to, with its host key. Next time, ssh checks the server against it. `ssh-keygen -R` removes a server's line, after a rebuild its owner told you about.

```bash
ssh-keygen -R localhost   # forget localhost's key: ssh asks again next time
```

## In a sentence

- “ssh-keygen -R removes a server's line from **known_hosts**.”
- “Answering yes added a line for localhost to Sam's **known_hosts**.”

Level: Journeyman · [More Unix terms at this level](https://www.ask-codey.com/glossary?category=unix&level=3)

Updated: November 10, 2026

Source: https://www.ask-codey.com/glossary/known-hosts
