Skip to content

Instantly share code, notes, and snippets.

@nickbytes
Last active May 10, 2021 19:50
Show Gist options
  • Save nickbytes/746af2cffb26a7ff5cb8c08628fe04ac to your computer and use it in GitHub Desktop.
Save nickbytes/746af2cffb26a7ff5cb8c08628fe04ac to your computer and use it in GitHub Desktop.
ssh-add is not persistent between reboots

If my machine unexpectedly reboots, my ssh keys no longer work. Initially I would go create new ones and add them to Github and other dev services.

$ ssh-add -l
The agent has no identities.

Bummer.

I didn't need to create new ssh keys, I just needed to add the existing back to the ssh-agent identities.

$ ssh-add -K [path/to/private SSH key]

Mine would look like

$ ssh-add -K .ssh/id_rsa

Nice.

This question answered everything for me. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment