SSH - Known Hosts File

> SSH (Secure Shell) - Remote Access

1 - About

Known Hosts File is a client file that lists all known remote host and is used by the ssh client

3 - Format

known_hosts
hostname algo public_key
hostname,ip algo public_key

where:

Advertising

4 - Example

192.168.1.20 ecdsa-sha2-nistp256 public_key
gerardnico.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABA............
# Comments allowed at start of line
closenet,...,192.0.2.53 1024 37 159...93 closenet.example.net
cvs.example.net,192.0.2.10 ssh-rsa AAAA1234.....=
# A hashed hostname
|1|JfKTdBh7rNbXkVAQCRp4OQoPfmI=|USECr3SWf1JUPsms5AqfD5QfxkM= ssh-rsa AAAA1234.....=
# A revoked key
@revoked * ssh-rsa AAAAB5W...
# A CA key, accepted for any host in *.mydomain.com or *.mydomain.org
@cert-authority *.mydomain.org,*.mydomain.com ssh-rsa AAAAB5W...

5 - Location

home\.ssh\known_hosts

5.1 - Windows

Ie:

  • User: C:\Users\${login}\.ssh\known_hosts
  • System: C:\Windows\System32\config\systemprofile\.ssh\known_hosts

5.2 - Linux

  • User scope ~/.ssh/known_hosts
  • System scope /etc/ssh/known_hosts

6 - Implementation

7 - Documentation / Reference

Advertising
ssh/known_hosts.txt · Last modified: 2019/01/23 15:32 by gerardnico