MYL INSTITUTE

Your consulting partner for technology solutions, providing you with market research, industry insights for investment in Guyana where language isn't a barrier.

How to Generate and add a new ssh key to the ssh-agent

Posted by:

|

On:

|

,

Sometimes we need an extra hand on how to get things done. As you know technology is ever evolving and what worked yesterday might be deprecated today. With this in mind we are going to cover how to generate a ssh key for your computer system or server and then add it to the ssh-agent.

Firstly, open a new terminal window on your server. Perform the actions that follow:

Generate a new ssh key

1.$ssh-keygen -t ed25519 -C <your_email@example.com>
2.#Enter a file in which to save the key 
3.$(/home/YOU/.ssh/ALGORITHM):[Press enter]
4.#~/.ssh/ed25519
5.#Enter passphrase 
6.$(empty for no passphrase): [Type a passphrase]
7.$Enter same passphrase again: [Type passphrase again]
8.eval "$(ssh-agent -s)"

Add to ssh-agent

9.$ssh-add ~/.ssh/id_ed25519 
10.$cat ~/.ssh/id_ed25519.pub

And there you go! You’ve successfully generated and added your ssh key to the ssh-agent. Also, you can reference these steps here.

After adding the ssh key to the shh-agent you may want to add the shh key to your github account. See how to add a new ssh key to your github account.