25

As an anonymous user (no public key stored at github) I try to clone a public repository through the git@... URL. But it fails:

$ git clone git@github.com:mikehaertl/phpwkhtmltopdf.git
Cloning into 'phpwkhtmltopdf'...
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

So does this mean, github does not allow anonymous access through the SSH protocol? If so, is this documented somewhere?

Michael Härtl
  • 8,428
  • 5
  • 35
  • 62

3 Answers3

46

I just found out that there's another button at github that says "Git Read-only". It gives a similar but slightly different URL that works:

git://github.com/mikehaertl/phpwkhtmltopdf.git

EDIT: As @damick pointed out below the button seems to be gone now. But you can still manually change the original URL to match the pattern shown here.

Michael Härtl
  • 8,428
  • 5
  • 35
  • 62
  • i don't see that button anywhere anymore, but i was able to edit my clone link like yours and it worked. thanks! – damick Jan 30 '17 at 22:23
8

That is most likely because it was trying to use SSH credentials, and with https its not. Therefore when you used

git clone git://github.com/mikehaertl/phpwkhtmltopdf.git

it worked. :D

simi
  • 89
  • 1
  • 5
0

I think you should just use git clone https://github.com/mikehaertl/phpwkhtmltopdf.git

swietyy
  • 786
  • 1
  • 9
  • 15