Permission denied /// generated ssh key must begin with

ssh
github

#1

Hello everyone! Hope one of you geniuses can help me out.

I cant push anything to my github. When I try I get:

"Permission denied (publickey). fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists. "

I’ve generated a key following githubs instructions but when I go to paste the key to github I’m told:

“Key is invalid. It must begin with ‘ssh-ed25519’, ‘ssh-rsa’, ‘ssh-dss’, ‘ecdsa-sha2-nistp256’, ‘ecdsa-sha2-nistp384’, or ‘ecdsa-sha2-nistp521’. Check that you’re copying the public half of the key”

I’m absolutely positive I’m copying the entire ssh beginning just after
-----BEGIN RSA PRIVATE KEY-----
ending just before:
-----END RSA PRIVATE KEY-----

Any help would be greatly appreciated. Thanks for reading.


#2

You need to paste the public key (usually beginning with ssh-rsa), not the private one.

Most likely you do not need to create a new key, just run c9 ~/.ssh/id_rsa.pub to open the public key file created by cloud9 and add its contents to github