Auto Find SSH Keys - 08-12-20

I use to always pass a key when sshing ex:

$ ssh -i ~/.ssh/de2

That can be a bit annoying. I know two fixes:

add private key to ssh-agent

$ ssh-add ~/.ssh/de2

Now when you ssh you need not include the -i ~/.ssh/de2 because the ssh-agent will find it automatically.

*note: this resets once you reboot

configure individual host

You can configure individual hosts to use a spefic private key my editing your ~/.ssh/config:

Host de2
    User travis
    IdentityFile ~/.ssh/de2

Now you only need to

$ ssh de2

source –

\- [ ssh ]