Signing back into the Community for the first time? You'll need to reset your password to access your account.  Find out more.

Forum Discussion

Former Member's avatar
Former Member
3 years ago

Difference to save the public key to config and known_hosts?

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

  • Jack_P_1P's avatar
    Jack_P_1P
    Icon for 1Password Team rank1Password Team

    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