git clone ssh permission denied

git, ssh

Solution

`git clone ssh://github.com/username/repository.git` is wrong. You should be doing:

git clone ssh://git@github.com/username/repository.git

or better yet:

git clone git@github.com:username/repository.git

Problem

I followed the instruction at https://help.github.com/articles/generating-ssh-keys and typing ``` ssh -T git@github.com ``` I get the message ``` Hi username! You've successfully authenticated, but GitHub does not # provide shell access. ``` When I try to clone a repository using ssh ``` git clone ssh://github.com/username/repository.git ``` I get ``` Permission denied (publickey). fatal: The remote end hung up unexpectedly ``` If I type ``` ssh-add -l ``` I see 3 keys one attached with my email address (k1) and other 2 inside `~/.ssh/id_rsa (RSA)` (k2 and k3). the key k3 is the same of k1 if I type ``` ssh -vT git@github.com ``` everything is fine...the only line that makes me thinking is ``` debug1: Remote protocol version 2.0, remote software version libssh-0.6.0 debug1: no match: libssh-0.6.0 ```

Original source