How to add a SSH key to the SSH agent
How to add a SSH key to the SSH agent?
Use the ssh-add command and provide the relevant SSH key to add it to the SSH agent.
ssh-add ~/.ssh/id_ed25519When 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
Errors
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)