“Key is invalid” message on GitHub

后端 未结 18 2020
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-30 01:49

I have generated SSH keys for a new server installation according to the procedure outlined here. However, when I copy the contents of id_rsa.pub to my keys list on

相关标签:
18条回答
  • 2021-01-30 02:45

    I was trying to upload my public key and was getting "Invalid Key" message.My format was not proper as there was extra spaces at the end of the key. It should be in format : ssh-rsa <public-key>

    0 讨论(0)
  • 2021-01-30 02:47

    Someone suggested to use $ vi ~/.ssh/id_rsa.pub however it didn't work for me.

    So instead of that , I used $ cat ~/.ssh/id_rsa.pub command on windows machine to print out on the terminal then copy it.

    0 讨论(0)
  • 2021-01-30 02:47

    In windows,

    Just Copy the naked key data from key file and remove new lines. Write this below things in dialogue box to solve your problem. ssh-rsa Key

    NOTE : There is space between ssh-rsa and key

    And you are done.

    0 讨论(0)
  • 2021-01-30 02:47

    I was having the same issue, despite copying the public key from cat output directly from the terminal (Cmder/ConEmu). It seems that the method that you use to copy the public key seems to make a difference. Here is a way to check:

    $ ssh-keygen -l -f ~/.ssh/id_rsa.pub
    4096 SHA256:...
    

    Then paste the key that fails into a new file, and try to verify that:

    $ ssh-keygen -l -f test.pub
    test.pub is not a public key file.
    

    In my case I had been copying the key from terminal output using cat; instead getting the key from vim worked. Here is way to open the key in vim with word wrap enabled:

    $ vim "+set wrap" ~/.ssh/id_rsa.pub
    

    I suspect that the terminal emulator may have something to do with it as I haven't had this issue with Terminal.app.

    0 讨论(0)
  • 2021-01-30 02:51

    If you using Sublime you can see ssh-key correctly. Check if there is any id_rsa.pub

    ls -al ~/.ssh
    

    If it is in place open it with sublime text

    sudo subl /home/user_name/.ssh/id_rsa.pub
    

    Then copy and paste your public ssh key.

    0 讨论(0)
  • 2021-01-30 02:52

    I came here because I had the same problem. From your question, I realized that I was copying the contents from the wrong file, without the .pub extension (it was my private key, i.e. the id_rsa file, which should be kept private at all times!)

    From a MAC:

    vi ~/.ssh/id_rsa.pub
    

    Copy exactly from the end (with be the last letter of your email domain extension) of the block of characters to the beginning, which starts with ssh-rs ...

    If it doesn't work, you are surely not copying properly.

    It worked.

    If you are on Windows, use notepad and copy-paste as described above.

    I hope that helped.

    0 讨论(0)
提交回复
热议问题