drosofff
8/31/2016 - 12:43 PM

How to generate a private/public ssh key pair and share it for ssh connection

How to generate a private/public ssh key pair and share it for ssh connection

ssh-keygen -t rsa -b 4096 -C "drosofff@gmail.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/github_id_rsa
cat github_id_rsa.pub
# this public key can be shared for secure transactions

In addition to the generation of the key pair with ssh_key_pair.sh, to get it permanent, I had to put these lines in my .bashrc config file:

eval `ssh-agent -s`
ssh-add ~/.ssh/id_github