Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission denied for cloning via git #23

Open
spinicist opened this issue Feb 13, 2021 · 5 comments
Open

Permission denied for cloning via git #23

spinicist opened this issue Feb 13, 2021 · 5 comments

Comments

@spinicist
Copy link

Hello,

git clone [email protected]:themefisher/academia-hugo.git

results in:

[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Cloning over https, i.e. git clone https://github.com/themefisher/academia-hugo.git, works fine.

@jpmvferreira
Copy link

This is most likely an issue with your ssh key.

Let me try to guess and say that you've recently added your SSH key into github and the added that same SSH key by using ssh-add, if yes, then what happens is that adding that SSH key isn't permanent and is removed after a while (don't ask me why), so as a workaround you must then create a file in ~/.ssh/config and write IdentityFile ~/.ssh/your_private_key_name_here to it.

@spinicist
Copy link
Author

I have no SSH keys associated with my account at all (never got round to it).

What is the advantage of cloning via the git protocol rather than over https?

@jpmvferreira
Copy link

For authentication, for example, if you clone one of your repositories throught HTTPS you have to provide username and password to verify your identity.

If you use add an SSH key to your github and then locally on your machine you can clone using SSH and each time you push to the remote origin it sees that it is in fact you and doesn't ask you for any credentials.

But from what I remember cloning with SSH even without keys should work, you simply wouldn't be able to push commits to github.

Considering this is a repository you don't own and you are probably just going to add this in the themes folder for your website, then HTTPS does everything you want, which is just cloning it locally.

@spinicist
Copy link
Author

Thanks - but given that the majority of users will be in the same boat (won't have access to this repo), would it not be better for the instructions to suggest cloning via https instead of git?

@jpmvferreira
Copy link

Probably, yeah. Now that I think about it, if I'm thinking correctly, cloning through SSH, because it's git servers, would require you actually login their servers, which considering it's SSH I would assume it would be restricted, so the issue might come from there.

They probably have some information about it in their documentation somewhere, it's a matter of looking for it.

I don't think any problem can arise from using HTTP cloning, that's how it's done all the times anyways.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants