Generate git ssh key and adding it to ssh-agent [Linux]

1- Open the terminal.

2- Generate new ssh keys using your email address

ssh-keygen -t ed25519 -C "[email protected]"

You will be asked for the path of the keys and keyphrarse which is used to secure your keys.

Generating public/private ed25519 key pair.
Enter file in which to save the key (/root/.ssh/id_ed25519): /root/.ssh/git
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/git.
Your public key has been saved in /root/.ssh/git.pub.

3- Start the ssh-agent in the background using the following command:

eval "$(ssh-agent -s)"

4- Add the ssh key to ssh-agent using the following command:

ssh-add /root/.ssh/git

5- Add the ssh key to github deploy keys

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Select your currency
USD United States (US) dollar