I have generated ssh key.
The result was:
Your identification has been saved in /home/rajani/.ssh/id_rsa.
Your public key has been saved in /home/rajani/.ssh/id_rsa.pub.
The key is in hexa decimal format, but while adding it to GitHub, I am getting error like this:
Key is invalid.
It must begin with 'ssh-rsa' or 'ssh-dss'.
Check that you're copying the public half of the key .
How I should properly add an ssh key to GitHub?
This error comes up when using a wrong private key or no key at all when trying to connect via SSH. To resolve the problem, you should generate a new key pair and connect using that new set of keys.
"Permission denied (publickey)" and "Authentication failed, permission denied" errors occur if: You're trying to connect using the wrong user name for your AMI. The file permissions within the operating system are incorrect on the instance. The incorrect SSH public key (. pub) file is in the authorized_keys file.
2 suggested answers With OpenSSH the public key should be in a file with a name ending in . pub , and the content should start with ssh- , followed by the key type (e.g. rsa or ed25519 ).
Of course, man 1 ssh-keygen
is your friend.
You should add the "hexa decimal part" and put "ssh-rsa " in the front, that should do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With