« Back to SSH: Frequently Asked Questions

How to add a SSH key to the SSH agent

When the SSH agent is running, the ssh-add command can be used to load a SSH key. The SSH agent then will request a password when needed, and load the key details in memory.

Adding the SSH key just requires the path to the private key.

ssh-add ~/.ssh/id_ed25519

When the key is loaded, use the -l or -L option to show the identities that the SSH agent has.

ssh-add -l


Could not open a connection to your authentication agent

Most likely your SSH agent is not running. Check if the process is running. If not, start the agent:

eval $(ssh-agent)

Other questions related to SSH


Is the described answer not working or incorrect, got another tip or question? Share your thoughts!