Create SSH Key:

 ssh-keygen -t rsa -b 4096 -f ~/.ssh/git1 -C "my@mail.com"

-t: rsa

-b: 4096

-C: for login email

Passphrase: Do it!

Setup SSH Agent:

 eval "$(ssh-agent -s)"

now set it to use the key we just generated:

ssh-add ~/.ssh/id_rsa

To list the ssh-keys

ssh-add –l
ls -l ~/.ssh

 

To remove a key from the ssh-agent,

$ ssh-add -d /home/user/.ssh/id_rsa

To remove all

$ ssh-add –D

 

Keeping the private keys secure is important. It is suggested that the ssh-agent is terminated or locked when it is not needed anymore.

# kill the ssh-agent

$ eval $(ssh-agent -s -k)

Agent pid 24329 killed

 

SSH Key to GitHub:

MacOS:

pbcopy < ~/.ssh/id_rsa.pub

Windows:

clip < ~/.ssh/id_rsa.pub

ssh -T git@github.com

https://blog.tinned-software.net/manage-ssh-keys-with-the-ssh-agent/
ধন্যবাদ!
সাবস্ক্রাইব করুন ও লাইক দিন
courtesy: pixabay.com