Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied when trying to anonymously clone a github repository

Tags:

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

like image 314
Michael Härtl Avatar asked Apr 24 '13 09:04

Michael Härtl


People also ask

How do I give permission to clone a git repository?

Open Security for a repository To choose another project, see Switch project, repository, team. Open Project settings>Repositories. To set the permissions for all Git repositories, choose Security. For example, here we choose (1) Project settings, (2) Repositories, and then (3) Security.

How do I fix error permission denied Publickey fatal could not read from remote repository GitHub?

The “Permission denied (publickey). fatal: Could not read from remote repository” error is caused by an issue with the way in which you authenticate with a Git repository. To solve this error, make sure your key is being used on your Git account. If it is not, add your key to Git.

How do I clone a private git repository with username and password?

If you want to clone it to a specific folder, just insert the folder address at the end like so: git clone https://<token>@github.com/<username>/<repository.git> <folder> , where <folder> is, you guessed it, the folder to clone it to! You can of course use . , .. , ~ , etc.


1 Answers

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.

like image 130
Michael Härtl Avatar answered Sep 20 '22 12:09

Michael Härtl