GitHub ssh keys - ssh test works but using git clone returns permission denied - github

I've been working on this for a few hours now and I've read everywhere but am officially stumped.
I'm trying to set up ssh keys for a dev-environment to interact with github. I've followed the guide on github and have made the keys and when I test them using the git#github.com it works but when I use git clone git#github.com:username/repo I get
Cloning into 'reponame'...
git#github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
I've tried adding it to ssh-add and that works, ssh-agent is running and has access. I've looked at the environment variable and set it to ssh among a few other things. I don't know what else to try. Let me know what logs I can post to help.
My thoughts are maybe the git command isn't using the identities or the right ssh client but other than the environment variables I'm not sure what else to change.
Thanks for the help in advance.

Related

yet again problems with ssh key... but this time on github

So, I have my pubkeys on github.
Somehow from one of my devices I can't push commits..
> git pull --tags origin main
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
of course I checked the ssh keys on my github page, thinking that maybe I forgot to put this specific device key in it.
but when I try to add it it tells me the key is already there.
Then I tried to connect through ssh to my github account and of course it works.
Hi mosfetti! You've successfully authenticated, but GitHub does not provide shell access.
What should I do?
Thanks
(Windows 10)
apparently something was rong with origin url..
still don't know why..
solved by adding the origin again
git remote set-url origin https://github.com/myuser/myrepo

How can you get the right access key to push in my git work to my github repo?

i encountered this problem while trying to push to my accountvia terminal, working on a site
and it kept giving me that fatal error "Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists."
i have tried getting access to another SSH key but still not working.
https://docs.github.com/en/authentication/connecting-to-github-with-ssh
This article would help you solve the problem.
Generate an ssh key
Add it to your account
Refresh the project both on github
On your command line and run the git command again.

Github SSH issue 'Permission Denied'

I am stuck on this annoying (and common) issue running Manjaro (latest). SSH works just fine for me on my local network. I can connect to my file server and pi-hole just fine.
GitHub however is proving more difficult.
gh repo clone User/Reponame gives the following:
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
Cloning into 'Reponame'...
warning: templates not found /usr/share/git-core/templates
The authenticity of host 'github.com (140.82.121.3)' can't be established.
RSA key fingerprint is SHA256:SomeLongNumberBlahBlah.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/home/USER/.ssh/known_hosts).
Load key "/home/USER/.ssh/id_rsa": Permission denied
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
exit status 128
Now I tried deleting my known_hosts, checking the file permission, creating new keys for my server/pi-hole and all works fine. I don't see why GH is struggling with permission. I've tried a few solutions but nothing seems to work for me. I've set my global user and email for github, I just can't get passed this step.
ssh -T git#github.com Asked for a passphrase and accepted it when I entered. Yay! I have both keys set and added to github.com via my browser etc. I must be missing something.
Still no change in the clone command. I am honestly stuck having read multiple threads on the subject. SSH always gets me :(

How to clone github private repository in cpanel (shared host without terminal or ssh)?

I have a shared host and they don't give me ssh or terminal for it.
I've tried to clone my private repos from git by Gitâ„¢ Version Control so I am using ssh link because they need permission. I don't know how to make ssh key on cpanel so I can make it from my mac and upload to cpanel and also add to Github.
But when running, they give me error: 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 a beginner for using Git & StackOverflow, so please let me know if there's anything wrong with the question I've asked. Thanks!
Tried Url with password
Cloning a private Github repo and
having a response "The clone URL cannot include a password."
This is different than what worked for the OP (hopefully they put their solution in an answer here).
I was able to solve this problem by installing an external SSH client (like PuTTY for Windows) and then SSH into my website using its IP address. Then I followed these steps from cPanel to connect the private repository.

GitHub, SSH & OS X Keychain Access

Setting up GitHub, and Im using SSH to connect. Following along hereto get all SSH set up. All is working well until i try to push an existing repository from the command line.
No problems with the following
git remote add origin git#github.com:<username>/first_app.git
But when I execut the following
git push -u origin master
things stop working.
My Keychain access dialog window pops up and wants the id_rsa password. Isn't this the passphrase I made up when i was following the steps on GitHub's how-to setup SSH? I think it is, but Keychain won't take the passphrase (I'm using this interchangeably with the word password).
I get: Permission denied (publickey).
fatal: Could not read from remote repository.
Can someone please help me connect the last piece of this puzzle so I can connect to GitHub via SSH? Thanks