Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git clone ssh permission denied

Tags:

git

ssh

I followed the instruction at https://help.github.com/articles/generating-ssh-keys and typing

ssh -T [email protected]

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 [email protected]

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
like image 251
gabboshow Avatar asked May 20 '14 17:05

gabboshow


People also ask

How do I give permission to clone a git repository?

Go to github.com, click on your avatar and then "Settings". Find the "SSH and GPG keys" section on the left side and click on it. In the right pane, you'll see a list of SSH keys associated with your account. Each public key in this list grants the corresponding private key access to your repositories.

How do I resolve permission denied public key?

This error comes up when using a wrong private key or no key at all when trying to connect via SSH. To resolve the problem, you should generate a new key pair and connect using that new set of keys.

How do I fix Permission denied in Linux SSH?

If you want to use a password to access the SSH server, a solution for fixing the Permission denied error is to enable password login in the sshd_config file. In the file, find the PasswordAuthentication line and make sure it ends with yes . Find the ChallengeResponseAuthentication option and disable it by adding no .


1 Answers

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

git clone ssh://[email protected]/username/repository.git

or better yet:

git clone [email protected]:username/repository.git
like image 120
manojlds Avatar answered Sep 21 '22 15:09

manojlds