How to generate ssh keys (for github)
Step 1: Generate Your SSH Key
$ ssh-keygen -t rsa -b 4096 -C "[email protected]"
Step 2: Use the Key
$ eval $(ssh-agent -s)
Then add the key we just generated. If you selected a different path than the default, be sure to replace that path in the command.
ssh-add ~/.ssh/id_rsa
Step 3: Add the SSH Key on GitHub
clip < ~/.ssh/id_rsa.pub
if clip not found then add the next command
cat ~/.ssh/id_rsa.pub
Finally Result something like on your cmd
ssh-rsa AAAAB3NzaC1yc2EAAAAD173Oe1kp0Ojnsn7sRWt/XT5nFH3CSTv6VWyxq4YUJ4ZykWa5opyiAJmvtjxOMCmVTuX2r1T4Livn0foHGt7+66FJXrXUQgyJ4RXanufb3bAekxbFPg3S6Gyr2kk+I3TYWcFsLLwjU0VVJwodQkpyygAUzhomx9OQ0FMpfkQa5VrZnaSLjjtNOUSAaq30e7JWYxtoVih2HfVkcmqc53QjY4T3Xb0cmLZF3EmwCeB66dgJtpTNMvM54ceD30INsaMFNqG8XjbJtGUCHYEIR5l/LI20K5F25BRTnCzRV9dB5FUJ8taVMGRHJob9PDUdxpA2HEJYilm8ZbLbRmKJtU+H91WNCG6pvy9Yf9MREkOZQHcWIuAsH8uJvTTbqm1eAY2g34FjarRdqZIpvdxkrErDHqh4k42owNEmHjSaAw53Y8M54fjBdFHTjGDqHBamlKcIzQbin/czFq1a+pgopIANDhZjWZNvMiTak7BjVrVOciKD3Pa/KKy03nSEfEGExLbFEi1Q8QEGd6idtUAjL7fyVPWatRwCnOvGLMPTk73m7t0IAYTm4n7dO0S5OeWTUPTT+8vIfFCmE9OT2aJDIpZY1+f8Q== [email protected]
copy from your cmd and go to your GitHub account setting find ssh and gpg keys
Here is the command
ssh-keygen -t rsa -b 4096 -C "[your github's email]"
# Creates a new ssh key
# Generating public/private rsa key pair.
This will generate a key for you. You have to copy that and insert into your Github's account (just one time).
Steps how to do It
The command to run is only
ssh-keygen -t rsa -C "[email protected]"
All the rest beginning with line 2 of your script is the output of ssh-keygen.
And replace [email protected] with your email address.
Have a look at the manual for ssh-keygen
to look for additional options. You should probably use a longer key by adding -b 4096
to the option list.