GitHub SSH key key is invalid. Ensure you ' ve copied the file correctly solution

Source: Internet
Author: User
Tags github ssh key

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.