Difference to save the public key to config and known_hosts?

Options
rstolpe
rstolpe
Community Member

Hi,
I'm running 1password on my Mac and I'm wondering that's the real difference to edit the .ssh/config or .ssh/known_hosts for adding the public key?
For .ssh/config you describe it here in your article.
https://developer.1password.com/docs/ssh/agent/advanced/#match-key-with-host

Host github.com
IdentityFile ~/.ssh/public-key-downloaded-from-1password.pub
IdentitiesOnly yes

But if you write it in known_hosts you can write it like this:
github.com PUBLICKEYSTRING

So, what's the difference?


1Password Version: Not Provided
Extension Version: Not Provided
OS Version: Not Provided
Browser:_ Not Provided

Comments

  • Hi @rstolpe:

    Great question. Configuring which public key to use for authentication is done in .ssh/config, whereas known_hosts is used for your device to verify that you're indeed connecting the server you expect.

    Jack

This discussion has been closed.