Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SSH Public key denied on "git clone" command

Tags:

I am trying to clone a git repo that I forked in my GitHub Repository.It's a rails app. I want to clone it on my local git so that I can push it onto heroku. I generated a set of rsa keys and copied it onto my GitHUb public keys. When I try to git clone "public url" , It says public key denied. I tried an ssh [email protected] to verify my key, it also says public key denied. I've tried several different things to make it work but it still hasn't. I tried to change permissions to 600 and 700 on my .ssh folder. I also tried adding a dsa key because the rsa won't work. please help me. Thanks. :)

I'm on Vista btw.

like image 353
KT. Avatar asked Dec 01 '09 02:12

KT.


People also ask

How do I fix git permission denied public key?

In terminal enter this command with your ssh file name pbcopy < ~/. ssh/id_rsa. pub This will copy the file to your clipboard Now open you github account Go to Settings > SSH and GPG keys > New SSH key Enter title and paste the key from clipboard and save it. Voila you're done.

Can clone git repository permission denied?

If your attempt to clone a GitHub repository over SSH is foiled by GitHub's Permission denied (publickey) SSH error, there's usually a quick fix. GitHub's Permission denied (publickey) error is usually caused by one of the following three issues: You have used an incorrect email address in the GitHub SSH URL.

Which SSH key is used for git clone?

Since git just uses ssh to connect, it will use whichever key ssh would use to connect to the remote host. See the ~/. ssh/config file for details; the host block uses the IdentityFile directive to specify the private key to use. The ssh_config(5) manpage contains full details.


2 Answers

Copy the public key on your computer i.e., ~/.ssh/id_rsa.pub (open it with notepad)

Paste this key in the "Add SSH key" section in your github account.

Note: to generate a ssh key if doesnt already exist, use ssh-keygen -t rsa

like image 39
Srinivas Kattimani Avatar answered Sep 19 '22 17:09

Srinivas Kattimani


Answering a very old thread, here, but I'm on Cygwin and just had to do this to start work with my newly created site on phpfog.com

First, I ran this in cygwin:

exec ssh-agent bash
ssh-add ~/.ssh/private-key-name

I then received:

Identity added: /home/scott/.ssh/private-key-name (/home/scott/.ssh/private-key-name)
like image 125
Scott Avatar answered Sep 17 '22 17:09

Scott