3

I've encountered a strange issue while trying to recursively clone a git repository:

# git clone --recursive git@github.com:eteran/edb-debugger.git
Initialized empty Git repository in /edb-debugger/.git/
The authenticity of host 'github.com (192.30.253.113)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'github.com,192.30.253.113' (RSA) to the list of known hosts.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

Trying on another machine returned a different result:

$ git clone --recursive git@github.com:eteran/edb-debugger.git
Cloning into 'edb-debugger'...
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I'm not sure what's going on with the inconsistent errors, or why this suddenly started happening when it was working perfectly fine shortly before. There are two ( separate ) other questions ( ¹ ) which mention each error, however, this is encapsulates both errors in one unrelated issue.

Any clue what the problem might be?

Community
  • 1
  • 1
l'L'l
  • 44,951
  • 10
  • 95
  • 146

2 Answers2

4

An other easy solution instead of messing with keys...

To force https instead of git

git config --global url."https://github.com/".insteadOf git@github.com:
git config --global url."https://".insteadOf git://

To force git instead of https

git config --global url."git@github.com:".insteadOf https://github.com/
git config --global url."git://".insteadOf https://
Tom
  • 962
  • 1
  • 14
  • 32
2

You can resolve this in 2 ways:

Either, Create ssh-key and add the public key of both computers in the github account. After that this command will work

 git clone --recursive git@github.com:eteran/edb-debugger.git

Or, clone using https. This will prompt for credentials enter the credentials and it will be cloned

git clone --recursive https://github.com/eteran/edb-debugger.git

In case you are having problem with already created ssh keys use this command to see if your ssh key is loaded properly and your public key is added properly in your github account. To see your loaded key:

ssh-add -l

It should list your key like this:

2048 SHA256:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX /Users/<username>/.ssh/id_rsa (RSA)
Ayon Nahiyan
  • 2,140
  • 15
  • 23
  • The first option really isn't ideal since I use hundreds of machines; the second option seemed to have worked without prompting for any credentials — so I'd say problem solved. Thanks! – l'L'l Sep 02 '16 at 08:21
  • Great! You're welcome :). It didn't ask for credentials because its a public repository. – Ayon Nahiyan Sep 02 '16 at 08:32