This error occurs because when you add a new key on GitHub, the ~/.ssh/id_rsa.pub content is copied incorrectly. Generally occurs under Linux, because Windows uses notepa++ to open this file and copy is generally not a problem, and Linux under the use of Vim to open and copy will be added to vim because of the addition of the key to add failure. The workaround is to use the cat command to output the. ssh/id_rsa.pub content to the terminal, and then copy it.
Check for SSH Keys
Ls-al ~/.ssh# Lists the files in your. SSH directory, if they exist
Generate a new SSH key
Ssh-keygen-t rsa-b 4096-c "[email protected]"# Creates a new SSH key, using the provided email as a label< c5># generating public/private RSA key pair.
Enter file in which to save the key (/users/you[press ENTER]
[Type a passphrase] [Type passphrase again]
Your identification have been saved in/users/you/.ssh/id_rsa. # Your Public key have been saved in/users/you/.ssh/id_rsa.pub. # The key fingerprint is:01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db [email protected]
Add your key to the Ssh-agent
# Start the ssh-agent in the backgroundeval "$ (ssh-agent-s)"# agent PID 59566
Ssh-add ~/.ssh/id_rsa
Source: https://help.github.com/articles/generating-ssh-keys/
GitHub SSH key key is invalid. Ensure you ' ve copied the file correctly solution